forked from Sharlottes/Informatis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
76 lines (62 loc) · 1.91 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
65
66
67
68
69
70
71
72
73
74
75
76
plugins {
id 'java'
}
group pGroup
version '1.0'
sourceSets.main {
java.srcDir("src/")
resources.srcDir("assets/")
}
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
jar {
archiveFileName.set pArtifactFilename
from {
configurations.runtimeClasspath.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}
dependencies {
annotationProcessor 'com.github.Anuken:jabel:34e4c172e65b3928cd9eabe1993654ea79c409cd'
compileOnly "com.github.Anuken.MindustryJitpack:core:3ffa59efb6"
compileOnly "com.github.Anuken.Arc:arc-core:dfcb21ce56"
}
task dexify(type: Jar) {
archiveName "dexed-$pArtifactFilename"
final File jarArtifact = new File(tasks.jar.archiveFile.get().asFile.parent, pArtifactFilename),
dexedArtifact = new File(tasks.dexify.getTemporaryDir(), "dexed.jar")
doFirst {
exec {
workingDir dexedArtifact.parent
def command = ["d8", "--min-api", pMinApi, "--output", dexedArtifact, jarArtifact]
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows'))
commandLine("cmd", "/c", *command)
else
commandLine(*command)
}
}
from(zipTree(jarArtifact), zipTree(dexedArtifact))
}
task buildDex dependsOn "build", "dexify"
task buildMove(dependsOn: build) {
doLast {
copy {
from "build/libs/Informatis.jar"
into System.getenv("destination")
}
}
}
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
}