Ver código fonte

Use the git-version plugin.

pull/306/head
Chris Smith 9 anos atrás
pai
commit
b0f2a4a31f
1 arquivos alterados com 4 adições e 17 exclusões
  1. 4
    17
      build.gradle

+ 4
- 17
build.gradle Ver arquivo

@@ -1,17 +1,5 @@
1
-import org.eclipse.jgit.api.Git
2
-import org.eclipse.jgit.storage.file.FileRepositoryBuilder
3
-
4 1
 subprojects {
5
-    def gitdir = new File(projectDir.parent, '.git')
6
-    if (gitdir.isFile()) {
7
-        gitdir = new File(projectDir.parent, gitdir.text.replace('gitdir: ','').trim())
8
-    }
9
-
10
-    def repo = new FileRepositoryBuilder().setGitDir(gitdir).build()
11
-    def git = Git.wrap(repo)
12
-    def objectId = git.log().addPath(projectDir.name).setMaxCount(1).call().first().id
13
-    project.version = git.describe().setTarget(objectId).call() + '-SNAPSHOT'
14
-
2
+    apply plugin: 'com.dmdirc.git-version'
15 3
     apply plugin: 'java'
16 4
     apply plugin: 'findbugs'
17 5
     apply plugin: 'pmd'
@@ -146,13 +134,12 @@ allprojects {
146 134
 buildscript {
147 135
     repositories {
148 136
         mavenCentral()
149
-        maven {
150
-            url 'http://artifactory.dmdirc.com/artifactory/repo'
151
-        }
137
+        maven { url 'http://artifactory.dmdirc.com/artifactory/repo' }
138
+        maven { url 'https://dl.bintray.com/dmdirc/releases/' }
152 139
     }
153 140
 
154 141
     dependencies {
155
-        classpath group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '3.6.1.201501031845-r'
142
+        classpath group: 'com.dmdirc', name: 'git-version', version: '1.0'
156 143
     }
157 144
 }
158 145
 

Carregando…
Cancelar
Salvar