Split kotlin modules (#316)
This commit is contained in:
parent
762de3dfba
commit
d2a47ad941
17 changed files with 127 additions and 78 deletions
|
|
@ -1,5 +1,6 @@
|
|||
plugins {
|
||||
`kotlin-dsl`
|
||||
id("org.jlleitschuh.gradle.ktlint")
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
|
@ -12,4 +13,7 @@ dependencies {
|
|||
implementation(libs.gradleTestLogger)
|
||||
implementation(libs.gradleErrorprone)
|
||||
implementation(libs.licenser)
|
||||
implementation(libs.gradleKotlinJvm)
|
||||
implementation(libs.gradleDokka)
|
||||
implementation(libs.gradleKtlint)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,13 +27,13 @@ tasks {
|
|||
options.errorprone {
|
||||
/* These are just annoying */
|
||||
disable(
|
||||
"JdkObsolete",
|
||||
"FutureReturnValueIgnored",
|
||||
"ImmutableEnumChecker",
|
||||
"StringSplitter",
|
||||
"EqualsGetClass",
|
||||
"CatchAndPrintStackTrace",
|
||||
"InlineMeSuggester",
|
||||
"JdkObsolete",
|
||||
"FutureReturnValueIgnored",
|
||||
"ImmutableEnumChecker",
|
||||
"StringSplitter",
|
||||
"EqualsGetClass",
|
||||
"CatchAndPrintStackTrace",
|
||||
"InlineMeSuggester",
|
||||
)
|
||||
}
|
||||
options.compilerArgs.addAll(listOf("-Xlint:-processing", "-Werror"))
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
import org.jetbrains.dokka.gradle.DokkaTask
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id("cloud.base-conventions")
|
||||
kotlin("jvm")
|
||||
id("org.jetbrains.dokka")
|
||||
id("org.jlleitschuh.gradle.ktlint")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain {
|
||||
(this as JavaToolchainSpec).apply {
|
||||
languageVersion.set(JavaLanguageVersion.of(8))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val compileAndTest: Configuration by configurations.creating
|
||||
listOf(configurations.compileOnly, configurations.testImplementation).forEach { config ->
|
||||
config {
|
||||
extendsFrom(compileAndTest)
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileAndTest(kotlin("stdlib-jdk8"))
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<DokkaTask> {
|
||||
dokkaSourceSets.named("main") {
|
||||
includes.from(layout.projectDirectory.file("src/main/descriptions.md"))
|
||||
/*externalDocumentationLink { // todo: fix KDoc linking to JavaDoc
|
||||
url.set(URL("https://javadoc.commandframework.cloud/"))
|
||||
packageListUrl.set(URL("https://javadoc.commandframework.cloud/allpackages-index.html"))
|
||||
}*/
|
||||
}
|
||||
}
|
||||
javadocJar {
|
||||
from(dokkaHtml)
|
||||
}
|
||||
withType<KotlinCompile> {
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
kotlin {
|
||||
explicitApi()
|
||||
}
|
||||
|
|
@ -4,11 +4,11 @@ import org.gradle.api.provider.Provider
|
|||
// set by GitHub Actions
|
||||
val Project.ci: Provider<Boolean>
|
||||
get() = providers.environmentVariable("CI")
|
||||
.forUseAtConfigurationTime()
|
||||
.map { it.toBoolean() }
|
||||
.orElse(false)
|
||||
.forUseAtConfigurationTime()
|
||||
.map { it.toBoolean() }
|
||||
.orElse(false)
|
||||
|
||||
val Project.compileExamples: Boolean
|
||||
get() = providers.gradleProperty("compile-examples")
|
||||
.forUseAtConfigurationTime()
|
||||
.isPresent
|
||||
.forUseAtConfigurationTime()
|
||||
.isPresent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue