Переглянути джерело

Use the git-version plugin.

pull/306/head
Chris Smith 9 роки тому
джерело
коміт
b0f2a4a31f
1 змінених файлів з 4 додано та 17 видалено
  1. 4
    17
      build.gradle

+ 4
- 17
build.gradle Переглянути файл

1
-import org.eclipse.jgit.api.Git
2
-import org.eclipse.jgit.storage.file.FileRepositoryBuilder
3
-
4
 subprojects {
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
     apply plugin: 'java'
3
     apply plugin: 'java'
16
     apply plugin: 'findbugs'
4
     apply plugin: 'findbugs'
17
     apply plugin: 'pmd'
5
     apply plugin: 'pmd'
146
 buildscript {
134
 buildscript {
147
     repositories {
135
     repositories {
148
         mavenCentral()
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
     dependencies {
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
 

Завантаження…
Відмінити
Зберегти