mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-07 16:06:08 +00:00
Added Ant custom rules to overwrite setup.xml values from environment variables
This commit is contained in:
parent
91cf262092
commit
982748df45
47
test_client/custom_rules.xml
Normal file
47
test_client/custom_rules.xml
Normal file
@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="custom_rules">
|
||||
<target name="-pre-build" >
|
||||
<!-- Replace OC server URL if set in environment -->
|
||||
<if>
|
||||
<condition>
|
||||
<isset property="env.OCTEST_SERVER_BASE_URL" />
|
||||
</condition>
|
||||
<then>
|
||||
<replaceregexp
|
||||
file="res/values/setup.xml"
|
||||
match='("server_base_url">)\s*(<)'
|
||||
replace="\1${env.OCTEST_SERVER_BASE_URL}\2"
|
||||
byline="true" />
|
||||
</then>
|
||||
</if>
|
||||
|
||||
<!-- Replace test username if set in environment -->
|
||||
<if>
|
||||
<condition>
|
||||
<isset property="env.OCTEST_USERNAME" />
|
||||
</condition>
|
||||
<then>
|
||||
<echo>Setting username ${env.OC_TEST_USERNAME}</echo>
|
||||
<replaceregexp
|
||||
file="res/values/setup.xml"
|
||||
match='("username">)\s*(<)'
|
||||
replace="\1${env.OCTEST_USERNAME}\2"
|
||||
byline="true" />
|
||||
</then>
|
||||
</if>
|
||||
|
||||
<!-- Replace test username if set in environment -->
|
||||
<if>
|
||||
<condition>
|
||||
<isset property="env.OCTEST_PASSWORD" />
|
||||
</condition>
|
||||
<then>
|
||||
<replaceregexp
|
||||
file="res/values/setup.xml"
|
||||
match='("password">)\s*(<)'
|
||||
replace="\1${env.OCTEST_PASSWORD}\2"
|
||||
byline="true" />
|
||||
</then>
|
||||
</if>
|
||||
</target>
|
||||
</project>
|
Loading…
x
Reference in New Issue
Block a user