forked from rodrigovedovato/jetty-loom
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
53 lines (42 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
plugins {
id 'java'
id 'application'
id 'com.github.johnrengelman.shadow' version '6.0.0'
}
assert hasProperty('javaHome'): "Set the property 'javaHome' in your your gradle.properties pointing to a Java 6 or 7 installation"
assert hasProperty('targetJavaVersion'): "Set the property 'targetJavaVersion' in your your gradle.properties to '1.6' or '1.7'"
java {
sourceCompatibility = JavaVersion.toVersion(targetJavaVersion)
}
def javaExecutablesPath = new File(javaHome, 'bin')
def javaExecutables = [:].withDefault { execName ->
def executable = new File(javaExecutablesPath, execName)
assert executable.exists(): "There is no ${execName} executable in ${javaExecutablesPath}"
executable
}
tasks.withType(AbstractCompile) {
options.with {
fork = true
forkOptions.javaHome = file(javaHome)
}
}
tasks.withType(Javadoc) {
executable = javaExecutables.javadoc
}
tasks.withType(Test) {
executable = javaExecutables.java
}
tasks.withType(JavaExec) {
executable = javaExecutables.java
}
repositories {
jcenter()
}
dependencies {
compile 'org.eclipse.jetty:jetty-server:9.4.31.v20200723'
}
application {
mainClassName = "io.github.rodrigovedovato.letty.JettyServer"
}
compileJava.options.fork = true
compileJava.options.forkOptions.executable = "/home/rodrigo/bin/jdk-16/bin/javac"