Add test for DI constructability of TrustAjaxPage
[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         def grgit = Grgit.open(dir: project.rootDir)
14         def version = grgit.resolve.toCommit("HEAD").id
15         def niceVersion = grgit.describe()
16         grgit.close()
17
18     new File("src/generated/resources").mkdirs()
19         project.file("src/generated/resources/version.yaml").withWriter { out ->
20                 out.println "id: ${version}"
21                 out.println "nice: ${niceVersion}"
22         }
23 }
24
25 sourceSets {
26     main {
27         resources {
28             srcDirs += "src/generated/resources"
29         }
30     }
31 }
32
33 processResources {
34     dependsOn(writeVersion)
35 }
36