Skip to content

Commit

Permalink
Fix version not defined exception (#23)
Browse files Browse the repository at this point in the history
Signed-off-by: conanoc <conanoc@gmail.com>
  • Loading branch information
conanoc committed Feb 23, 2024
1 parent 68dc86e commit a1de508
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 7 additions & 2 deletions ariesframework/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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 {
Expand Down
6 changes: 5 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ if (secretPropsFile.exists()) {
}

def getExtraString(name) {
return ext[name] ?: ""
try {
return ext[name]
} catch (ignored) {
return ""
}
}

dependencyResolutionManagement {
Expand Down

0 comments on commit a1de508

Please sign in to comment.