-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
61 lines (47 loc) · 1.46 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import org.ajoberstar.grgit.Grgit
import java.text.SimpleDateFormat
group 'pizzaslackbot'
version 'alpha'
buildscript {
ext.kotlin_version = '1.2.0'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'org.ajoberstar:grgit:1.1.0'
}
}
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'application'
task versionTxt() {
doLast {
new File("$projectDir/src/main/resources/version.properties").text = """Version = $version
Revision = ${Grgit.open(dir: '.').head().id}
BuildTime = ${new SimpleDateFormat("dd-MM-yyyy HH:mm:ss").format(new Date())}
ApplicationName = $rootProject.name"""
}
}
sourceCompatibility = 1.7
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testCompile group: 'junit', name: 'junit', version: '4.11'
compile "com.ullink.slack:simpleslackapi:1.2.0"
compile "com.fasterxml.jackson.module:jackson-module-kotlin:2.7.5"
compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
}
mainClassName = "com.dragbone.pizzabot.RunnerKt"
processResources.dependsOn(versionTxt)
sourceSets.main.resources { srcDirs = ["src/main/resources"] }
jar {
manifest {
attributes 'Main-Class': "$mainClassName"
}
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}
task deploy(dependsOn: [jar, test]) {
}