Skip to content

Commit

Permalink
Clean up gradle file
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakShearman committed Jan 13, 2022
1 parent 58d6a3e commit b534e77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ tasks {
processResources {
expand(mapOf(
"version" to version,
"build_number" to if (System.getenv("BUILD_NUMBER") == null) "unknown" else System.getenv("BUILD_NUMBER"),
"commit_hash" to if (System.getenv("BUILD_VCS_NUMBER") == null) "unknown" else System.getenv("BUILD_VCS_NUMBER")
"build_number" to if (hasProperty("BUILD_NUMBER")) System.getenv("BUILD_NUMBER") else "unknown",
"commit_hash" to if (hasProperty("BUILD_VCS_NUMBER")) System.getenv("BUILD_VCS_NUMBER") else "unknown"
))
}
named<Test>("test") {
Expand All @@ -63,7 +63,7 @@ publishing {
}
repositories {
maven {
val isSnapshot = System.getenv("BUILD_NUMBER") != null
val isSnapshot = hasProperty("BUILD_NUMBER")
url = uri(mavenRepo + (if (isSnapshot) "/snapshots" else "/releases"))

credentials {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ public static OperadoraMeta load() {
try {
String jsonString = new String(FileUtils.class.getClassLoader().getResourceAsStream("operadora.json").readAllBytes());
JsonObject jsonObject = JsonParser.parseString(jsonString).getAsJsonObject();
System.out.println(jsonString);
System.out.println(jsonObject);
return new OperadoraMeta(
jsonObject.get("version").getAsString(),
jsonObject.get("buildNumber").getAsString(),
jsonObject.get("commitHash").getAsString()
);
} catch (Exception ex) {
LOGGER.error("Error loading OperadoraMeta (MANIFEST.MF)", ex);
LOGGER.error("Error loading OperadoraMeta", ex);
return null;
}
}
Expand Down

0 comments on commit b534e77

Please sign in to comment.