-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.gradle
57 lines (55 loc) · 1.93 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
buildscript {
ext.versions = [
java: JavaVersion.VERSION_1_8,
kotlin: '1.4.0', // https://github.com/JetBrains/kotlin
koin: '2.1.6', // https://github.com/InsertKoinIO/koin
skeleton: '10.1.7',
gradle: [
android: '4.0.1', // <https://developer.android.com/studio/releases/gradle-plugin.html>
jitpack: '2.1'
],
android: [
sdk: [
target: 29,
min: 23 // <https://twitter.com/minSdkVersion>
],
buildTools: '29.0.2' // <https://developer.android.com/studio/releases/build-tools>
]
]
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
classpath "com.android.tools.build:gradle:${versions.gradle.android}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath "com.github.dcendents:android-maven-gradle-plugin:${versions.gradle.jitpack}"
classpath "org.koin:koin-gradle-plugin:${versions.koin}"
}
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
// flatDir { dirs 'libs' }
}
dependencies {
def version
}
}
def versionCode(increment) {
Properties versionProperties = new Properties()
def versionPropertiesFile = file("${rootProject.projectDir}/version.properties")
if (!versionPropertiesFile.exists()) throw new GradleException(versionPropertiesFile.path)
versionProperties.load(new FileInputStream(versionPropertiesFile))
if (increment ?: false) {
versionProperties['versionCode'] = ((versionProperties['versionCode'] ?: "0").toInteger() + 1).toString()
versionProperties.store(versionPropertiesFile.newWriter(), null)
}
return versionProperties['versionCode']
}