From a1de5080ae5d905bcbeb27bfd4e798b07f4c4e2d Mon Sep 17 00:00:00 2001 From: conanoc Date: Fri, 23 Feb 2024 15:08:22 +0900 Subject: [PATCH] Fix version not defined exception (#23) Signed-off-by: conanoc --- ariesframework/build.gradle | 9 +++++++-- settings.gradle | 6 +++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ariesframework/build.gradle b/ariesframework/build.gradle index 9f67be0..6f1c57e 100644 --- a/ariesframework/build.gradle +++ b/ariesframework/build.gradle @@ -70,6 +70,7 @@ dependencies { ext["githubUsername"] = null ext["githubToken"] = null +ext["version"] = "2.0.0" def secretPropsFile = project.rootProject.file("local.properties") if (secretPropsFile.exists()) { @@ -82,10 +83,14 @@ if (secretPropsFile.exists()) { ext["version"] = System.getenv("VERSION") } -ext["version"] = ext["version"]?.replaceFirst("v", "") +ext["version"] = ext["version"].replaceFirst("v", "") def getExtraString(name) { - return ext[name] ?: "" + try { + return ext[name] + } catch (ignored) { + return "" + } } afterEvaluate { diff --git a/settings.gradle b/settings.gradle index 4e63cf2..da871de 100644 --- a/settings.gradle +++ b/settings.gradle @@ -20,7 +20,11 @@ if (secretPropsFile.exists()) { } def getExtraString(name) { - return ext[name] ?: "" + try { + return ext[name] + } catch (ignored) { + return "" + } } dependencyResolutionManagement {