forked from RikkaApps/Shizuku
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server-dex.gradle
41 lines (34 loc) · 1.18 KB
/
server-dex.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
import org.gradle.internal.os.OperatingSystem
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
def sdkDir = properties.getProperty('sdk.dir')
def dx
if (OperatingSystem.current().isWindows()) {
dx = sdkDir + "\\build-tools\\" + rootProject.ext.buildToolsVersion + '\\dx.bat'
} else {
dx = sdkDir + "/build-tools/" + rootProject.ext.buildToolsVersion + '/dx'
}
task dex(type: Exec) {
onlyIf {
!jar.state.upToDate
}
dependsOn jar
file(rootProject.rootDir.path + "/manager/src/main/assets/").mkdirs()
file(project.buildDir.path + "/libs/").mkdirs()
commandLine dx,
'--dex',
'--output=' + file(rootProject.rootDir.path + "/manager/src/main/assets/" + project.name + ".dex").path,
file(project.buildDir.path + "/libs/" + project.name + ".jar").path
}
jar {
manifest {
attributes 'Main-Class': 'moe.shizuku.server.ShizukuServer'
}
from {
configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
}