blob: 2e51d46fea1f69104c21afca4c917f15c45346f4 [file] [log] [blame]
Ben Gruver7d7ee582012-09-14 20:56:58 -07001subprojects {
2 apply plugin: 'java'
3
Ben Gruver7d1263a2012-09-15 16:54:20 -07004 version = "1.3.4"
5
6 // For non-release builds, we want to append the commit and
7 // dirty status to the version
8 gradle.taskGraph.whenReady {
9 if (!it.hasTask(release)) {
10 def versionSuffix
11 try {
12 def git = org.eclipse.jgit.api.Git.open(file('.'))
13 def head = git.getRepository().getRef("HEAD")
14 versionSuffix = head.getObjectId().abbreviate(8).name()
15
16 if (!git.status().call().clean) {
17 versionSuffix += '-dirty'
18 }
19 } catch (Exception) {
20 // In case we can't get the commit for some reason,
21 // just use -dev
22 versionSuffix = 'dev'
23 }
24
25 version += '-' + versionSuffix
26 }
27 }
28
Ben Gruver7d7ee582012-09-14 20:56:58 -070029 repositories {
30 mavenCentral()
31 }
Ben Gruver7d1263a2012-09-15 16:54:20 -070032
33 // Note: please don't use this. This is strictly for the official releases
34 // that are posted on the googlecode download page.
35 task release {
36 }
37}
38
39
40buildscript {
41 repositories {
42 mavenCentral()
43 }
44 dependencies {
45 classpath 'org.eclipse.jgit:org.eclipse.jgit:2.0.0.201206130900-r'
46 }
Ben Gruver7d7ee582012-09-14 20:56:58 -070047}