1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00
android-library/test_client/custom_rules.xml
2014-11-12 19:14:07 +01:00

61 lines
1.5 KiB
XML

<?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"&gt;)\s*(&lt;)'
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.OCTEST_USERNAME}</echo>
<replaceregexp
file="res/values/setup.xml"
match='("username"&gt;)\s*(&lt;)'
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"&gt;)\s*(&lt;)'
replace="\1${env.OCTEST_PASSWORD}\2"
byline="true" />
</then>
</if>
<!-- Make Travis build number available to the test app in the emulator -->
<if>
<condition>
<isset property="env.TRAVIS_BUILD_NUMBER" />
</condition>
<then>
<replaceregexp
file="res/values/setup.xml"
match='("build_number"&gt;)\s*(&lt;)'
replace="\1${env.TRAVIS_BUILD_NUMBER}\2"
byline="true" />
</then>
</if>
</target>
</project>