-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathbuild.gradle
More file actions
76 lines (64 loc) · 2.23 KB
/
Copy pathbuild.gradle
File metadata and controls
76 lines (64 loc) · 2.23 KB
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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
}
dependencies {
classpath "com.android.tools.build:gradle:3.6.3"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
google()
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
//自动化构建,生成加固所需要的资源
task jiagu(){
delete project('jiagu_shell').buildDir
//打包编译壳aar
dependsOn project('jiagu_shell').tasks.findByPath(':jiagu_shell:bundleReleaseAar')
delete project('jiaguLib').buildDir
//编译jiaguLib工程,生成jar文件
dependsOn project('jiaguLib').tasks.findByPath(':jiaguLib:build')
doLast {
println("jiagu ============= 已编译Aar")
//在根工程中创建jiagu文件夹
def root = new File(rootDir,'/jiagu')
if (root.exists()){
delete root
}
root = rootProject.mkdir('jiagu')
println("jiagu ============= 已重新创建了 - jiagu目录")
//将aar文件复制到jiagu目录中
copy {
from 'jiagu_shell/build/outputs/aar'
into{root.absolutePath+"/aar"}
//include('**/*.aar')
}
//复制依赖的库文件信息
copy {
from 'jiaguLib/libs'
into{root.absolutePath+"/libs"}
//include('**/*.aar')
}
//复制加固jar和签名配置文件
copy {
from 'jiaguLib/build/libs','jiaguLib/keystore.cfg'
into{root.absolutePath}
//include('**/*.aar')
}
}
}