Last active
April 20, 2023 18:49
-
-
Save iseki0/40bfb738c9ec892be06577d5bf0eac31 to your computer and use it in GitHub Desktop.
Gradle template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
`kotlin-dsl` | |
idea | |
} | |
repositories { | |
mavenCentral() | |
gradlePluginPortal() | |
} | |
dependencies { | |
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20") | |
implementation("org.jetbrains.kotlin:kotlin-serialization:1.8.20") | |
implementation("com.github.johnrengelman:shadow:8.1.1") | |
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.8.10") | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
kotlin("jvm") | |
kotlin("plugin.serialization") | |
id("org.jetbrains.dokka") | |
idea | |
} | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
implementation(kotlin("stdlib")) | |
implementation(kotlin("reflect")) | |
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4") | |
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:1.6.4") | |
implementation("io.github.microutils:kotlin-logging-jvm:3.0.4") | |
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0") | |
testImplementation(kotlin("test")) | |
} | |
java { | |
sourceCompatibility = JavaVersion.VERSION_17 | |
targetCompatibility = JavaVersion.VERSION_17 | |
javaToolchains { compilerFor { configure() } } | |
} | |
tasks.withType<Test> { | |
javaLauncher.set(javaToolchains.launcherFor { configure() }) | |
useJUnitPlatform() | |
testLogging { | |
events("passed", "skipped", "failed") | |
} | |
} | |
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { | |
kotlinOptions.jvmTarget = "17" | |
kotlinOptions.freeCompilerArgs += "-Xcontext-receivers" | |
kotlinOptions.freeCompilerArgs += "-Xassertions=always-enable" | |
kotlinJavaToolchain.toolchain.use(javaToolchains.launcherFor { configure() }) | |
} | |
fun JavaToolchainSpec.configure() { | |
languageVersion.set(JavaLanguageVersion.of(17)) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment