-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
120 lines (108 loc) · 4.58 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
buildscript {
ext.kotlin_version = '1.4.10'
repositories {
maven { url rootProject.file("repo-local") }
maven { url 'http://localhost:8081/nexus/content/groups/android_public/' }
maven { url 'http://download.flutter.io'}
mavenCentral()
jcenter()
google()
maven { url "https://jitpack.io" }
maven { url "${artifactory_contextUrl}/${artifactory_release_repoKey}" }
maven { url "${artifactory_contextUrl}/${artifactory_snapshot_repoKey}" }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath 'com.billy.android:cc-register:1.1.2'
classpath 'com.meituan.android.walle:plugin:1.1.7'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
}
}
configurations.all {
//SNAPSHOT 依赖缓存刷新频率 0
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
allprojects {
repositories {
maven { url rootProject.file("repo-local") }
maven { url 'http://localhost:8081/nexus/content/groups/android_public/' }
maven { url 'http://download.flutter.io'}
mavenCentral()
jcenter()
google()
maven { url "https://jitpack.io" }
maven { url "${artifactory_contextUrl}/${artifactory_release_repoKey}" }
maven { url "${artifactory_contextUrl}/${artifactory_snapshot_repoKey}" }
}
}
subprojects { p ->
tasks.whenObjectAdded {
if (it.name == 'clean' && (p.pluginManager.hasPlugin('java') || p.pluginManager.hasPlugin('groovy'))
|| it.name == 'preBuild' && p.pluginManager.hasPlugin('com.android.library')) {
println "============================ $p.name:$it.name"
p.apply from: p.rootProject.file('artifactory.gradle')
}
}
}
ext {
compileVersion = 29
minVersion = 19
supportVersion = '29.0.3'
deps = [
cc : 'com.billy.android:cc:2.1.6',
appcompat : "androidx.appcompat:appcompat:1.2.0-alpha01",
supportV4 : "androidx.legacy:legacy-support-v4:1.0.0",
recyclerview : "androidx.recyclerview:recyclerview:1.2.0-alpha02",
cardview : "androidx.cardview:cardview:1.0.0",
constraintlayout : "androidx.constraintlayout:constraintlayout:2.0.0-beta4",
corektx : "androidx.core:core-ktx:1.2.0",
percent : "androidx.percentlayout:percentlayout:1.0.0",
annotation : "androidx.annotation:annotation:1.1.0",
design : "com.google.android.material:material-rc01:1.1.0",
rxjava : "io.reactivex.rxjava3:rxjava:3.0.2",
rxandroid : "io.reactivex.rxjava3:rxandroid:3.0.0",
kotlin_stdlib_jdk7 : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72",
networking : "com.amitshekhar.android:android-networking:1.0.2"
]
propLocal = new Properties()
fileLocal = new File('local.properties')
if (fileLocal.exists()) {
propLocal.load(fileLocal.newDataInputStream())
}
propModule = new Properties()
fileModule = new File('artifactory_version.properties')
propModule.load(fileModule.newDataInputStream())
//maven依赖,artifactory_version存放名称,gradle存放版本号
propModule.each {
if (it.key != null && !it.key.startsWith("maven_")) {
if (rootProject.hasProperty(it.key)) {//gradle.properties是否有该属性
ver = rootProject.(it.key)
if (ver != null && !ver.isEmpty()) {//版本号为空不加入
maven = new StringBuilder(maven_groupId).append(":")
.append(it.key).append(":")
.append(ver)
deps.put(it.key, maven)
}
}
}
}
deps.each {
logger.quiet("----mavenList---" + it.key + "=" + it.value)
}
//缓存本地module打包列表,默认只支持maven组为:cn.com.bailian.bailianmobile
localModule = new ArrayList<String>()
propModule.each {
projectAdd = propLocal.getProperty(it.key)
projectDependent = propLocal.getProperty(it.key + ".local")
if ("true".equalsIgnoreCase(projectAdd) && "true".equalsIgnoreCase(projectDependent)) {
localModule.add(it.key)
}
}
localModule.each {
logger.quiet("----localModule----"+it)
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}