-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
60 lines (49 loc) · 1.33 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
import org.gradle.internal.jvm.Jvm
buildscript {
ext.kotlin_version = '1.2.41'
repositories {
mavenCentral()
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'gradle.plugin.de.fuerstenau:BuildConfigPlugin:1.1.8'
}
}
def getGitHash = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags'
standardOutput = stdout
}
return stdout.toString().trim()
}
apply plugin: "kotlin"
apply plugin: "application"
apply plugin: 'de.fuerstenau.buildconfig'
apply plugin: 'idea'
mainClassName = "io.jadon.sbhs.SBHS"
buildConfig {
appName = project.name
version = getGitHash()
clsName = "BuildInfo"
packageName = "io.jadon.sbhs"
charset = 'UTF-8'
// fields of the config class
buildConfigField "String", "JVM_INFO", Jvm.current().toString()
buildConfigField "String", "GRADLE_INFO", GradleVersion.current().toString()
}
jar {
manifest {
attributes 'Main-Class': 'io.jadon.sbhs.SBHS'
}
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}