Skip to content
Commits on Source (6)
......@@ -3,7 +3,7 @@ apply plugin: 'maven'
apply plugin: "com.gradle.plugin-publish"
group = 'com.peterabeles.gversion'
version = '1.5.0'
version = '1.5.2'
project.archivesBaseName = 'gversion'
......@@ -31,6 +31,13 @@ repositories {
dependencies {
compile gradleApi()
compile localGroovy()
testImplementation(
'org.junit.jupiter:junit-jupiter-api:5.4.0'
)
testRuntimeOnly(
'org.junit.jupiter:junit-jupiter-engine:5.4.0'
)
}
task wrapper(type: Wrapper) {
......
## 1.5.2
- Fixed issue when git has a longer version
## 1.5.1
- Java creates a private constructor to hide implicit public one
## 1.5
- Changes to file path
......
gversion-plugin (1.5.2+dfsg-1) unstable; urgency=medium
* New upstream version 1.5.2+dfsg
-- Andrius Merkys <merkys@debian.org> Fri, 13 Sep 2019 05:03:40 -0400
gversion-plugin (1.5.0+dfsg-2) unstable; urgency=medium
* Executing tests during build.
......
Description: Removing unpackaged test plugin.
Author: Andrius Merkys <merkys@debian.org>
--- a/build.gradle
+++ b/build.gradle
@@ -27,13 +27,6 @@
dependencies {
compile gradleApi()
compile localGroovy()
-
- testImplementation(
- 'org.junit.jupiter:junit-jupiter-api:5.4.0'
- )
- testRuntimeOnly(
- 'org.junit.jupiter:junit-jupiter-engine:5.4.0'
- )
}
task wrapper(type: Wrapper) {
--- a/src/test/groovy/com/peterabeles/TestGVersion.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.peterabeles;
-
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
-/**
- * @author Peter Abeles
- */
-class TestGVersion {
- @Test
- void git_version() {
- check(2,17,1,GVersion.parseGitVersion("git version 2.17.1"));
- check(1,7,10,GVersion.parseGitVersion("git version 1.7.10.4"));
- check(1,7,0,GVersion.parseGitVersion("git version 1.7"));
- check(1,0,0,GVersion.parseGitVersion("git version 1"));
- }
-
- private void check(int a, int b , int c , int[] version ) {
- assertEquals(a,version[0]);
- assertEquals(b,version[1]);
- assertEquals(c,version[2]);
- }
-}
\ No newline at end of file
......@@ -8,7 +8,7 @@ Author: Andrius Merkys <merkys@debian.org>
-apply plugin: "com.gradle.plugin-publish"
group = 'com.peterabeles.gversion'
version = '1.5.0'
version = '1.5.2'
@@ -13,9 +12,6 @@
url "https://plugins.gradle.org/m2/"
}
......@@ -19,7 +19,7 @@ Author: Andrius Merkys <merkys@debian.org>
}
repositories {
@@ -37,17 +33,3 @@
@@ -44,17 +40,3 @@
distributionType = Wrapper.DistributionType.BIN
gradleVersion = '4.10.2'
}
......
remove-plugin-publish-plugin.patch
remove-junit-jupiter.patch
......@@ -94,12 +94,12 @@ class GVersion implements Plugin<Project> {
return version
words = words[2].split("\\.")
if( words.length != 3 )
if( words.length < 1 )
return version
version[0] = Integer.parseInt(words[0])
version[1] = Integer.parseInt(words[1])
version[2] = Integer.parseInt(words[2])
for (int i = 0; i < Math.min(version.length,words.length); i++) {
version[i] = Integer.parseInt(words[i])
}
return version
}
......@@ -261,7 +261,7 @@ class GVersion implements Plugin<Project> {
writer << "/**\n"
writer << " * Automatically generated file containing build version information.\n"
writer << " */\n"
writer << "public class " + extension.className + " {\n"
writer << "public final class $extension.className {\n"
writer << "\tpublic static final String MAVEN_GROUP = \"$project.group\";\n"
writer << "\tpublic static final String MAVEN_NAME = \"$project.name\";\n"
writer << "\tpublic static final String VERSION = \"$project.version\";\n"
......@@ -270,6 +270,8 @@ class GVersion implements Plugin<Project> {
writer << "\tpublic static final String GIT_DATE = \"$git_date\";\n"
writer << "\tpublic static final String BUILD_DATE = \"$date_string\";\n"
writer << "\tpublic static final long BUILD_UNIX_TIME = " + unix_time + "L;\n"
writer << "\n"
writer << "\tprivate $extension.className(){}\n" // hide implicit public constructor
writer << "}"
writer.flush()
writer.close()
......
package com.peterabeles;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* @author Peter Abeles
*/
class TestGVersion {
@Test
void git_version() {
check(2,17,1,GVersion.parseGitVersion("git version 2.17.1"));
check(1,7,10,GVersion.parseGitVersion("git version 1.7.10.4"));
check(1,7,0,GVersion.parseGitVersion("git version 1.7"));
check(1,0,0,GVersion.parseGitVersion("git version 1"));
}
private void check(int a, int b , int c , int[] version ) {
assertEquals(a,version[0]);
assertEquals(b,version[1]);
assertEquals(c,version[2]);
}
}
\ No newline at end of file