-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.gradle.kts
60 lines (49 loc) · 1.83 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
import com.diffplug.spotless.LineEnding
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
// release
id("io.github.gradle-nexus.publish-plugin")
// plugins
id("com.diffplug.spotless") version PosthogBuildConfig.Plugins.SPOTLESS apply true
id("io.gitlab.arturbosch.detekt") version PosthogBuildConfig.Plugins.DETEKT apply true
id("org.jetbrains.kotlinx.binary-compatibility-validator") version PosthogBuildConfig.Plugins.API_VALIDATOR apply true
id("com.github.gmazzo.buildconfig") version PosthogBuildConfig.Plugins.BUILD_CONFIG apply false
id("ru.vyarus.animalsniffer") version PosthogBuildConfig.Plugins.ANIMAL_SNIFFER apply false
// TODO: add jacoco/codecov, gradle-versions-plugin
}
allprojects {
version = properties[PostHogPublishConfig.versionNameProperty].toString()
}
subprojects {
apply(plugin = "org.jetbrains.dokka")
}
spotless {
lineEndings = LineEnding.UNIX
kotlin {
target("**/*.kt")
targetExclude("**/bin/**")
ktlint()
}
kotlinGradle {
target("**/*.kts")
ktlint()
}
}
detekt {
buildUponDefaultConfig = true // preconfigure defaults
allRules = false // activate all available (even unstable) rules.
}
tasks.withType<Detekt>().configureEach {
jvmTarget = PosthogBuildConfig.Build.JAVA_VERSION.toString()
languageVersion = PosthogBuildConfig.Kotlin.KOTLIN_COMPATIBILITY
}
tasks.withType<DetektCreateBaselineTask>().configureEach {
jvmTarget = PosthogBuildConfig.Build.JAVA_VERSION.toString()
languageVersion = PosthogBuildConfig.Kotlin.KOTLIN_COMPATIBILITY
}
apiValidation {
ignoredProjects.add("posthog-android-sample")
}
nexusPublishing.postHogConfig()