File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -16,9 +16,11 @@ val versionProps = Properties().apply {
1616 }
1717}
1818
19- // 优先使用环境变量,否则使用 version.properties 中的值
20- val appVersionCode: Int = (System .getenv(" APP_VERSION_CODE" ) ? : versionProps.getProperty(" versionCode" , " 22" )).toInt()
21- val appVersionName: String = System .getenv(" APP_VERSION_NAME" ) ? : versionProps.getProperty(" versionName" , " 5.4.1" )
19+ // 优先使用环境变量(非空时),否则使用 version.properties 中的值
20+ val appVersionCode: Int = (System .getenv(" APP_VERSION_CODE" )?.takeIf { it.isNotBlank() }
21+ ? : versionProps.getProperty(" versionCode" , " 22" )).toInt()
22+ val appVersionName: String = System .getenv(" APP_VERSION_NAME" )?.takeIf { it.isNotBlank() }
23+ ? : versionProps.getProperty(" versionName" , " 5.4.1" )
2224
2325buildscript {
2426 repositories {
You can’t perform that action at this time.
0 commit comments