-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
53 lines (44 loc) · 1.05 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
group 'cn.lovexiaov.uitest'
version '0.1'
apply plugin: 'java'
sourceCompatibility = 1.8
def ANDROID_HOME = 'D:\\develop\\Android\\sdk'
def BUILD_TOOL_VERSION = '25.0.2'
repositories {
mavenCentral()
}
configurations {
provided
compile.extendsFrom provided
}
dependencies {
provided fileTree(include: ['*.jar'], dir: 'libs')
}
project.ext {
// output jar file dir
outDir = new File('build/bin')
}
jar {
dependsOn configurations.runtime
from {
(configurations.compile - configurations.provided).collect {
it.isDirectory() ? it : zipTree(it)
}
} {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
doLast {
println 'dex exec...'
project.outDir.mkdir()
tasks.dex.execute()
}
}
task dex(dependsOn: jar, type: Exec) {
println 'Building dex...'
workingDir '.'
commandLine ANDROID_HOME + '\\build-tools\\' + BUILD_TOOL_VERSION + '\\' + 'dx.bat', '--dex',
'--no-strict', '--multi-dex', '--output=' + project.outDir + '\\' + project.name + '.jar',
jar.archivePath
}