Browse Source

Version util jar properly.

pull/18/head
Chris Smith 9 years ago
parent
commit
621888989a
1 changed files with 5 additions and 16 deletions
  1. 5
    16
      build.gradle

+ 5
- 16
build.gradle View File

@@ -1,5 +1,9 @@
1 1
 import org.mdonoughe.JGitDescribeTask
2 2
 
3
+def jgit = new org.mdonoughe.JGitDescribeTask()
4
+jgit.setDir(new File("$projectDir", '.git'))
5
+project.version = jgit.getDescription() + '-SNAPSHOT'
6
+
3 7
 apply plugin: 'java'
4 8
 apply plugin: 'maven-publish'
5 9
 
@@ -62,22 +66,7 @@ task getCredentials << {
62 66
     }
63 67
 }
64 68
 
65
-task getVersion << {
66
-    def jgit = new org.mdonoughe.JGitDescribeTask()
67
-    jgit.setDir(new File("$rootDir", '.git'))
68
-
69
-    project.version = jgit.getDescription() + '-SNAPSHOT'
70
-
71
-    project.tasks.withType(PublishToMavenRepository) {
72
-        publishTask -> publishTask.publication.version = project.version
73
-    }
74
-
75
-    project.tasks.withType(GenerateMavenPom).each {
76
-        generateMavenPomTask -> generateMavenPomTask.pom.getProjectIdentity().version = project.version
77
-    }
78
-}
79
-
80
-task publishSnapshot(dependsOn: ['getCredentials', 'getVersion', 'publishMavenJavaPublicationToSnapshotsRepository']) << {
69
+task publishSnapshot(dependsOn: ['getCredentials', 'publishMavenJavaPublicationToSnapshotsRepository']) << {
81 70
 }
82 71
 
83 72
 buildscript {

Loading…
Cancel
Save