mirror of
https://github.com/yawaflua/Informatis.git
synced 2025-12-10 20:19:26 +02:00
69 lines
1.8 KiB
Groovy
69 lines
1.8 KiB
Groovy
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.Arc:arc-core:$pMindustryVersion"
|
|
compileOnly "com.github.Anuken.Mindustry:core:$pMindustryVersion"
|
|
implementation 'org.hjson:hjson:3.0.0'
|
|
}
|
|
|
|
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"
|
|
|
|
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
|
|
} |