-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathbuild.gradle
88 lines (70 loc) · 2.26 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
buildscript {
println("${project.name}: buildscript")
// rootProject.buildscript 里用的变量, 由于调用时机比 "闭包project.ext{ ... }" 早, 故不能写在那边
// project.ext.kotlin_version = "1.1.3-2"
// project.ext.android_plugin_version = "2.2.0"
// 导入 external 全局变量
apply from: "ext.gradle"
repositories {
jcenter()
maven { url 'https://maven.google.com/' }
}
dependencies {
classpath _android.plugin
classpath _kotlin.kotlin_gradle_plugin
classpath _kotlin.kotlin_android_extensions
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com/' }
}
}
subprojects {
def isAppModule = it.name.equals('app')
def enableDataBinding = isAppModule || it.name.equals('databinding')
apply plugin: isAppModule? 'com.android.application': 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' // 拓展
// kapt
apply plugin: 'kotlin-kapt'
kapt {
generateStubs = true
}
android {
compileSdkVersion _android.compileSdkVersion as Integer
buildToolsVersion _android.buildToolsVersion as String
defaultConfig {
if(isAppModule)
applicationId "com.fashare.mvvm_juejin"
minSdkVersion _android.minSdkVersion as Integer
targetSdkVersion _android.targetSdkVersion as Integer
versionCode _android.versionCode as Integer
versionName _android.versionName as String
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
if(enableDataBinding){
dataBinding {
enabled true
}
}
}
dependencies {
// kotlin
compile _kotlin.kotlin_stdlib
kapt databindingCompiler
// rxjava
compile rx.rxjava2
compile rx.rxandroid2
}
}
//apply from: "https://raw.githubusercontent.com/fashare2015/gradle-screen-record/master/screen-record.gradle"