-
Notifications
You must be signed in to change notification settings - Fork 273
/
build.gradle
107 lines (93 loc) · 2.76 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
buildscript {
repositories {
mavenLocal()
jcenter()
maven { url 'https://maven.google.com' }
maven { url 'https://maven.fabric.io/public' }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0-alpha13'
classpath 'io.fabric.tools:gradle:1.28.1'
classpath 'com.squareup.sqldelight:gradle-plugin:1.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.31"
}
}
plugins {
id 'com.github.ben-manes.versions' version '0.21.0'
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven { url "https://maven.google.com" }
maven { url 'https://maven.fabric.io/public' }
}
}
apply from: 'dependencies.gradle'
subprojects {
apply plugin: 'checkstyle'
dependencies {
checkstyle libs.checkstyle
}
afterEvaluate {project ->
if (project.name.contains('farebot')) {
check.dependsOn 'checkstyle'
task checkstyle(type: Checkstyle) {
configFile file('config/checkstyle/checkstyle.xml')
source 'src'
include '**/*.java'
exclude '**/gen/**'
exclude '**/IOUtils.java'
exclude '**/Charsets.java'
classpath = files()
}
checkstyle {
ignoreFailures = false
}
}
if (project.hasProperty("android")) {
android {
compileSdkVersion vers.compileSdkVersion
defaultConfig {
minSdkVersion vers.minSdkVersion
targetSdkVersion vers.targetSdkVersion
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
lintOptions {
abortOnError true
disable 'InvalidPackage','MissingTranslation'
}
dexOptions {
dexInProcess = true
}
}
}
}
}
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')
}
}
}
}
configurations {
ktlint
}
dependencies {
ktlint 'com.github.shyiko:ktlint:0.31.0'
}
task lintKotlin(type: JavaExec) {
main = "com.github.shyiko.ktlint.Main"
classpath = configurations.ktlint
args "*/src/**/*.kt"
}