From f8a606c7833f94a2e556fa8e9bdd63a8749664fd Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 26 Sep 2016 02:42:23 +1000 Subject: [PATCH] Tweak version --- build.gradle | 8 ++++---- core/build.gradle | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 603c999f..1775503c 100644 --- a/build.gradle +++ b/build.gradle @@ -25,12 +25,12 @@ ext { date = git.head().date.format("yy.MM.dd") revision = "-${git.head().abbreviatedId}" parents = git.head().parentIds; - index = -45; // Offset to mach CI + index = -47; // Offset to mach CI int major, minor, patch; major = minor = patch = 0; for (;parents != null && !parents.isEmpty();index++) { int majorCount, minorCount, patchCount; - patchCount = 1; + patchCount = minor == 0 && major == 0 ? 1 : 0; commit = git.getResolve().toCommit(parents.get(0)); for (String line : commit.fullMessage.tokenize("\n")) { switch (line.replaceAll("- ", "").split(" ")[0].toLowerCase()) { @@ -40,12 +40,12 @@ ext { case "change": case "changed": case "changes": - if (majorCount == 0) {minorCount = 1; patch = patchCount = 0;} + if (major == 0) {minorCount = 1; patchCount = 0;} break; case "refactor": case "remove": case "major": - patch = minor = minorCount = patchCount = 0; + patchCount = minorCount = 0; majorCount = 1; break; } diff --git a/core/build.gradle b/core/build.gradle index ac45cb26..bf650840 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -26,7 +26,6 @@ processResources { jar.archiveName="fawe-api-${project.parent.version}.jar" jar.destinationDir = file '../mvn/com/boydti/fawe-api/' + project.parent.version - task createPom << { pom { project { @@ -37,4 +36,17 @@ task createPom << { }.writeTo("../mvn/com/boydti/fawe-api/${project.parent.version}/fawe-api-${project.parent.version}.pom") } -build.finalizedBy(createPom) \ No newline at end of file +task copyFiles { + doLast { + copy { + from "../mvn/com/boydti/fawe-api/${project.parent.version}/" + into '../mvn/com/boydti/fawe-api/latest/' + include('*.*') + rename ("fawe-api-${project.parent.version}.pom", 'fawe-api-latest.pom') + rename ("fawe-api-${project.parent.version}.jar", 'fawe-api-latest.jar') + } + } +} + +build.finalizedBy(copyFiles) +copyFiles.dependsOn(createPom) \ No newline at end of file