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