-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
57 lines (49 loc) · 1.49 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
import java.text.SimpleDateFormat
import java.util.*
plugins {
java
id("com.github.johnrengelman.shadow") version "6.1.0"
}
group = "com.graphql-java"
if (JavaVersion.current() != JavaVersion.VERSION_11) {
val msg = String.format("This build must be run with java 11 - you are running %s - gradle finds the JDK via JAVA_HOME=%s",
JavaVersion.current(), System.getenv("JAVA_HOME"))
throw GradleException(msg)
}
fun version(): String {
val RELEASE_VERSION = "RELEASE_VERSION"
if (System.getenv().containsKey(RELEASE_VERSION)) {
val releaseVersion = System.getenv(RELEASE_VERSION)
println("using release version $releaseVersion")
return releaseVersion
}
val version = SimpleDateFormat("yyyy-MM-dd\'T\'HH-mm-ss-mmm").format(Date())
println("created development version: $version")
return version
}
version = version()
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
tasks.jar {
manifest {
attributes(
"Main-Class" to "Main"
)
}
}
repositories {
mavenCentral()
}
tasks.withType<JavaCompile> {
val compilerArgs = options.compilerArgs
compilerArgs.add("-Aproject=${project.group}/${project.name}")
}
dependencies {
implementation("info.picocli:picocli:4.6.1")
implementation("com.graphql-java:graphql-java:0.0.0-2021-08-01T03-54-24-35768a0e")
annotationProcessor("info.picocli:picocli-codegen:4.6.1")
testCompile("junit", "junit", "4.12")
}