-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
74 lines (69 loc) · 2.17 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
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:${Versions.gradle}")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:${Versions.dokka}")
}
}
plugins {
id("org.jlleitschuh.gradle.ktlint-idea") version Versions.ktlint
id("io.gitlab.arturbosch.detekt") version Versions.detekt
}
tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
tasks.register("detektAll", io.gitlab.arturbosch.detekt.Detekt::class) {
description = "Runs detekt analysis over all modules"
parallel = true
failFast = false
config.from(rootProject.file("detekt.yml"))
setSource(files(projectDir))
buildUponDefaultConfig = true
include("**/*.kt")
include("**/*.kts")
exclude("**/resources/**")
exclude("**/build/**")
reports {
xml.required.set(true)
html.required.set(true)
txt.required.set(true)
}
}
subprojects {
apply(plugin = "maven-publish")
project.afterEvaluate {
if (plugins.hasPlugin("android").not() && name.equals("plugins").not()) {
configure<PublishingExtension> {
publications.create<MavenPublication>(project.name) {
project.afterEvaluate {
groupId = "ai.forethought.android"
artifactId = project.name
if (plugins.hasPlugin("java")) {
from(components["java"])
} else if (plugins.hasPlugin("android-library")) {
from(components["release"])
}
version = "1.0.1"
}
}
}
}
}
// Setup Ktlint
apply(plugin = "org.jlleitschuh.gradle.ktlint")
ktlint {
android.set(true)
outputToConsole.set(true)
ignoreFailures.set(false)
coloredOutput.set(true)
verbose.set(true)
filter {
exclude("**/generated/**")
exclude("**/build/**")
}
}
}