Remove @author tags
[Sone.git] / version.gradle
1 buildscript {
2     repositories {
3         mavenCentral()
4     }
5     dependencies {
6                 classpath group: "org.ajoberstar", name: "gradle-git", version: "1.3.0"
7     }
8 }
9
10 import org.ajoberstar.grgit.Grgit
11
12 task(writeVersion) {
13     doLast {
14         def grgit = Grgit.open(dir: project.rootDir)
15         def version = grgit.resolve.toCommit("HEAD").id
16         def niceVersion = grgit.describe()
17         grgit.close()
18
19         new File("src/generated/resources").mkdirs()
20         project.file("src/generated/resources/version.yaml").withWriter { out ->
21             out.println "id: ${version}"
22             out.println "nice: ${niceVersion}"
23         }
24     }
25 }
26
27 sourceSets {
28     main {
29         resources {
30             srcDirs += "src/generated/resources"
31         }
32     }
33 }
34
35 processResources {
36     dependsOn(writeVersion)
37 }
38