Ben Gruver | 7d7ee58 | 2012-09-14 20:56:58 -0700 | [diff] [blame] | 1 | subprojects { |
| 2 | apply plugin: 'java' |
| 3 | |
Ben Gruver | 7d1263a | 2012-09-15 16:54:20 -0700 | [diff] [blame^] | 4 | 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 Gruver | 7d7ee58 | 2012-09-14 20:56:58 -0700 | [diff] [blame] | 29 | repositories { |
| 30 | mavenCentral() |
| 31 | } |
Ben Gruver | 7d1263a | 2012-09-15 16:54:20 -0700 | [diff] [blame^] | 32 | |
| 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 | |
| 40 | buildscript { |
| 41 | repositories { |
| 42 | mavenCentral() |
| 43 | } |
| 44 | dependencies { |
| 45 | classpath 'org.eclipse.jgit:org.eclipse.jgit:2.0.0.201206130900-r' |
| 46 | } |
Ben Gruver | 7d7ee58 | 2012-09-14 20:56:58 -0700 | [diff] [blame] | 47 | } |