-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
86 lines (79 loc) · 2.72 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
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.net.URL
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath(AppPlugins.AGP)
classpath(AppPlugins.KGP)
classpath(AppPlugins.PUBLISH)
}
}
plugins {
id(AppPlugins.DOKKA) version DependenciesVersion.DOKKA_VERSION
id(AppPlugins.GITHUB_RELEASE) version DependenciesVersion.GITHUB_RELEASE_VERSION
id(AppPlugins.EASY_VERSION) version DependenciesVersion.EASY_VERSION
}
subprojects {
configureKotlinCompile()
afterEvaluate {
configureDokka()
}
}
easyVersion {
setToProjectVersion = true
logVersion = true
}
githubRelease {
val version = Callable<CharSequence> { project.version.toString() }
token(System.getenv("GITHUB_TOKEN"))
owner("k0shk0sh")
repo("ComposeEasyForms")
tagName(version)
targetCommitish("main")
releaseName { "Release: ${version.call()}" }
body { "ComposeEasyForms new Release: ${version.call()}" }
}
fun Project.configureDokka() {
if (plugins.hasPlugin(AppPlugins.DOKKA)) {
tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets {
named(DokkaConfig.MAIN) {
failOnWarning.set(true)
reportUndocumented.set(true)
skipEmptyPackages.set(true)
skipDeprecated.set(true)
jdkVersion.set(8)
noAndroidSdkLink.set(false)
samples.from(rootProject.file(DokkaConfig.SAMPLES))
externalDocumentationLink {
url.set(URL(DokkaConfig.ANDROID_REF_URL))
packageListUrl.set(URL(DokkaConfig.ANDROIDX_REF_URL))
}
externalDocumentationLink {
url.set(URL(DokkaConfig.ANDROID_KOTLIN_REF_URL))
packageListUrl.set(URL(DokkaConfig.ANDROIDX_KOTLIN_REF_URL))
}
sourceLink {
localDirectory.set(project.file(DokkaConfig.LOCAL_SRC_DIR))
remoteUrl.set(URL(DokkaConfig.REMOTE_SRC_DIR.format(project.name)))
remoteLineSuffix.set(DokkaConfig.LINE_NUM)
}
}
}
outputDirectory.set(file(DokkaConfig.OUTPUT_DIR))
}
}
}
fun Project.configureKotlinCompile() {
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
allWarningsAsErrors = true
jvmTarget = AppConfig.JVM_TARGET
freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn", "-Xjvm-default=all")
}
}
}