This repository has been archived by the owner on Dec 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
111 lines (96 loc) · 3.52 KB
/
build.gradle.kts
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
108
109
110
111
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.dokka.Platform.jvm
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
val versions = com.isupatches.android.viewglu.build.Versions
classpath("com.android.tools.build:gradle:${versions.AGP}")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.KOTLIN}")
/**
* Ideally this would be migrated out of the project level build.gradle.kts to the [DocumentationPlugin],
* but currently the buildSrc directory cannot see [DokkaTask] or [jvm] and unsure why.
*/
classpath("org.jetbrains.dokka:dokka-gradle-plugin:${versions.DOKKA}")
}
}
allprojects {
repositories {
google()
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots")
}
tasks.withType(Test::class).configureEach {
/*
* Run tests in parallel (https://docs.gradle.org/nightly/userguide/performance.html).
* Must be less than the number of CPU cores.
*/
maxParallelForks = Runtime.getRuntime().availableProcessors().div(2)
testLogging {
// Log events
events = setOf(
TestLogEvent.STARTED,
TestLogEvent.FAILED,
TestLogEvent.SKIPPED,
TestLogEvent.PASSED
)
exceptionFormat = TestExceptionFormat.FULL
showExceptions = true
showCauses = true
showStackTraces = true
}
}
tasks {
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "11"
}
withType<JavaCompile> {
sourceCompatibility = "${JavaVersion.VERSION_11}"
targetCompatibility = "${JavaVersion.VERSION_11}"
}
}
}
subprojects {
// Static Analysis
apply(from = "${rootProject.projectDir}/gradle/cpd.gradle.kts")
apply(from = "${rootProject.projectDir}/gradle/detekt.gradle.kts")
apply(from = "${rootProject.projectDir}/gradle/dexcount.gradle.kts")
apply(from = "${rootProject.projectDir}/gradle/ktlint.gradle.kts")
// Code coverage
apply(from = "${rootProject.projectDir}/gradle/jacoco.gradle.kts")
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "${JavaVersion.VERSION_1_8}"
}
/**
* Ideally this would be migrated out of the project level build.gradle.kts to the [DocumentationPlugin],
* but currently the buildSrc directory cannot see [DokkaTask] or [jvm] and unsure why.
*/
tasks.withType<DokkaTask>().configureEach {
outputDirectory.set(rootProject.projectDir.resolve("documentation"))
moduleName.set(project.name)
suppressObviousFunctions.set(false)
dokkaSourceSets {
configureEach {
offlineMode.set(false)
includeNonPublic.set(true)
skipDeprecated.set(false)
reportUndocumented.set(true)
skipEmptyPackages.set(false)
platform.set(jvm)
jdkVersion.set(11)
noStdlibLink.set(false)
noJdkLink.set(false)
noAndroidSdkLink.set(false)
}
}
}
configurations.all {
// Check for updates every build
resolutionStrategy.cacheChangingModulesFor(0, "seconds")
}
}