-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
44 lines (36 loc) · 957 Bytes
/
build.gradle.kts
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
plugins {
java
}
tasks.withType(Wrapper::class.java) {
val gradleWrapperVersion: String by project
gradleVersion = gradleWrapperVersion
distributionType = Wrapper.DistributionType.BIN
}
java {
val javaVersion = JavaVersion.VERSION_1_8
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
repositories {
mavenCentral()
}
val lib by configurations.creating {
extendsFrom(configurations["runtime"]) // not necessary
}
dependencies {
val h2Version: String by project
lib("com.h2database:h2:$h2Version")
}
tasks {
create("copy", Copy::class.java) {
from(configurations["lib"])
into("${project.buildDir}/lib")
}
create("h2", JavaExec::class.java) {
dependsOn("copy")
classpath = project.fileTree("${project.buildDir}/lib")
main = "org.h2.tools.Server"
setArgsString("-tcp -tcpAllowOthers -ifNotExists -web -webAllowOthers -baseDir ${project.buildDir}")
}
}
defaultTasks("copy", "h2")