diff --git a/build-test.gradle b/build-test.gradle index 71c4e92..06c3fd2 100644 --- a/build-test.gradle +++ b/build-test.gradle @@ -15,6 +15,6 @@ versioning { major 1 minor 2 } -println("TEST - VersionCode: " + versioning.versionCode) -println("TEST - VersionName: " + versioning.versionName) +println("TEST - VersionCode: " + versioning.code) +println("TEST - VersionName: " + versioning.name) println("TEST - FullVersionName: " + versioning.fullVersionName) \ No newline at end of file diff --git a/build.gradle b/build.gradle index 3392925..edae732 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,6 @@ buildscript { repositories { + mavenLocal() maven { url 'https://plugins.gradle.org/m2/' } @@ -17,6 +18,7 @@ apply plugin: 'maven' repositories { jcenter() + mavenLocal() } dependencies { diff --git a/module_a/build.gradle b/module_a/build.gradle index 39d5245..867d7bd 100644 --- a/module_a/build.gradle +++ b/module_a/build.gradle @@ -13,6 +13,6 @@ versioning { major 1 minor 1 } -println("MODULE_A - VersionCode: " + versioning.versionCode) -println("MODULE_A - VersionName: " + versioning.versionName) +println("MODULE_A - VersionCode: " + versioning.code) +println("MODULE_A - VersionName: " + versioning.name) println("MODULE_A - FullVersionName: " + versioning.fullVersionName) diff --git a/module_b/build.gradle b/module_b/build.gradle index 719122f..9294591 100644 --- a/module_b/build.gradle +++ b/module_b/build.gradle @@ -13,7 +13,7 @@ versioning { major 2 minor 2 } -println("MODULE_B - VersionCode: " + versioning.versionCode) -println("MODULE_B - VersionName: " + versioning.versionName) +println("MODULE_B - VersionCode: " + versioning.code) +println("MODULE_B - VersionName: " + versioning.name) println("MODULE_B - FullVersionName: " + versioning.fullVersionName) diff --git a/src/main/groovy/eu/davidea/gradle/VersioningExtension.groovy b/src/main/groovy/eu/davidea/gradle/VersioningExtension.groovy index 7aa2b0f..a8e4242 100644 --- a/src/main/groovy/eu/davidea/gradle/VersioningExtension.groovy +++ b/src/main/groovy/eu/davidea/gradle/VersioningExtension.groovy @@ -130,7 +130,7 @@ class VersioningExtension { (propMajor > 0 ? propMajor : major) + "." + (propMinor > 0 ? propMinor : minor) + "." + patch + - (preRelease != null ? "-" + preRelease : "") + + (preRelease != null && !preRelease.isEmpty() ? "-" + preRelease : "") + " #" + build + " code=" + code } diff --git a/src/test/groovy/eu/davidea/gradle/GrabVerTest.groovy b/src/test/groovy/eu/davidea/gradle/GrabVerTest.groovy index 6e8894d..38b05f2 100644 --- a/src/test/groovy/eu/davidea/gradle/GrabVerTest.groovy +++ b/src/test/groovy/eu/davidea/gradle/GrabVerTest.groovy @@ -119,8 +119,8 @@ class GrabVerTest { */ private void printResults(String title) { println("TEST - " + title) - println("TEST - versionCode=" + project.versioning.versionCode) - println("TEST - versionName=" + project.versioning.versionName) + println("TEST - code=" + project.versioning.code) + println("TEST - name=" + project.versioning.name) println("TEST - fullVersionName=" + project.versioning.fullVersionName) println("TEST - " + project.versioning) }