forked from UweTrottmann/SeriesGuide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
104 lines (92 loc) · 4.25 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.5.0' // https://kotlinlang.org/docs/releases.html#release-details
ext.coroutines_version = '1.5.0' // https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md
ext.versions = [
'minSdk': 21, // Android 5 (L)
'compileSdk': 30, // Android 11 (R)
'targetSdk': 30, // Android 11 (R)
// https://developer.android.com/jetpack/androidx/releases
'core': '1.5.0', // https://developer.android.com/jetpack/androidx/releases/core
'annotation': '1.2.0',
'lifecycle': '2.3.1',
'paging': '2.1.2',
'room': '2.3.0', // https://developer.android.com/jetpack/androidx/releases/room
'butterknife': '10.2.3', // https://github.com/JakeWharton/butterknife/blob/master/CHANGELOG.md
'crashlytics': '17.4.0', // https://firebase.google.com/support/release-notes/android
'dagger': '2.35.1', // https://github.com/google/dagger/releases
'gson': '2.8.6', // https://github.com/google/gson/blob/master/CHANGELOG.md
'okhttp': '4.9.1', // https://github.com/square/okhttp/blob/master/CHANGELOG.md
'retrofit': '2.9.0', // https://github.com/square/retrofit/blob/master/CHANGELOG.md
'timber': '4.7.1', // https://github.com/JakeWharton/timber/blob/master/CHANGELOG.md
'androidUtils': '2.4.1', // https://github.com/UweTrottmann/AndroidUtils/blob/master/RELEASE_NOTES.md
'tmdb': '2.3.1', // https://github.com/UweTrottmann/tmdb-java/blob/master/CHANGELOG.md
'trakt': '6.9.0', // https://github.com/UweTrottmann/trakt-java/blob/master/CHANGELOG.md
'truth': '1.1.2', // https://github.com/google/truth/releases
// version 21xxxyy -> min SDK 21, release xxx, build yy
'code': 2105901,
'name': '59-beta2',
]
// load some properties that should not be part of version control
if (file('secret.properties').exists()) {
def properties = new Properties()
properties.load(new FileInputStream(file("secret.properties")))
properties.each { property ->
project.ext.set(property.key, property.value)
}
}
ext.isCiBuild = System.getenv('CI') == 'true'
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0' // libraries, SeriesGuide
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// https://github.com/ben-manes/gradle-versions-plugin/releases
classpath 'com.github.ben-manes:gradle-versions-plugin:0.38.0'
classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:2.1.0' // SeriesGuide
// https://github.com/Codearte/gradle-nexus-staging-plugin/releases
classpath 'io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.22.0' // api
// Firebase Crashlytics
// https://firebase.google.com/support/release-notes/android
classpath 'com.google.gms:google-services:4.3.5'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.1'
}
}
apply plugin: 'com.github.ben-manes.versions'
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 {
rejectVersionIf {
isNonStable(it.candidate.version)
}
}
apply plugin: 'io.codearte.nexus-staging'
nexusStaging {
packageGroup = "com.uwetrottmann"
if (rootProject.hasProperty('SONATYPE_NEXUS_USERNAME')
&& rootProject.hasProperty('SONATYPE_NEXUS_PASSWORD')) {
username = SONATYPE_NEXUS_USERNAME
password = SONATYPE_NEXUS_PASSWORD
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
group "build"
delete rootProject.buildDir
}
wrapper {
//noinspection UnnecessaryQualifiedReference
distributionType = Wrapper.DistributionType.ALL
}