improve build server performance by allowing disabling of pre-dexing
It seems that Google is finally paying some attention to CI builds with the emulator, they issued a recommendation: http://tools.android.com/tech-docs/new-build-system/tips#TOC-Improving-Build-Server-performance
This commit is contained in:
		
							parent
							
								
									aaf5bfe1db
								
							
						
					
					
						commit
						41b2e175c9
					
				| @ -17,7 +17,7 @@ gradle: | |||||||
|     # always report on lint errors to the build log |     # always report on lint errors to the build log | ||||||
|     - sed -i -e 's,textReport .*,textReport true,' app/build.gradle |     - sed -i -e 's,textReport .*,textReport true,' app/build.gradle | ||||||
|     # 'build' means assemble and check |     # 'build' means assemble and check | ||||||
|     - ./gradlew build || { |     - ./gradlew build -PdisablePreDex || { | ||||||
|           for log in app/build/reports/*ests/*/*ml; do |           for log in app/build/reports/*ests/*/*ml; do | ||||||
|               echo "read $log here:" |               echo "read $log here:" | ||||||
|               cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com; |               cat "$log" | curl --silent -F 'clbin=<-' https://clbin.com; | ||||||
| @ -40,7 +40,7 @@ gradle: | |||||||
|     - ./tools/wait-for-emulator |     - ./tools/wait-for-emulator | ||||||
|     - adb shell input keyevent 82 |     - adb shell input keyevent 82 | ||||||
|     - export EXITVALUE=0 |     - export EXITVALUE=0 | ||||||
|     - ADB_INSTALL_TIMEOUT=8 ./gradlew connectedCheck || { |     - ADB_INSTALL_TIMEOUT=8 ./gradlew connectedCheck -PdisablePreDex || { | ||||||
|         adb -e logcat -d '*:E'; |         adb -e logcat -d '*:E'; | ||||||
|         echo "get the full logcat here:"; |         echo "get the full logcat here:"; | ||||||
|         adb -e logcat -d | curl --silent -F 'clbin=<-' https://clbin.com; |         adb -e logcat -d | curl --silent -F 'clbin=<-' https://clbin.com; | ||||||
| @ -57,12 +57,12 @@ gradle: | |||||||
| pmd: | pmd: | ||||||
|   script: |   script: | ||||||
|     - export GRADLE_USER_HOME=$PWD/.gradle |     - export GRADLE_USER_HOME=$PWD/.gradle | ||||||
|     - ./gradlew pmd |     - ./gradlew pmd -PdisablePreDex | ||||||
| 
 | 
 | ||||||
| checkstyle: | checkstyle: | ||||||
|   script: |   script: | ||||||
|     - export GRADLE_USER_HOME=$PWD/.gradle |     - export GRADLE_USER_HOME=$PWD/.gradle | ||||||
|     - ./gradlew checkstyle |     - ./gradlew checkstyle -PdisablePreDex | ||||||
| 
 | 
 | ||||||
| tools: | tools: | ||||||
|   script: |   script: | ||||||
|  | |||||||
							
								
								
									
										16
									
								
								build.gradle
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								build.gradle
									
									
									
									
									
								
							| @ -7,3 +7,19 @@ buildscript { | |||||||
|         classpath files('libs/gradle-witness.jar') |         classpath files('libs/gradle-witness.jar') | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * Improve build server performance by allowing disabling of pre-dexing | ||||||
|  |  * (see http://tools.android.com/tech-docs/new-build-system/tips#TOC-Improving-Build-Server-performance.) | ||||||
|  |  */ | ||||||
|  | project.ext.preDexLibs = !project.hasProperty('disablePreDex') | ||||||
|  | 
 | ||||||
|  | subprojects { | ||||||
|  |   project.plugins.whenPluginAdded { plugin -> | ||||||
|  |     if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name)) { | ||||||
|  |       project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs | ||||||
|  |     } else if ("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) { | ||||||
|  |       project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Hans-Christoph Steiner
						Hans-Christoph Steiner