fix bc
[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.2.51'
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     maven {
34         url "http://dl.bintray.com/kotlinx/kotlinx"
35     }
36 }
37
38 dependencies {
39     compile group: "org.jetbrains.kotlin", name: "kotlin-stdlib", version: "$kotlinVersion"
40     compile group: "com.google.guava", name: "guava", version: "14.0-rc1"
41     compile group: "log4j", name: "log4j", version: "1.2.17"
42     compile group: "org.apache.httpcomponents", name: "httpclient", version: "4.4"
43     compile group: "org.jsoup", name: "jsoup", version: "1.7.1"
44     compile group: "javax.mail", name: "mail", version: "1.4.6-rc1"
45     compile group: "org.apache.commons", name: "commons-lang3", version: "3.1"
46     compile group: "com.fasterxml.jackson.core", name: "jackson-core", version: "2.1.2"
47     compile group: "com.fasterxml.jackson.core", name: "jackson-annotations", version: "2.1.2"
48     compile group: "com.fasterxml.jackson.core", name: "jackson-databind", version: "2.1.2"
49     compile group: "com.google.inject", name: "guice", version: "4.0"
50     compile group: "org.jetbrains.kotlinx", name: "kotlinx.html", version: "0.5.8"
51     compile group: "org.jetbrains.kotlinx", name: "kotlinx.html.jvm", version: "0.5.8"
52
53     testCompile group: "junit", name: "junit", version:"4.12"
54     testCompile group: "org.hamcrest", name: "hamcrest-library", version:"1.3"
55     testCompile group: "org.mockito", name: "mockito-core", version:"1.9.5"
56 }
57
58 task fatJar(type: Jar) {
59         baseName = project.name + "-all"
60         manifest {
61                 attributes(
62                         "Main-Class": "net.pterodactylus.rhynodge.engine.Starter"
63                 )
64         }
65         from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
66         from { sourceSets.generated.resources.srcDirs }
67         with jar
68         dependsOn test
69 }
70
71 task createVersion() {
72     sourceSets {
73         generated {
74             resources {
75                 srcDir "src/generated/resources"
76             }
77         }
78     }
79     processResources.dependsOn(createVersion)
80 }
81
82
83 import org.ajoberstar.grgit.Grgit
84 createVersion {
85     doLast {
86         def gitRepo = Grgit.open(".")
87         version = gitRepo.describe()
88         new File("src/generated/resources").mkdirs()
89         new File("src/generated/resources/version.txt").withWriter() { it.write(version) }
90     }
91 }
92
93 war {
94     classpath sourceSets.generated.output
95     dependsOn(test)
96 }
97
98 jacoco {
99     toolVersion = "0.7.6.201602180812"
100 }
101
102 /* vim: set ts=4 sw=4 et: */