Skip to content

Commit

Permalink
Simple Kotlin DSL Property Assignment (#1962)
Browse files Browse the repository at this point in the history
* Simple Kotlin DSL Property Assignment

https://blog.gradle.org/simpler-kotlin-dsl-property-assignment

* Updated changelog.md

* Updated changelog.md

* Update docs/changelog.md

---------

Co-authored-by: Jake Wharton <[email protected]>
  • Loading branch information
niyajali and JakeWharton authored Aug 16, 2024
1 parent 249393b commit 37a041a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
18 changes: 8 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ allprojects {
subprojects {
tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
jvmTarget = JvmTarget.JVM_1_8
freeCompilerArgs.add("-Xjvm-default=all")
}
}
// Ensure "org.gradle.jvm.version" is set to "8" in Gradle metadata.
tasks.withType<JavaCompile> {
options.release.set(8)
options.release = 8
}

if ("test" !in name && buildFile.exists()) {
Expand All @@ -71,9 +71,9 @@ subprojects {
afterEvaluate {
tasks.named<DokkaTask>("dokkaHtml") {
val projectFolder = project.path.trim(':').replace(':', '-')
outputDirectory.set(rootProject.rootDir.resolve("docs/1.x/$projectFolder"))
outputDirectory = rootProject.rootDir.resolve("docs/1.x/$projectFolder")
dokkaSourceSets.configureEach {
skipDeprecated.set(true)
skipDeprecated = true
}
}
}
Expand Down Expand Up @@ -120,12 +120,10 @@ subprojects {
for (majorVersion in versionsToTest) {
val jdkTest = tasks.register<Test>("testJdk$majorVersion") {
val javaToolchains = project.extensions.getByType(JavaToolchainService::class)
javaLauncher.set(
javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(majorVersion))
vendor.set(JvmVendorSpec.AZUL)
},
)
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(majorVersion)
vendor = JvmVendorSpec.AZUL
}

description = "Runs the test suite on JDK $majorVersion"
group = LifecycleBasePlugin.VERIFICATION_GROUP
Expand Down
2 changes: 1 addition & 1 deletion kotlinpoet/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ kotlin {

@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
allWarningsAsErrors.set(true)
allWarningsAsErrors = true
optIn.add("com.squareup.kotlinpoet.DelicateKotlinPoetApi")
}

Expand Down

0 comments on commit 37a041a

Please sign in to comment.