-
Notifications
You must be signed in to change notification settings - Fork 123
/
libbase.gradle
60 lines (53 loc) · 1.74 KB
/
libbase.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
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
defaultConfig {
multiDexEnabled true
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
ndk {
abiFilters 'armeabi', 'x86'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:multidex:1.0.3'
}
repositories {
mavenCentral()
}
//监听gradle配置阶段执行完成,可以获取到project下的所有task
//执行module的 clean :解决Failed to delete \build\.......\classes.jar
this.project.afterEvaluate { project ->
def buildTask1 = project.tasks.getByName('assembleDebug')
def buildTask2 = project.tasks.getByName('assembleRelease')
def taskClean = project.tasks.findByPath("clean")
if (buildTask1 != null) {
buildTask1.doFirst {
taskClean.onlyIf {
true
}
}
}
if (buildTask2 != null) {
buildTask2.doFirst {
taskClean.onlyIf {
true
}
}
}
}