优化APK输出路径设置,改为配置形式。
This commit is contained in:
		| @@ -2,6 +2,11 @@ | ||||
| // | ||||
|  | ||||
| android { | ||||
| 	def winbollProps = new Properties() | ||||
|     def winbollPropsFile = rootProject.file("${winbollFilePath}") | ||||
|     assert(winbollPropsFile.exists()) | ||||
|     winbollProps.load(new FileInputStream(winbollPropsFile)) | ||||
|      | ||||
|     // 读取秘钥配置文件 | ||||
|     // | ||||
|     def keyProps = new Properties() | ||||
| @@ -232,20 +237,23 @@ android { | ||||
|                                 } | ||||
|                             } //  if(variant.buildType.name == "release"){ | ||||
|                              | ||||
|                             // 如果公共目录存在就拷贝到公共目录并重命名为app.apk | ||||
|                             // 如果配置了APK额外输出路径,就复制一份拷贝到额外路径。 | ||||
|                             // | ||||
|                             File outCommonDir = new File("/sdcard/AppProjects") | ||||
|                             String commandAPKName = "app.apk" | ||||
|                             if(outCommonDir.exists()) { | ||||
|                                 copy{ | ||||
|                                     from file.outputFile | ||||
|                                     into outCommonDir | ||||
|                                     rename { | ||||
|                                         String fileName -> "${commandAPKName}" | ||||
| 							if(winbollProps['ExtraAPKOutputPath'] != null ) { | ||||
|                                 File apkFile = new File(winbollProps['ExtraAPKOutputPath']) | ||||
| 								File outCommonDir = apkFile.getParentFile(); | ||||
|                                 String commandAPKName = apkFile.getName(); | ||||
|                                 if(outCommonDir.exists()) { | ||||
|                                     copy{ | ||||
|                                         from file.outputFile | ||||
|                                         into outCommonDir | ||||
|                                         rename { | ||||
|                                             String fileName -> "${commandAPKName}" | ||||
|                                         } | ||||
|                                         println "Output APK (Common): " + outCommonDir.getAbsolutePath() + "/${commandAPKName}" | ||||
|                                     } | ||||
|                                     println "Output APK (Common): " + outCommonDir.getAbsolutePath() + "/${commandAPKName}" | ||||
|                                 } | ||||
|                             } | ||||
| 						    } | ||||
|                              | ||||
|                          | ||||
|                     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 ZhanGSKen
					ZhanGSKen