forked from jeppeman/android-jetpack-playground
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
145 lines (130 loc) · 4.94 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
buildscript {
apply from: 'deps.gradle'
repositories {
jcenter()
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:$versions.androidplugin"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
classpath "com.github.ben-manes:gradle-versions-plugin:$versions.versionsplugin"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$versions.navigation"
classpath "com.jeppeman.globallydynamic.gradle:plugin:$versions.globallydynamic_gradle"
classpath "com.google.firebase:firebase-crashlytics-gradle:$versions.crashlytics_gradle"
classpath "com.google.gms:google-services:$versions.google_services"
classpath "com.google.firebase:firebase-appdistribution-gradle:$versions.firebase_app_distribution"
}
}
ext {
minSdkVersion = 24
targetSdkVersion = 30
compileSdkVersion = 30
androidVersionCode = 33
androidVersionName = "1.4"
sourceCompatibilityVersion = JavaVersion.VERSION_1_8
targetCompatibilityVersion = JavaVersion.VERSION_1_8
applicationIdBase = "com.jeppeman.jetpackplayground"
testApplicationId = "${applicationIdBase}.test"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
jvmTargetVersion = "1.8"
}
subprojects {
afterEvaluate { project ->
repositories {
jcenter()
google()
mavenCentral()
maven { url 'http://developer.huawei.com/repo' }
}
if (project.hasProperty('android')) {
android {
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode rootProject.ext.androidVersionCode
versionName rootProject.ext.androidVersionName
testApplicationId rootProject.ext.testApplicationId
}
compileOptions {
sourceCompatibility rootProject.ext.sourceCompatibilityVersion
targetCompatibility rootProject.ext.targetCompatibilityVersion
}
lintOptions {
abortOnError true
}
kotlinOptions {
jvmTarget = rootProject.ext.jvmTargetVersion
}
flavorDimensions 'packaging'
productFlavors {
amazon {
dimension 'packaging'
}
galaxy {
dimension 'packaging'
}
gplay {
dimension 'packaging'
}
huawei {
dimension 'packaging'
}
firebase {
dimension 'packaging'
if (project.plugins.hasPlugin("com.google.firebase.appdistribution")) {
firebaseAppDistribution {
apkPath "${buildDir}/outputs/universal_apk/firebaseRelease/universal.apk"
groups = "All"
}
}
}
}
}
dependencies {
deps[project.name].each { configuration, dependencies ->
dependencies.each { dependency ->
"${configuration}"(dependency)
}
}
}
} else if (project.hasProperty('java')) {
sourceCompatibility = rootProject.ext.sourceCompatibilityVersion
targetCompatibility = rootProject.ext.targetCompatibilityVersion
compileKotlin {
kotlinOptions {
jvmTarget = rootProject.ext.jvmTargetVersion
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = rootProject.ext.jvmTargetVersion
}
}
dependencies {
deps[project.name].each { configuration, dependencies ->
dependencies.each { dependency ->
"${configuration}"(dependency)
}
}
}
}
}
}
apply plugin: "com.github.ben-manes.versions"
dependencyUpdates.resolutionStrategy = {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}