This repository has been archived by the owner on Aug 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.gradle
122 lines (103 loc) · 4.17 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
buildscript {
ext {
jarName = "chaos"
sdkVersion = '30'
sdkRoot = System.getenv("ANDROID_HOME")
doExec = { cmd ->
def proc = cmd.execute(null, new File("$buildDir/libs"))
proc.waitForProcessOutput(System.out, System.err)
}
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0")
}
}
plugins{
id "java"
id "groovy"
id "scala"
id "org.jetbrains.kotlin.jvm" version "1.5.0"
}
sourceCompatibility = 1.8
sourceSets.main{
[java, groovy, scala, kotlin].each{
it.srcDir("src/main/code")
}
}
repositories{
mavenCentral()
maven{url("https://jitpack.io")}
}
dependencies{
compileOnly("com.github.Anuken.Mindustry:desktop:v127.2")
compileOnly("com.github.Anuken.Arc:arc-core:v127.2")
compileOnly("com.github.Anuken.Arc:backend-sdl:v127.2")
compileOnly("com.github.Anuken.Mindustry:core:v127.2")
implementation("org.tensorflow:tensorflow-core-platform-mkl:0.3.1")
implementation("org.tensorflow:tensorflow-java:0.3.2")
implementation("org.tensorflow:tensorflow-core-api:0.3.2")
implementation("org.tensorflow:tensorflow-core-platform-mkl-gpu:0.3.2")
implementation("org.tensorflow:tensorflow-core-platform-gpu:0.3.2")
implementation("org.tensorflow:tensorflow-framework:0.3.2")
implementation("org.tensorflow:tensorflow-core-platform:0.3.2")
implementation("org.tensorflow:tensorflow-core-generator:0.3.2")
implementation("org.tensorflow:tensorflow-core:0.3.2")
implementation("org.webjars.npm:ndarray:1.0.19")
implementation("org.codehaus.groovy:groovy-all:3.0.8")
implementation("org.scala-lang:scala-library:2.11.12")
implementation("org.deeplearning4j:deeplearning4j-core:1.0.0-beta7")
implementation("org.deeplearning4j:deeplearning4j-nlp:1.0.0-beta7")
implementation("org.deeplearning4j:deeplearning4j-zoo:1.0.0-beta7")
implementation("org.deeplearning4j:deeplearning4j-parallel-wrapper:1.0.0-beta7")
implementation("org.nd4j:nd4j-native-platform:1.0.0-beta7")
implementation("org.nd4j:nd4j-native-api:1.0.0-beta7")
implementation("org.bytedeco.javacpp-presets:openblas-platform:0.2.19-1.3")
implementation("org.apache.logging.log4j:log4j-api:2.11.2")
implementation("org.apache.logging.log4j:log4j-core:2.11.2")
implementation("org.apache.logging.log4j:log4j-slf4j-impl:2.11.2")
implementation("edu.cmu.cs:ark-tweet-nlp:0.3.2")
implementation("commons-lang:commons-lang:2.6")
implementation("org.reflections:reflections:0.9.10")
implementation("org.projectlombok:lombok:1.18.6")
implementation("xml-apis:xml-apis:1.0.b2")
}
jar{
zip64 true
archiveFileName.set("${jarName}.jar")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from{
configurations.runtimeClasspath.collect{
it.isDirectory() ? it : zipTree(it)
}
}
}
compileGroovy{
dependsOn("compileScala")
classpath += files(compileScala.destinationDir)
dependsOn("compileKotlin")
classpath += files(compileKotlin.destinationDir)
}
// credits to sonnicon
task dexify(type: Jar, dependsOn: [jar]){
zip64 true
archiveFileName.set("dexed-${jarName}.jar")
def jarArtifact = new File(tasks.jar.archiveFile.get().asFile.parent, "${jarName}.jar")
def dexedArtifact = new File(tasks.dexify.getTemporaryDir(), "dexed.jar")
doFirst{
def files = (
configurations.compileClasspath.asList() +
configurations.runtimeClasspath.asList() +
[new File("$sdkRoot/platforms/android-$sdkVersion/android.jar")]
)
def dependencies = files.collect{ "--classpath $it.path" }.join(" ")
doExec("d8 $dependencies --min-api 14 --output $dexedArtifact $jarArtifact")
// def command = ["d8", "--min-api", "16", "--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"