Compare commits

...

1 Commits

2 changed files with 48 additions and 1 deletions

View File

@@ -111,6 +111,38 @@ android {
println '[ WinBoLLStudio ] : The APKOutputPath property is not defined in winboll.properties, please configure APK output folder first.'
} else {
/// WINBOLL 主机的 APK 发布和源码管理操作 ///
// Stage Debug 编译前清理任务
// 当目标应用包文件已经存在时,先删除旧有的应用包文件,再执行 assembleStageDebug 编译。
if(variant.flavorName == "stage" && variant.buildType.name == "debug") {
String szCfgVersionName = "${versionName}"
String[] szCfgListTemp = szCfgVersionName.split("-")
String szCfgShortVersionName = szCfgListTemp[0]
String szCfgCommonTagAPKName = project.rootDir.name + "_" + szCfgShortVersionName + ".apk"
File cfgOutTagDir = new File(fWinBoLLStudioDir, "/" + project.rootDir.name + "/${variant.buildType.name}/")
def cleanOldStageDebugApkTask = tasks.register("cleanOld${variant.name.capitalize()}Apk") {
group = 'build'
description = '删除旧有的 Stage Debug 应用包文件(存在时),然后才执行编译。'
doLast {
[szCfgCommonTagAPKName, outputFileName].unique().each { String apkName ->
File oldApkFile = new File(cfgOutTagDir, apkName)
if(oldApkFile.exists()) {
println "[ WinBoLLStudio ] : Delete old APK -> " + oldApkFile.getAbsolutePath()
if(!oldApkFile.delete()) {
throw new GradleException("Can not delete old APK : " + oldApkFile.getAbsolutePath())
}
}
}
}
} // tasks.register(
// 编译任务先执行清理旧应用包任务
variant.getAssembleProvider().configure {
dependsOn cleanOldStageDebugApkTask
}
} // if(stage && debug)
variant.getAssembleProvider().get().doFirst {
/* 后期管理预留代码 */
} //doFirst {

View File

@@ -20,5 +20,20 @@
## 开发约束
- 只修改 `winboll/` 目录(含 `src/`、`build.gradle` 等)进行开发。
- 只允许修改 `winboll/` 目录(含 `src/`、`build.gradle` 等)和 `.winboll/` 目录(构建/发布脚本、`*_build.gradle` 模板等)进行开发。
- 不要改动 `aes/`、`appbase/`、`libaes/`、`libappbase/` 及根目录配置文件。
## 源码提交(Git 注释)工作流
当用户说「提交一下源码」时,按以下两步处理,未经确认绝不提交:
1. **生成注释预览方案(只读,不改动仓库)**
- 执行 `git status --short`、`git diff` 查看全部修改内容,必要时用 `git diff --staged`、`git log --oneline -10` 参考历史注释风格。
- 根据实际修改内容撰写提交注释(中文简述为主,发布类沿用 `<winboll>...` 风格)。
- 向用户输出一份提交方案预览:包含**注释全文**、**将要提交的文件清单**、**不提交的文件及原因**(如构建产物、临时文件),交由用户审查。
2. **用户回复「确定」后才实际提交**
- 只 `git add` 预览中列出的文件,不夹带无关改动。
- 执行 `git commit`,提交注释必须与用户确认过的完全一致。
- 未经用户明确「确定」,不得执行 `git commit`;用户修改注释后需重新给出预览并再次等待确认。
- 本工作流默认只提交到本地,`git push` 需用户另行指示。