优化APK输出路径设置,改为配置形式。

This commit is contained in:
ZhanGSKen
2025-09-15 17:33:11 +08:00
parent 0bc0fdf8c2
commit 2220efd009
4 changed files with 26 additions and 15 deletions

View File

@@ -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}"
}
}
}
}

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Mon Sep 15 02:06:44 HKT 2025
#Mon Sep 15 17:31:47 HKT 2025
stageCount=6
libraryProject=libappbase
baseVersion=15.9
publishVersion=15.9.5
buildCount=23
buildCount=44
baseBetaVersion=15.9.6

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Mon Sep 15 02:06:44 HKT 2025
#Mon Sep 15 17:31:47 HKT 2025
stageCount=6
libraryProject=libappbase
baseVersion=15.9
publishVersion=15.9.5
buildCount=23
buildCount=44
baseBetaVersion=15.9.6

View File

@@ -3,6 +3,9 @@
## library project to WinBoLL Nexus Maven Repository.
##
## WinBoLL Extra APK file Output Path
#ExtraAPKOutputPath=/sdcard/AppProjects/app.apk
## WinBoLL Nexus UserName
#Nexus.name=nexustestuser1