From d8eb37206324da9f299c99c3ff05532cb9fabaeb Mon Sep 17 00:00:00 2001 From: Eyre_S Date: Tue, 8 Nov 2022 22:37:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9E=84=E5=BB=BA=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E4=B8=AD=20version=20delta=20=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 现在如果 use_delta 为 false 则输出 BuildConfig.VERSION_DELTA 为 null --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 35b05c0..60a856a 100644 --- a/build.gradle +++ b/build.gradle @@ -40,7 +40,7 @@ final String proj_application_main = "${proj_package}.ServerMain" final String proj_version_base = VERSION final String proj_version_delta = VERSION_DELTA -final String proj_version_use_delta = Boolean.parseBoolean(VERSION_DELTA) +final boolean proj_version_use_delta = Boolean.parseBoolean(USE_DELTA) String proj_version = proj_version_base if (proj_version_use_delta) proj_version += "-δ${proj_version_delta}" if (proj_git) proj_version += "+git.${proj_commit.substring(0, 8)}" + (proj_clean?"":".δ") @@ -120,7 +120,7 @@ buildConfig { packageName(proj_package) buildConfigField('String', 'VERSION', "\"${proj_version}\"") - buildConfigField('String', 'VERSION_DELTA', "\"${proj_version_delta}\"") + buildConfigField('String', 'VERSION_DELTA', proj_version_use_delta ? "\"${proj_version_delta}\"" : "null") buildConfigField('String', 'CODENAME', "\"${proj_version_codename}\"") buildConfigField('long', 'CODE_TIMESTAMP', "${proj_code_time}L") buildConfigField('String', 'COMMIT', proj_git ? "\"${proj_commit}\"" : "null")