-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
57 lines (46 loc) · 1.34 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
group 'io.github'
version '1.0-SNAPSHOT'
buildscript {
ext.kotlin_version = '1.1.3-2'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'kotlin'
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
// https://mvnrepository.com/artifact/com.google.code.gson/gson
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.1'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
// Configuration options for Docker builds
// Produces a JAR with a fixed name
jar {
manifest {
attributes(
'Main-Class': 'Main', // needs to be changed to your project's main class name
'Class-Path': configurations.compile.collect { it.getName() }.join(' ')
)
}
archiveName "build.jar"
}
// Copies the project and its dependent JARs into a folder that'll be copied into the runtime container.
task bundleWithDependencies(type: Copy) {
dependsOn build
from configurations.runtime
from jar
into "${project.projectDir}/build/output"
}
// No-op task; serves to make Gradle install dependencies when building the Docker container
task install {}