-
Notifications
You must be signed in to change notification settings - Fork 84
/
build.gradle
100 lines (90 loc) · 2.55 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
buildscript {
apply from: rootProject.file('dependencies.gradle')
repositories {
google()
gradlePluginPortal()
mavenCentral()
jcenter()
maven {
url "https://dl.bintray.com/kotlin/kotlin-eap"
}
maven {
url "http://dl.bintray.com/kotlin/kotlin-dev"
}
}
dependencies {
classpath deps.android_gradle_plugin
classpath deps.kotlin.gradle_plugin
classpath deps.ktlint_plugin
classpath deps.anvil_plugin
classpath deps.maven_publishing_plugin
}
}
println "Versions: " + [
"Kotlin": ext.kotlinVersion,
"Gradle": gradle.gradleVersion
]
allprojects {
repositories {
google()
mavenCentral()
jcenter()
maven {
url "https://dl.bintray.com/kotlin/kotlin-eap"
}
maven {
url "http://dl.bintray.com/kotlin/kotlin-dev"
}
}
}
subprojects {
apply plugin: 'org.jlleitschuh.gradle.ktlint'
tasks.withType(Test).configureEach {
testLogging {
events 'passed', 'failed', 'skipped', 'standardOut', 'standardError'
exceptionFormat 'FULL'
showCauses true
showExceptions true
showStackTraces true
showStandardStreams true
}
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
//noinspection UnnecessaryQualifiedReference
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8
}
// TODO: fix obscure dependency substitution error
// This is the ideal solution, but doesn't quite work for some reason. The workaround below is
// needed to make it work for now.
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute module("com.squareup.anvil:annotations") with project(':annotations')
substitute module("com.squareup.anvil:compiler") with project(':compiler')
}
}
// This is an ugly workaround.
def brokenProjects = [
project(':integration-tests:library'),
project(':integration-tests:tests'),
project(':sample:library'),
project(':sample:app')
]
brokenProjects.each { brokenProject ->
brokenProject.configurations.whenObjectAdded {
if (it.name == 'api') {
brokenProject.dependencies.add('api', project(':annotations'))
}
if (it.name == 'kotlinCompilerPluginClasspath') {
brokenProject.dependencies.add('kotlinCompilerPluginClasspath', project(':compiler'))
}
}
}
// End ugly workaround.
}
task clean(type: Delete) {
delete rootProject.buildDir
}