forked from airbnb/epoxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
64 lines (54 loc) · 1.67 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.KOTLIN_VERSION = "1.4.32"
ext.ANDROID_PLUGIN_VERSION = '7.0.0-beta03'
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:$ANDROID_PLUGIN_VERSION"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
// Upload with:
// ./gradlew clean uploadArchives --no-daemon --no-parallel
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.14.2'
// Dokka is needed on classpath for vanniktech publish plugin
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.4.30"
}
}
plugins {
id 'com.github.ben-manes.versions' version '0.38.0'
}
allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
// Prevent javadoc task complaining about errors with kotlin files
tasks.withType(Javadoc) {
excludes = ['**/*.kt']
}
}
subprojects { project ->
apply from: "$rootDir/blessedDeps.gradle"
apply plugin: 'com.github.ben-manes.versions'
apply from: "${project.rootDir}/ktlint.gradle"
afterEvaluate {
if (project.tasks.findByName('check')) {
check.dependsOn('ktlint')
}
}
}
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 {
// disallow release candidates as upgradable versions from stable versions
rejectVersionIf {
isNonStable(it.candidate.version) && !isNonStable(it.currentVersion)
}
}