Use zoned date time instead of local
[rhynodge.git] / build.gradle
1 apply plugin: "java"
2 apply plugin: "kotlin"
3 apply plugin: "war"
4 apply plugin: "jacoco"
5 apply plugin: "idea"
6
7 idea {
8         project {
9                 languageLevel = "1.8"
10         }
11 }
12
13 group = "net.pterodactylus"
14 version = "0.1"
15
16 sourceCompatibility = 1.8
17 targetCompatibility = 1.8
18
19 buildscript {
20     ext.kotlinVersion = '1.0.2'
21
22     repositories {
23         mavenCentral()
24     }
25     dependencies {
26         classpath group: "org.ajoberstar", name: "gradle-git", version: "1.1.0"
27         classpath group: "org.jetbrains.kotlin", name: "kotlin-gradle-plugin", version: "$kotlinVersion"
28     }
29 }
30
31 repositories {
32         mavenCentral()
33 }
34
35 dependencies {
36     compile group: "org.jetbrains.kotlin", name: "kotlin-stdlib", version: "$kotlinVersion"
37     compile group: "com.google.guava", name: "guava", version: "14.0-rc1"
38     compile group: "log4j", name: "log4j", version: "1.2.17"
39     compile group: "org.apache.httpcomponents", name: "httpclient", version: "4.4"
40     compile group: "org.jsoup", name: "jsoup", version: "1.7.1"
41     compile group: "javax.mail", name: "mail", version: "1.4.6-rc1"
42     compile group: "org.apache.commons", name: "commons-lang3", version: "3.1"
43     compile group: "com.fasterxml.jackson.core", name: "jackson-core", version: "2.1.2"
44     compile group: "com.fasterxml.jackson.core", name: "jackson-annotations", version: "2.1.2"
45     compile group: "com.fasterxml.jackson.core", name: "jackson-databind", version: "2.1.2"
46     compile group: "com.google.inject", name: "guice", version: "4.0"
47
48     testCompile group: "junit", name: "junit", version:"4.12"
49     testCompile group: "org.hamcrest", name: "hamcrest-library", version:"1.3"
50     testCompile group: "org.mockito", name: "mockito-core", version:"1.9.5"
51 }
52
53 task fatJar(type: Jar) {
54         baseName = project.name + "-all"
55         manifest {
56                 attributes(
57                         "Main-Class": "net.pterodactylus.rhynodge.engine.Starter"
58                 )
59         }
60         from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
61         from { sourceSets.generated.resources.srcDirs }
62         with jar
63         dependsOn test
64 }
65
66 task createVersion() {
67     sourceSets {
68         generated {
69             resources {
70                 srcDir "src/generated/resources"
71             }
72         }
73     }
74     processResources.dependsOn(createVersion)
75 }
76
77
78 import org.ajoberstar.grgit.Grgit
79 createVersion << {
80     def gitRepo = Grgit.open(".")
81     version = gitRepo.describe()
82     new File("src/generated/resources").mkdirs()
83     new File("src/generated/resources/version.txt").withWriter() { it.write(version) }
84 }
85
86 war {
87     classpath sourceSets.generated.output
88     dependsOn(test)
89 }
90
91 /* vim: set ts=4 sw=4 et: */