-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
127 lines (110 loc) · 3.51 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import com.android.build.gradle.LibraryExtension
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.dsl.kotlinExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.shipkit.changelog.GenerateChangelogTask
import org.shipkit.github.release.GithubReleaseTask
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath(Dependencies.androidGradlePlugin)
classpath(Dependencies.kotlinGradlePlugin)
classpath(Dependencies.publishGradlePlugin)
}
}
plugins {
id("io.gitlab.arturbosch.detekt") version "1.23.4"
id("com.github.ben-manes.versions") version "0.42.0"
id("org.shipkit.shipkit-changelog") version "1.2.0"
id("org.shipkit.shipkit-github-release") version "1.2.0"
id("org.shipkit.shipkit-auto-version") version "1.2.2"
}
repositories {
mavenCentral()
maven("https://dl.bintray.com/kotlin/kotlinx/")
}
dependencies {
detekt(Dependencies.detektFormatting)
detekt(Dependencies.detektCli)
}
detekt {
source = files(projectDir)
config = rootProject.files("detekt-config.yml")
}
tasks {
withType(GenerateChangelogTask::class) {
previousRevision = project.ext["shipkit-auto-version.previous-tag"] as String
githubToken = System.getenv("GH_READ_TOKEN")
repository = "DroidsOnRoids/FoQA"
}
withType(GithubReleaseTask::class) {
repository = "DroidsOnRoids/FoQA"
changelog = File(buildDir, "changelog.md")
githubToken = System.getenv("GH_WRITE_TOKEN")
newTagRevision = System.getenv("BITRISE_GIT_COMMIT")
}
withType(Detekt::class) {
exclude("build/")
exclude("buildSrc/build/")
parallel = true
reports {
xml.enabled = true
html.enabled = false
txt.enabled = false
}
}
withType(KotlinCompile::class).all {
kotlinExtension.jvmToolchain(jdkVersion = Dependencies.JAVA_VERSION_CODE)
kotlinOptions {
freeCompilerArgs = listOf("-Xexplicit-api=strict")
jvmTarget = Dependencies.JAVA_VERSION_NAME
}
}
}
subprojects {
repositories {
google()
mavenCentral()
}
group = "pl.droidsonroids.foqa"
if (name == "sample") {
return@subprojects
}
apply(plugin = "com.android.library")
apply(plugin = "kotlin-android")
apply(plugin = "kotlin-kapt")
apply(plugin = "com.vanniktech.maven.publish")
with(extensions.getByName("android") as LibraryExtension) {
compileSdk = Dependencies.compileSdk
defaultConfig {
minSdk = Dependencies.minSdk
targetSdk = Dependencies.targetSdk
}
resourcePrefix = "foqa_"
variantFilter {
ignore = name == "debug"
}
compileOptions {
sourceCompatibility = Dependencies.JAVA_VERSION
targetCompatibility = Dependencies.JAVA_VERSION
}
}
extensions.findByType(MavenPublishBaseExtension::class)?.apply {
publishToMavenCentral(
host = SonatypeHost.DEFAULT,
automaticRelease = true // instead of closeAndReleaseRepository
)
signAllPublications()
}
dependencies {
"implementation"(kotlin("stdlib-jdk7"))
"implementation"(Dependencies.hyperionPlugin)
"kapt"(Dependencies.autoService)
}
}