/
build.gradle
88 lines (78 loc) · 2.88 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
apply plugin: "com.github.ben-manes.versions"
apply plugin: 'io.github.gradle-nexus.publish-plugin'
apply plugin: 'binary-compatibility-validator'
apply from: "${rootDir}/gradle/publish-root.gradle"
buildscript {
ext.versions = [
'libVersionCode' : 40001,
'libVersionName' : '4.0.1',
'compileSdk' : 31,
'minSdk' : 14,
'targetSdk' : 31,
'okhttp' : '3.12.13', // LTS version, update until December 31, 2021.
'gson' : '2.8.9',
'coroutines' : '1.5.2',
'kotlin' : '1.5.31',
'buildTools' : '30.0.1',
'appCompat' : '1.3.1',
'constraintLayout' : '2.1.1',
'material' : '1.4.0',
'swipe' : '1.1.0',
'androidx' : '1.0.0',
'lifecycle' : '2.4.0',
'picasso' : '2.71828',
'activityAndroidx' : '1.4.0',
'recyclerView' : '1.2.1',
'lifecycleExtensions': '2.2.0',
'junit' : '4.13.2',
'extJunit' : '1.1.0',
'espresso' : '3.1.1',
'mockito' : '2.23.0',
]
repositories {
google()
mavenCentral()
maven { url "https://dl.bintray.com/kotlin/dokka" }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:${versions.kotlin}"
classpath "com.github.ben-manes:gradle-versions-plugin:0.39.0"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.5.31"
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'
classpath "org.jetbrains.kotlinx:binary-compatibility-validator:0.8.0"
}
}
def getKey() {
Properties properties = new Properties()
File propertiesFile = project.file('local.properties')
if (propertiesFile.exists()) {
properties.load(propertiesFile.newDataInputStream())
return properties.getProperty("ytKey")
} else {
return ''
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url = "https://dl.bintray.com/kotlin/dokka" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
tasks.named("dependencyUpdates").configure {
// Example 1: reject all non stable versions
rejectVersionIf {
isNonStable(it.candidate.version)
}
}