diff --git a/buildSrc/src/main/kotlin/android-studio-releases-generator.gradle.kts b/buildSrc/src/main/kotlin/android-studio-releases-generator.gradle.kts index 7d3e17723..f49a02976 100644 --- a/buildSrc/src/main/kotlin/android-studio-releases-generator.gradle.kts +++ b/buildSrc/src/main/kotlin/android-studio-releases-generator.gradle.kts @@ -1,36 +1,38 @@ +@file:Suppress("UnstableApiUsage") + import com.squareup.kotlinpoet.ClassName import io.gitlab.arturbosch.detekt.Detekt -import org.gradle.kotlin.dsl.get -import org.gradle.kotlin.dsl.getByType -import org.gradle.kotlin.dsl.register -import org.gradle.kotlin.dsl.withType import org.jetbrains.jewel.buildlogic.demodata.AndroidStudioReleasesGeneratorTask import org.jetbrains.jewel.buildlogic.demodata.STUDIO_RELEASES_OUTPUT_CLASS_NAME import org.jetbrains.jewel.buildlogic.demodata.StudioVersionsGenerationExtension import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension import org.jetbrains.kotlin.gradle.tasks.BaseKotlinCompile -val extension = extensions.findByType(StudioVersionsGenerationExtension::class.java) - ?: extensions.create("androidStudioReleasesGenerator", StudioVersionsGenerationExtension::class.java) +val extension: StudioVersionsGenerationExtension = + extensions.findByType(StudioVersionsGenerationExtension::class.java) + ?: extensions.create("androidStudioReleasesGenerator", StudioVersionsGenerationExtension::class.java) val task = tasks.register("generateAndroidStudioReleasesList") { val className = ClassName.bestGuess(STUDIO_RELEASES_OUTPUT_CLASS_NAME) - outputFile.set( - extension.targetDir.file( - className.packageName.replace(".", "/") - .plus("/${className.simpleName}.kt") - ) + outputFile = extension.targetDir.file( + className.packageName.replace(".", "/") + .plus("/${className.simpleName}.kt") ) - dataUrl.set(extension.dataUrl) - resourcesDirs.set(extension.resourcesDirs) + dataUrl = extension.dataUrl + resourcesDirs = extension.resourcesDirs + } + +tasks { + withType { + dependsOn(task) + } + + withType { + dependsOn(task) } -tasks.withType { - dependsOn(task) -} -tasks.withType { - dependsOn(task) } + pluginManager.withPlugin("org.jetbrains.kotlin.jvm") { extensions.getByType().apply { sourceSets["main"].kotlin.srcDir(extension.targetDir) diff --git a/buildSrc/src/main/kotlin/intellij-theme-generator.gradle.kts b/buildSrc/src/main/kotlin/intellij-theme-generator.gradle.kts index 788b83011..3cc99b7c6 100644 --- a/buildSrc/src/main/kotlin/intellij-theme-generator.gradle.kts +++ b/buildSrc/src/main/kotlin/intellij-theme-generator.gradle.kts @@ -1,10 +1,7 @@ +@file:Suppress("UnstableApiUsage") + import com.squareup.kotlinpoet.ClassName import io.gitlab.arturbosch.detekt.Detekt -import org.gradle.kotlin.dsl.container -import org.gradle.kotlin.dsl.get -import org.gradle.kotlin.dsl.getByType -import org.gradle.kotlin.dsl.register -import org.gradle.kotlin.dsl.withType import org.gradle.util.internal.GUtil import org.jetbrains.jewel.buildlogic.theme.IntelliJThemeGeneratorTask import org.jetbrains.jewel.buildlogic.theme.ThemeGeneration @@ -17,21 +14,26 @@ extensions.add("intelliJThemeGenerator", extension) extension.all { val task = tasks.register("generate${GUtil.toCamelCase(name)}Theme") { - outputFile.set(targetDir.file(this@all.themeClassName.map { + outputFile = targetDir.file(this@all.themeClassName.map { val className = ClassName.bestGuess(it) className.packageName.replace(".", "/") .plus("/${className.simpleName}.kt") - })) - themeClassName.set(this@all.themeClassName) - ideaVersion.set(this@all.ideaVersion) - themeFile.set(this@all.themeFile) - } - tasks.withType { - dependsOn(task) + }) + themeClassName = this@all.themeClassName + ideaVersion = this@all.ideaVersion + themeFile = this@all.themeFile } - tasks.withType { - dependsOn(task) + + tasks { + withType { + dependsOn(task) + } + + withType { + dependsOn(task) + } } + pluginManager.withPlugin("org.jetbrains.kotlin.jvm") { extensions.getByType().apply { sourceSets["main"].kotlin.srcDir(targetDir) diff --git a/buildSrc/src/main/kotlin/jewel-check-public-api.gradle.kts b/buildSrc/src/main/kotlin/jewel-check-public-api.gradle.kts index ebc91b8e4..ac00fb529 100644 --- a/buildSrc/src/main/kotlin/jewel-check-public-api.gradle.kts +++ b/buildSrc/src/main/kotlin/jewel-check-public-api.gradle.kts @@ -1,3 +1,5 @@ +@file:Suppress("UnstableApiUsage") + plugins { id("org.jetbrains.kotlinx.binary-compatibility-validator") id("dev.drewhamilton.poko") @@ -13,7 +15,7 @@ apiValidation { } poko { - pokoAnnotation.set("org.jetbrains.jewel.foundation.GenerateDataFunctions") + pokoAnnotation = "org.jetbrains.jewel.foundation.GenerateDataFunctions" } tasks {