-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
84 lines (72 loc) · 1.84 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
buildscript {
repositories {
mavenCentral()
google()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:5.2.0'
}
}
allprojects {
repositories {
mavenCentral()
google()
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
apply plugin: 'java-library'
apply plugin: 'com.github.johnrengelman.shadow'
def appVersion = '2.1.2'
def appName = 'apk2gradle'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'org.yaml:snakeyaml:1.21'
// baksmali
implementation('org.smali:baksmali:2.5.2')
// smali
implementation('org.smali:smali:2.5.2')
testImplementation 'junit:junit:4.13.2'
}
jar {
manifest {
attributes 'Implementation-Title': appName,
'Implementation-Version': appVersion,
'Main-Class': 'com.mosect.a2g.Apk2Gradle'
}
}
shadowJar {
archiveBaseName = appName
archiveClassifier = 'beta'
archiveVersion = appVersion
}
task outputProject {
dependsOn('shadowJar')
setGroup('build')
File targetDir = new File(buildDir, "apk2gradle-${appVersion}")
outputs.dir(targetDir)
doLast {
def t = tasks.findByName('shadowJar')
t.outputs.files.each {
File jar = it
targetDir.deleteDir()
targetDir.mkdirs()
copy {
from(file('data'))
into(targetDir)
}
copy {
from(jar)
into(targetDir)
}
new File(targetDir, jar.name).renameTo(new File(targetDir, 'apk2gradle.jar'))
}
}
}
sourceCompatibility = "1.8"
targetCompatibility = "1.8"