mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-31 10:27:45 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			75 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
			
		
		
	
	
			75 lines
		
	
	
		
			1.8 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">)\s*(<)'
 | |
| 					replace="\1${env.OCTEST_SERVER_BASE_URL}\2"
 | |
| 					byline="true" />
 | |
| 			</then>
 | |
| 		</if>
 | |
| 		
 | |
| 		<!-- Replace OC server URL 2 if set in environment -->
 | |
| 		<if>
 | |
| 			<condition>
 | |
| 				<isset property="env.OCTEST_SERVER_BASE_URL_2" />
 | |
| 			</condition>
 | |
| 			<then>
 | |
| 				<replaceregexp
 | |
| 					file="res/values/setup.xml"
 | |
| 					match='("server_base_url_2">)\s*(<)'
 | |
| 					replace="\1${env.OCTEST_SERVER_BASE_URL_2}\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">)\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>
 | |
| 		
 | |
| 		<!-- 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">)\s*(<)'
 | |
| 				replace="\1${env.TRAVIS_BUILD_NUMBER}\2"
 | |
| 				byline="true" />
 | |
| 			</then>
 | |
| 		</if>
 | |
| 	</target>
 | |
| </project> |