This repository has been archived by the owner on Jun 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
64 lines (50 loc) · 1.54 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
61
62
63
64
apply plugin: "java"
version '1.0'
sourceSets.main.java.srcDirs = ["src"]
repositories{
mavenCentral()
maven{ url 'https://www.jitpack.io' }
}
ext{
mindustryVersion = 'v133'
doExec = { cmd ->
def proc = cmd.execute(null, new File("$buildDir/libs"))
proc.waitForProcessOutput(System.out, System.err)
}
}
dependencies{
annotationProcessor 'com.github.Anuken:jabel:34e4c172e65b3928cd9eabe1993654ea79c409cd'
compileOnly "com.github.Anuken.Arc:arc-core:$mindustryVersion"
compileOnly "com.github.Anuken.Mindustry:core:$mindustryVersion"
}
jar{
archiveFileName = "${project.archivesBaseName}Desktop.jar"
from{
configurations.runtimeClasspath.collect{ it.isDirectory() ? it : zipTree(it) }
}
from(rootDir){
include "mod.hjson"
}
from("assets/"){
include "**"
}
}
task deploy(type: Jar){
dependsOn jar
archiveFileName = "${project.archivesBaseName}.jar"
from{ [zipTree("$buildDir/libs/${project.archivesBaseName}Desktop.jar")] }
doLast{
delete{ delete "$buildDir/libs/${project.archivesBaseName}Desktop.jar" }
}
}
tasks.withType(JavaCompile){
targetCompatibility = 8
sourceCompatibility = JavaVersion.VERSION_16
options.encoding = "UTF-8"
options.forkOptions.jvmArgs.addAll([
'--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED',
'--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED'
])
options.compilerArgs.addAll(['--release', '8'])
compileJava.options.fork = true
}