diff --git a/bench/bench.gradle.kts b/bench/bench.gradle.kts index b41519b9..0a2aa63c 100644 --- a/bench/bench.gradle.kts +++ b/bench/bench.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,8 @@ * limitations under the License. */ plugins { - pklAllProjects - pklJavaLibrary + id("pklAllProjects") + id("pklJavaLibrary") id("me.champeau.jmh") } diff --git a/buildSrc/build.gradle.kts b/build-logic/build.gradle.kts similarity index 100% rename from buildSrc/build.gradle.kts rename to build-logic/build.gradle.kts diff --git a/buildSrc/settings.gradle.kts b/build-logic/settings.gradle.kts similarity index 90% rename from buildSrc/settings.gradle.kts rename to build-logic/settings.gradle.kts index 399b53d2..29b4466a 100644 --- a/buildSrc/settings.gradle.kts +++ b/build-logic/settings.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ */ @file:Suppress("UnstableApiUsage") -rootProject.name = "buildSrc" +rootProject.name = "build-logic" pluginManagement { repositories { @@ -24,7 +24,7 @@ pluginManagement { } } -plugins { id("org.gradle.toolchains.foojay-resolver-convention") } +plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" } // makes ~/.gradle/init.gradle unnecessary and ~/.gradle/gradle.properties optional dependencyResolutionManagement { diff --git a/buildSrc/src/main/kotlin/BuildInfo.kt b/build-logic/src/main/kotlin/BuildInfo.kt similarity index 99% rename from buildSrc/src/main/kotlin/BuildInfo.kt rename to build-logic/src/main/kotlin/BuildInfo.kt index 11a3eefa..766f9a39 100644 --- a/buildSrc/src/main/kotlin/BuildInfo.kt +++ b/build-logic/src/main/kotlin/BuildInfo.kt @@ -44,7 +44,7 @@ const val PKL_JVM_TARGET_DEFAULT_MAXIMUM = 17 * * This is a build-time requirement, not a runtime requirement. To avoid the provisioning of * multiple JDKs and other build issues, keep this value in sync with the JVM toolchain versions in - * `buildSrc/build.gradle.kts` and `gradle-daemon-jvm.properties`. + * `build-logic/build.gradle.kts` and `gradle-daemon-jvm.properties`. */ const val PKL_JDK_VERSION_MIN = 25 diff --git a/buildSrc/src/main/kotlin/ExecutableJar.kt b/build-logic/src/main/kotlin/ExecutableJar.kt similarity index 100% rename from buildSrc/src/main/kotlin/ExecutableJar.kt rename to build-logic/src/main/kotlin/ExecutableJar.kt diff --git a/buildSrc/src/main/kotlin/ExecutableSpec.kt b/build-logic/src/main/kotlin/ExecutableSpec.kt similarity index 94% rename from buildSrc/src/main/kotlin/ExecutableSpec.kt rename to build-logic/src/main/kotlin/ExecutableSpec.kt index b877ca76..94cd6cb4 100644 --- a/buildSrc/src/main/kotlin/ExecutableSpec.kt +++ b/build-logic/src/main/kotlin/ExecutableSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2025 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2025-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/buildSrc/src/main/kotlin/GradlePluginTests.kt b/build-logic/src/main/kotlin/GradlePluginTests.kt similarity index 90% rename from buildSrc/src/main/kotlin/GradlePluginTests.kt rename to build-logic/src/main/kotlin/GradlePluginTests.kt index 1a39ac66..9405c20f 100644 --- a/buildSrc/src/main/kotlin/GradlePluginTests.kt +++ b/build-logic/src/main/kotlin/GradlePluginTests.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/buildSrc/src/main/kotlin/GradleVersionInfo.kt b/build-logic/src/main/kotlin/GradleVersionInfo.kt similarity index 96% rename from buildSrc/src/main/kotlin/GradleVersionInfo.kt rename to build-logic/src/main/kotlin/GradleVersionInfo.kt index 15d94b61..9e3ba3cc 100644 --- a/buildSrc/src/main/kotlin/GradleVersionInfo.kt +++ b/build-logic/src/main/kotlin/GradleVersionInfo.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/buildSrc/src/main/kotlin/HtmlValidator.kt b/build-logic/src/main/kotlin/HtmlValidator.kt similarity index 89% rename from buildSrc/src/main/kotlin/HtmlValidator.kt rename to build-logic/src/main/kotlin/HtmlValidator.kt index 2e22b4d8..1523df14 100644 --- a/buildSrc/src/main/kotlin/HtmlValidator.kt +++ b/build-logic/src/main/kotlin/HtmlValidator.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/buildSrc/src/main/kotlin/InstallGraalVm.kt b/build-logic/src/main/kotlin/InstallGraalVm.kt similarity index 98% rename from buildSrc/src/main/kotlin/InstallGraalVm.kt rename to build-logic/src/main/kotlin/InstallGraalVm.kt index 8ab12356..d7a9dbc6 100644 --- a/buildSrc/src/main/kotlin/InstallGraalVm.kt +++ b/build-logic/src/main/kotlin/InstallGraalVm.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/buildSrc/src/main/kotlin/JavaVersionRange.kt b/build-logic/src/main/kotlin/JavaVersionRange.kt similarity index 100% rename from buildSrc/src/main/kotlin/JavaVersionRange.kt rename to build-logic/src/main/kotlin/JavaVersionRange.kt diff --git a/buildSrc/src/main/kotlin/MergeSourcesJars.kt b/build-logic/src/main/kotlin/MergeSourcesJars.kt similarity index 100% rename from buildSrc/src/main/kotlin/MergeSourcesJars.kt rename to build-logic/src/main/kotlin/MergeSourcesJars.kt diff --git a/buildSrc/src/main/kotlin/NativeImageBuild.kt b/build-logic/src/main/kotlin/NativeImageBuild.kt similarity index 94% rename from buildSrc/src/main/kotlin/NativeImageBuild.kt rename to build-logic/src/main/kotlin/NativeImageBuild.kt index da66a996..f9a2be00 100644 --- a/buildSrc/src/main/kotlin/NativeImageBuild.kt +++ b/build-logic/src/main/kotlin/NativeImageBuild.kt @@ -55,13 +55,12 @@ abstract class NativeImageBuild : DefaultTask() { @get:Inject protected abstract val execOperations: ExecOperations - private val graalVm: Provider = - arch.map { a -> - when (a) { - Architecture.AMD64 -> buildInfo.graalVmAmd64 - Architecture.AARCH64 -> buildInfo.graalVmAarch64 - } + private val graalVm: Provider = arch.map { a -> + when (a) { + Architecture.AMD64 -> buildInfo.graalVmAmd64 + Architecture.AARCH64 -> buildInfo.graalVmAarch64 } + } private val buildInfo: BuildInfo = project.extensions.getByType(BuildInfo::class.java) @@ -151,10 +150,9 @@ abstract class NativeImageBuild : DefaultTask() { } // native-image rejects non-existing class path entries -> filter add("--class-path") - val pathInput = - classpath.filter { - it.exists() && !exclusions.any { exclude -> it.name.contains(exclude) } - } + val pathInput = classpath.filter { + it.exists() && !exclusions.any { exclude -> it.name.contains(exclude) } + } add(pathInput.asPath) // make sure dev machine stays responsive (15% slowdown on my laptop) val processors = diff --git a/buildSrc/src/main/kotlin/PklFormatterSpotless.kt b/build-logic/src/main/kotlin/PklFormatterSpotless.kt similarity index 100% rename from buildSrc/src/main/kotlin/PklFormatterSpotless.kt rename to build-logic/src/main/kotlin/PklFormatterSpotless.kt diff --git a/buildSrc/src/main/kotlin/PklPublishing.kt b/build-logic/src/main/kotlin/PklPublishing.kt similarity index 72% rename from buildSrc/src/main/kotlin/PklPublishing.kt rename to build-logic/src/main/kotlin/PklPublishing.kt index 60fdf79d..07ea6f32 100644 --- a/buildSrc/src/main/kotlin/PklPublishing.kt +++ b/build-logic/src/main/kotlin/PklPublishing.kt @@ -63,59 +63,58 @@ fun Project.configurePklPomMetadata() { /** Configures POM validation task to check for unresolved versions and snapshots in releases. */ fun Project.configurePomValidation() { - val validatePom by - tasks.registering { - if (tasks.findByName("generatePomFileForLibraryPublication") == null) { - return@registering - } - val generatePomFileForLibraryPublication by tasks.existing(GenerateMavenPom::class) - val outputFile = - layout.buildDirectory.file("validatePom") // dummy output to satisfy up-to-date check + val validatePom by tasks.registering { + if (tasks.findByName("generatePomFileForLibraryPublication") == null) { + return@registering + } + val generatePomFileForLibraryPublication by tasks.existing(GenerateMavenPom::class) + val outputFile = + layout.buildDirectory.file("validatePom") // dummy output to satisfy up-to-date check - dependsOn(generatePomFileForLibraryPublication) - inputs.file(generatePomFileForLibraryPublication.get().destination) - outputs.file(outputFile) + dependsOn(generatePomFileForLibraryPublication) + inputs.file(generatePomFileForLibraryPublication.get().destination) + outputs.file(outputFile) - doLast { - outputFile.get().asFile.delete() + doLast { + outputFile.get().asFile.delete() - val pomFile = generatePomFileForLibraryPublication.get().destination - assert(pomFile.exists()) + val pomFile = generatePomFileForLibraryPublication.get().destination + assert(pomFile.exists()) - val text = pomFile.readText() + val text = pomFile.readText() - run { - val unresolvedVersion = Regex(".*[+,()\\[\\]].*") - val matches = unresolvedVersion.findAll(text).toList() - if (matches.isNotEmpty()) { - throw org.gradle.api.GradleException( - """ + run { + val unresolvedVersion = Regex(".*[+,()\\[\\]].*") + val matches = unresolvedVersion.findAll(text).toList() + if (matches.isNotEmpty()) { + throw org.gradle.api.GradleException( + """ Found unresolved version selector(s) in generated POM: ${matches.joinToString("\n") { it.groupValues[0] }} """ - .trimIndent() - ) - } + .trimIndent() + ) } + } - val buildInfo = project.extensions.getByType() - if (buildInfo.isReleaseBuild) { - val snapshotVersion = Regex(".*-SNAPSHOT") - val matches = snapshotVersion.findAll(text).toList() - if (matches.isNotEmpty()) { - throw org.gradle.api.GradleException( - """ + val buildInfo = project.extensions.getByType() + if (buildInfo.isReleaseBuild) { + val snapshotVersion = Regex(".*-SNAPSHOT") + val matches = snapshotVersion.findAll(text).toList() + if (matches.isNotEmpty()) { + throw org.gradle.api.GradleException( + """ Found snapshot version(s) in generated POM of Pkl release version: ${matches.joinToString("\n") { it.groupValues[0] }} """ - .trimIndent() - ) - } + .trimIndent() + ) } - - outputFile.get().asFile.writeText("OK") } + + outputFile.get().asFile.writeText("OK") } + } tasks.named("publish") { dependsOn(validatePom) } } diff --git a/buildSrc/src/main/kotlin/ResolveSourcesJars.kt b/build-logic/src/main/kotlin/ResolveSourcesJars.kt similarity index 96% rename from buildSrc/src/main/kotlin/ResolveSourcesJars.kt rename to build-logic/src/main/kotlin/ResolveSourcesJars.kt index 7caedce3..74b2b1e2 100644 --- a/buildSrc/src/main/kotlin/ResolveSourcesJars.kt +++ b/build-logic/src/main/kotlin/ResolveSourcesJars.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/buildSrc/src/main/kotlin/RevertYearOnlyChanges.kt b/build-logic/src/main/kotlin/RevertYearOnlyChanges.kt similarity index 100% rename from buildSrc/src/main/kotlin/RevertYearOnlyChanges.kt rename to build-logic/src/main/kotlin/RevertYearOnlyChanges.kt diff --git a/buildSrc/src/main/kotlin/pklAllProjects.gradle.kts b/build-logic/src/main/kotlin/pklAllProjects.gradle.kts similarity index 91% rename from buildSrc/src/main/kotlin/pklAllProjects.gradle.kts rename to build-logic/src/main/kotlin/pklAllProjects.gradle.kts index aa27e885..ba48440b 100644 --- a/buildSrc/src/main/kotlin/pklAllProjects.gradle.kts +++ b/build-logic/src/main/kotlin/pklAllProjects.gradle.kts @@ -112,7 +112,7 @@ tasks.withType(JavaExec::class).configureEach { private val libs = the() private val licenseHeaderFile by lazy { - rootProject.file("buildSrc/src/main/resources/license-header.star-block.txt") + rootProject.file("build-logic/src/main/resources/license-header.star-block.txt") } private fun KotlinGradleExtension.configureFormatter() { @@ -136,18 +136,18 @@ spotless { val revertYearOnlyChangesStep = RevertYearOnlyChangesStep(rootProject.rootDir, ratchetFrom!!).create() - // When building root project, format buildSrc files too. - // We need this because buildSrc is not a subproject of the root project, so a top-level - // `spotlessApply` will not trigger `buildSrc:spotlessApply`. - if (project === rootProject) { + // When building root project, format build-logic files too. + // We need this because build-logic is not a subproject of the root project, so a top-level + // `spotlessApply` will not trigger `build-logic:spotlessApply`. + if (project.path == rootProject.path) { kotlinGradle { configureFormatter() addStep(revertYearOnlyChangesStep) - target("*.kts", "buildSrc/*.kts", "buildSrc/src/*/kotlin/**/*.kts") + target("*.kts", "build-logic/*.kts", "build-logic/src/*/kotlin/**/*.kts") } kotlin { ktfmt(libs.versions.ktfmt.get()).googleStyle() - target("buildSrc/src/*/kotlin/**/*.kt") + target("build-logic/src/*/kotlin/**/*.kt") licenseHeaderFile(licenseHeaderFile) addStep(revertYearOnlyChangesStep) } diff --git a/buildSrc/src/main/kotlin/pklFatJar.gradle.kts b/build-logic/src/main/kotlin/pklFatJar.gradle.kts similarity index 100% rename from buildSrc/src/main/kotlin/pklFatJar.gradle.kts rename to build-logic/src/main/kotlin/pklFatJar.gradle.kts diff --git a/buildSrc/src/main/kotlin/pklGraalVm.gradle.kts b/build-logic/src/main/kotlin/pklGraalVm.gradle.kts similarity index 96% rename from buildSrc/src/main/kotlin/pklGraalVm.gradle.kts rename to build-logic/src/main/kotlin/pklGraalVm.gradle.kts index 58894b9d..95351beb 100644 --- a/buildSrc/src/main/kotlin/pklGraalVm.gradle.kts +++ b/build-logic/src/main/kotlin/pklGraalVm.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/buildSrc/src/main/kotlin/pklGradlePluginTest.gradle.kts b/build-logic/src/main/kotlin/pklGradlePluginTest.gradle.kts similarity index 100% rename from buildSrc/src/main/kotlin/pklGradlePluginTest.gradle.kts rename to build-logic/src/main/kotlin/pklGradlePluginTest.gradle.kts diff --git a/buildSrc/src/main/kotlin/pklHtmlValidator.gradle.kts b/build-logic/src/main/kotlin/pklHtmlValidator.gradle.kts similarity index 100% rename from buildSrc/src/main/kotlin/pklHtmlValidator.gradle.kts rename to build-logic/src/main/kotlin/pklHtmlValidator.gradle.kts diff --git a/buildSrc/src/main/kotlin/pklJSpecify.gradle.kts b/build-logic/src/main/kotlin/pklJSpecify.gradle.kts similarity index 100% rename from buildSrc/src/main/kotlin/pklJSpecify.gradle.kts rename to build-logic/src/main/kotlin/pklJSpecify.gradle.kts diff --git a/buildSrc/src/main/kotlin/pklJavaExecutable.gradle.kts b/build-logic/src/main/kotlin/pklJavaExecutable.gradle.kts similarity index 90% rename from buildSrc/src/main/kotlin/pklJavaExecutable.gradle.kts rename to build-logic/src/main/kotlin/pklJavaExecutable.gradle.kts index cc51b95a..d05bb185 100644 --- a/buildSrc/src/main/kotlin/pklJavaExecutable.gradle.kts +++ b/build-logic/src/main/kotlin/pklJavaExecutable.gradle.kts @@ -47,20 +47,19 @@ fun Task.setupTestStartJavaExecutable(launcher: Provider? = null) val outputFile = layout.buildDirectory.file("testStartJavaExecutable/$name") outputs.file(outputFile) - val execOutput = - providers.exec { - val executablePath = javaExecutable.get().outputs.files.singleFile - if (launcher?.isPresent == true) { - commandLine( - launcher.get().executablePath.asFile.absolutePath, - "-jar", - executablePath.absolutePath, - "--version", - ) - } else { - commandLine(executablePath.absolutePath, "--version") - } + val execOutput = providers.exec { + val executablePath = javaExecutable.get().outputs.files.singleFile + if (launcher?.isPresent == true) { + commandLine( + launcher.get().executablePath.asFile.absolutePath, + "-jar", + executablePath.absolutePath, + "--version", + ) + } else { + commandLine(executablePath.absolutePath, "--version") } + } doLast { val outputText = execOutput.standardOutput.asText.get() diff --git a/buildSrc/src/main/kotlin/pklJavaLibrary.gradle.kts b/build-logic/src/main/kotlin/pklJavaLibrary.gradle.kts similarity index 97% rename from buildSrc/src/main/kotlin/pklJavaLibrary.gradle.kts rename to build-logic/src/main/kotlin/pklJavaLibrary.gradle.kts index bbbba084..a5abf566 100644 --- a/buildSrc/src/main/kotlin/pklJavaLibrary.gradle.kts +++ b/build-logic/src/main/kotlin/pklJavaLibrary.gradle.kts @@ -56,7 +56,9 @@ spotless { addStep(revertYearOnlyChanges) googleJavaFormat(libs.versions.googleJavaFormat.get()) target("src/*/java/**/*.java") - licenseHeaderFile(rootProject.file("buildSrc/src/main/resources/license-header.star-block.txt")) + licenseHeaderFile( + rootProject.file("build-logic/src/main/resources/license-header.star-block.txt") + ) } } diff --git a/buildSrc/src/main/kotlin/pklKotlinBase.gradle.kts b/build-logic/src/main/kotlin/pklKotlinBase.gradle.kts similarity index 97% rename from buildSrc/src/main/kotlin/pklKotlinBase.gradle.kts rename to build-logic/src/main/kotlin/pklKotlinBase.gradle.kts index a5611680..6516cc40 100644 --- a/buildSrc/src/main/kotlin/pklKotlinBase.gradle.kts +++ b/build-logic/src/main/kotlin/pklKotlinBase.gradle.kts @@ -56,7 +56,9 @@ spotless { addStep(revertYearOnlyChanges) ktfmt(libs.versions.ktfmt.get()).googleStyle() target("src/*/kotlin/**/*.kt") - licenseHeaderFile(rootProject.file("buildSrc/src/main/resources/license-header.star-block.txt")) + licenseHeaderFile( + rootProject.file("build-logic/src/main/resources/license-header.star-block.txt") + ) } } diff --git a/buildSrc/src/main/kotlin/pklKotlinLibrary.gradle.kts b/build-logic/src/main/kotlin/pklKotlinLibrary.gradle.kts similarity index 100% rename from buildSrc/src/main/kotlin/pklKotlinLibrary.gradle.kts rename to build-logic/src/main/kotlin/pklKotlinLibrary.gradle.kts diff --git a/buildSrc/src/main/kotlin/pklKotlinTest.gradle.kts b/build-logic/src/main/kotlin/pklKotlinTest.gradle.kts similarity index 100% rename from buildSrc/src/main/kotlin/pklKotlinTest.gradle.kts rename to build-logic/src/main/kotlin/pklKotlinTest.gradle.kts diff --git a/buildSrc/src/main/kotlin/pklNativeExecutable.gradle.kts b/build-logic/src/main/kotlin/pklNativeExecutable.gradle.kts similarity index 80% rename from buildSrc/src/main/kotlin/pklNativeExecutable.gradle.kts rename to build-logic/src/main/kotlin/pklNativeExecutable.gradle.kts index 609a45a6..563c8964 100644 --- a/buildSrc/src/main/kotlin/pklNativeExecutable.gradle.kts +++ b/build-logic/src/main/kotlin/pklNativeExecutable.gradle.kts @@ -37,16 +37,15 @@ val stagedLinuxAarch64Executable: Configuration by configurations.creating val stagedAlpineLinuxAmd64Executable: Configuration by configurations.creating val stagedWindowsAmd64Executable: Configuration by configurations.creating -val nativeImageClasspath by - configurations.creating { - extendsFrom(configurations.runtimeClasspath.get()) - // Ensure native-image version uses GraalVM C SDKs instead of Java FFI or JNA - // (comes from artifact `mordant-jvm-graal-ffi`). - exclude("com.github.ajalt.mordant", "mordant-jvm-ffm") - exclude("com.github.ajalt.mordant", "mordant-jvm-ffm-jvm") - exclude("com.github.ajalt.mordant", "mordant-jvm-jna") - exclude("com.github.ajalt.mordant", "mordant-jvm-jna-jvm") - } +val nativeImageClasspath by configurations.creating { + extendsFrom(configurations.runtimeClasspath.get()) + // Ensure native-image version uses GraalVM C SDKs instead of Java FFI or JNA + // (comes from artifact `mordant-jvm-graal-ffi`). + exclude("com.github.ajalt.mordant", "mordant-jvm-ffm") + exclude("com.github.ajalt.mordant", "mordant-jvm-ffm-jvm") + exclude("com.github.ajalt.mordant", "mordant-jvm-jna") + exclude("com.github.ajalt.mordant", "mordant-jvm-jna-jvm") +} val libs = the() @@ -140,65 +139,63 @@ val windowsExecutableAmd64 by val assembleNative by tasks.existing -val testStartNativeExecutable by - tasks.registering { - dependsOn(assembleNative) +val testStartNativeExecutable by tasks.registering { + dependsOn(assembleNative) - // dummy file for up-to-date checking - val outputFile = project.layout.buildDirectory.file("testStartNativeExecutable/output.txt") - outputs.file(outputFile) + // dummy file for up-to-date checking + val outputFile = project.layout.buildDirectory.file("testStartNativeExecutable/output.txt") + outputs.file(outputFile) - val execOutput = - providers.exec { commandLine(assembleNative.get().outputs.files.singleFile, "--version") } + val execOutput = providers.exec { + commandLine(assembleNative.get().outputs.files.singleFile, "--version") + } - doLast { - val outputText = execOutput.standardOutput.asText.get() - if (!outputText.contains(buildInfo.pklVersionNonUnique)) { - throw GradleException( - "Expected version output to contain current version (${buildInfo.pklVersionNonUnique}), but got '$outputText'" - ) - } - outputFile.get().asFile.toPath().apply { - try { - parent.createDirectories() - } catch (_: java.nio.file.FileAlreadyExistsException) {} - writeText("OK") - } + doLast { + val outputText = execOutput.standardOutput.asText.get() + if (!outputText.contains(buildInfo.pklVersionNonUnique)) { + throw GradleException( + "Expected version output to contain current version (${buildInfo.pklVersionNonUnique}), but got '$outputText'" + ) + } + outputFile.get().asFile.toPath().apply { + try { + parent.createDirectories() + } catch (_: java.nio.file.FileAlreadyExistsException) {} + writeText("OK") } } +} val requiredGlibcVersion: Version = Version.parse("2.17") -val checkGlibc by - tasks.registering { - enabled = buildInfo.os.isLinux && !buildInfo.musl - dependsOn(assembleNative) - doLast { - val exec = - providers.exec { - commandLine("objdump", "-T", assembleNative.get().outputs.files.singleFile) +val checkGlibc by tasks.registering { + enabled = buildInfo.os.isLinux && !buildInfo.musl + dependsOn(assembleNative) + doLast { + val exec = providers.exec { + commandLine("objdump", "-T", assembleNative.get().outputs.files.singleFile) + } + val output = exec.standardOutput.asText.get() + val minimumGlibcVersion = + output + .split("\n") + .mapNotNull { line -> + val match = Regex("GLIBC_([.0-9]*)").find(line) + match?.groups[1]?.let { Version.parse(it.value) } } - val output = exec.standardOutput.asText.get() - val minimumGlibcVersion = - output - .split("\n") - .mapNotNull { line -> - val match = Regex("GLIBC_([.0-9]*)").find(line) - match?.groups[1]?.let { Version.parse(it.value) } - } - .maxOrNull() - if (minimumGlibcVersion == null) { - throw GradleException( - "Could not determine glibc version from executable. objdump output: $output" - ) - } - if (minimumGlibcVersion > requiredGlibcVersion) { - throw GradleException( - "Incorrect glibc version. Found: $minimumGlibcVersion, required: $requiredGlibcVersion" - ) - } + .maxOrNull() + if (minimumGlibcVersion == null) { + throw GradleException( + "Could not determine glibc version from executable. objdump output: $output" + ) + } + if (minimumGlibcVersion > requiredGlibcVersion) { + throw GradleException( + "Incorrect glibc version. Found: $minimumGlibcVersion, required: $requiredGlibcVersion" + ) } } +} // Expose underlying task's outputs private fun Task.wraps(other: TaskProvider) { diff --git a/build-logic/src/main/kotlin/pklNativeLifecycle.gradle.kts b/build-logic/src/main/kotlin/pklNativeLifecycle.gradle.kts new file mode 100644 index 00000000..2ad2de5c --- /dev/null +++ b/build-logic/src/main/kotlin/pklNativeLifecycle.gradle.kts @@ -0,0 +1,122 @@ +/* + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +val assembleNativeMacOsAarch64 by tasks.registering { group = "build" } + +val assembleNativeMacOsAmd64 by tasks.registering { group = "build" } + +val assembleNativeLinuxAarch64 by tasks.registering { group = "build" } + +val assembleNativeLinuxAmd64 by tasks.registering { group = "build" } + +val assembleNativeAlpineLinuxAmd64 by tasks.registering { group = "build" } + +val assembleNativeWindowsAmd64 by tasks.registering { group = "build" } + +val testNativeMacOsAarch64 by tasks.registering { group = "verification" } + +val testNativeMacOsAmd64 by tasks.registering { group = "verification" } + +val testNativeLinuxAarch64 by tasks.registering { group = "verification" } + +val testNativeLinuxAmd64 by tasks.registering { group = "verification" } + +val testNativeAlpineLinuxAmd64 by tasks.registering { group = "verification" } + +val testNativeWindowsAmd64 by tasks.registering { group = "verification" } + +val buildInfo = project.extensions.getByType() + +private fun Task.wraps(other: TaskProvider) { + dependsOn(other) + outputs.files(other) +} + +val assembleNative by tasks.registering { + group = "build" + + if (!buildInfo.isCrossArchSupported && buildInfo.isCrossArch) { + throw GradleException("Cross-arch builds are not supported on ${buildInfo.os.name}") + } + + when { + buildInfo.os.isMacOsX && buildInfo.targetArch == "aarch64" -> { + wraps(assembleNativeMacOsAarch64) + } + buildInfo.os.isMacOsX && buildInfo.targetArch == "amd64" -> { + wraps(assembleNativeMacOsAmd64) + } + buildInfo.os.isLinux && buildInfo.targetArch == "aarch64" -> { + wraps(assembleNativeLinuxAarch64) + } + buildInfo.os.isLinux && buildInfo.targetArch == "amd64" -> { + if (buildInfo.musl) wraps(assembleNativeAlpineLinuxAmd64) else wraps(assembleNativeLinuxAmd64) + } + buildInfo.os.isWindows && buildInfo.targetArch == "amd64" -> { + wraps(assembleNativeWindowsAmd64) + } + else -> { + doLast { + throw GradleException( + "Cannot build targeting ${buildInfo.os.name}/${buildInfo.targetArch} with musl=${buildInfo.musl}" + ) + } + } + } +} + +val testNative by tasks.registering { + group = "verification" + dependsOn(assembleNative) + + if (!buildInfo.isCrossArchSupported && buildInfo.isCrossArch) { + throw GradleException("Cross-arch builds are not supported on ${buildInfo.os.name}") + } + + when { + buildInfo.os.isMacOsX && buildInfo.targetArch == "aarch64" -> { + dependsOn(testNativeMacOsAarch64) + } + buildInfo.os.isMacOsX && buildInfo.targetArch == "amd64" -> { + dependsOn(testNativeMacOsAmd64) + } + buildInfo.os.isLinux && buildInfo.targetArch == "aarch64" -> { + dependsOn(testNativeLinuxAarch64) + } + buildInfo.os.isLinux && buildInfo.targetArch == "amd64" -> { + if (buildInfo.musl) dependsOn(testNativeAlpineLinuxAmd64) else dependsOn(testNativeLinuxAmd64) + } + buildInfo.os.isWindows && buildInfo.targetArch == "amd64" -> { + dependsOn(testNativeWindowsAmd64) + } + else -> { + doLast { + throw GradleException( + "Cannot build targeting ${buildInfo.os.name}/${buildInfo.targetArch} with musl=${buildInfo.musl}" + ) + } + } + } +} + +val checkNative by tasks.registering { + group = "verification" + dependsOn(testNative) +} + +val buildNative by tasks.registering { + group = "build" + dependsOn(checkNative) +} diff --git a/buildSrc/src/main/kotlin/pklPublishLibrary.gradle.kts b/build-logic/src/main/kotlin/pklPublishLibrary.gradle.kts similarity index 100% rename from buildSrc/src/main/kotlin/pklPublishLibrary.gradle.kts rename to build-logic/src/main/kotlin/pklPublishLibrary.gradle.kts diff --git a/buildSrc/src/main/kotlin/pklSpotlessFormat.gradle.kts b/build-logic/src/main/kotlin/pklSpotlessFormat.gradle.kts similarity index 86% rename from buildSrc/src/main/kotlin/pklSpotlessFormat.gradle.kts rename to build-logic/src/main/kotlin/pklSpotlessFormat.gradle.kts index 839d14bc..c418a8b3 100644 --- a/buildSrc/src/main/kotlin/pklSpotlessFormat.gradle.kts +++ b/build-logic/src/main/kotlin/pklSpotlessFormat.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright © 2025 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2025-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ spotless { target("**/*.pkl") addStep(PklFormatterStep(pklFormatter).create()) licenseHeaderFile( - rootProject.file("buildSrc/src/main/resources/license-header.line-comment.txt"), + rootProject.file("build-logic/src/main/resources/license-header.line-comment.txt"), "/// ", ) // disable ratcheting for Pkl sources diff --git a/buildSrc/src/main/resources/license-header.line-comment.txt b/build-logic/src/main/resources/license-header.line-comment.txt similarity index 100% rename from buildSrc/src/main/resources/license-header.line-comment.txt rename to build-logic/src/main/resources/license-header.line-comment.txt diff --git a/buildSrc/src/main/resources/license-header.star-block.txt b/build-logic/src/main/resources/license-header.star-block.txt similarity index 100% rename from buildSrc/src/main/resources/license-header.star-block.txt rename to build-logic/src/main/resources/license-header.star-block.txt diff --git a/build.gradle.kts b/build.gradle.kts index 394bfbbd..52395855 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -19,8 +19,8 @@ import org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.PLATFORM import org.jetbrains.gradle.ext.ProjectSettings plugins { - pklAllProjects - pklGraalVm + id("pklAllProjects") + id("pklGraalVm") alias(libs.plugins.ideaExt) alias(libs.plugins.jmh) apply false diff --git a/buildSrc/src/main/kotlin/pklNativeLifecycle.gradle.kts b/buildSrc/src/main/kotlin/pklNativeLifecycle.gradle.kts deleted file mode 100644 index eed95fe8..00000000 --- a/buildSrc/src/main/kotlin/pklNativeLifecycle.gradle.kts +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -val assembleNativeMacOsAarch64 by tasks.registering { group = "build" } - -val assembleNativeMacOsAmd64 by tasks.registering { group = "build" } - -val assembleNativeLinuxAarch64 by tasks.registering { group = "build" } - -val assembleNativeLinuxAmd64 by tasks.registering { group = "build" } - -val assembleNativeAlpineLinuxAmd64 by tasks.registering { group = "build" } - -val assembleNativeWindowsAmd64 by tasks.registering { group = "build" } - -val testNativeMacOsAarch64 by tasks.registering { group = "verification" } - -val testNativeMacOsAmd64 by tasks.registering { group = "verification" } - -val testNativeLinuxAarch64 by tasks.registering { group = "verification" } - -val testNativeLinuxAmd64 by tasks.registering { group = "verification" } - -val testNativeAlpineLinuxAmd64 by tasks.registering { group = "verification" } - -val testNativeWindowsAmd64 by tasks.registering { group = "verification" } - -val buildInfo = project.extensions.getByType() - -private fun Task.wraps(other: TaskProvider) { - dependsOn(other) - outputs.files(other) -} - -val assembleNative by - tasks.registering { - group = "build" - - if (!buildInfo.isCrossArchSupported && buildInfo.isCrossArch) { - throw GradleException("Cross-arch builds are not supported on ${buildInfo.os.name}") - } - - when { - buildInfo.os.isMacOsX && buildInfo.targetArch == "aarch64" -> { - wraps(assembleNativeMacOsAarch64) - } - buildInfo.os.isMacOsX && buildInfo.targetArch == "amd64" -> { - wraps(assembleNativeMacOsAmd64) - } - buildInfo.os.isLinux && buildInfo.targetArch == "aarch64" -> { - wraps(assembleNativeLinuxAarch64) - } - buildInfo.os.isLinux && buildInfo.targetArch == "amd64" -> { - if (buildInfo.musl) wraps(assembleNativeAlpineLinuxAmd64) - else wraps(assembleNativeLinuxAmd64) - } - buildInfo.os.isWindows && buildInfo.targetArch == "amd64" -> { - wraps(assembleNativeWindowsAmd64) - } - else -> { - doLast { - throw GradleException( - "Cannot build targeting ${buildInfo.os.name}/${buildInfo.targetArch} with musl=${buildInfo.musl}" - ) - } - } - } - } - -val testNative by - tasks.registering { - group = "verification" - dependsOn(assembleNative) - - if (!buildInfo.isCrossArchSupported && buildInfo.isCrossArch) { - throw GradleException("Cross-arch builds are not supported on ${buildInfo.os.name}") - } - - when { - buildInfo.os.isMacOsX && buildInfo.targetArch == "aarch64" -> { - dependsOn(testNativeMacOsAarch64) - } - buildInfo.os.isMacOsX && buildInfo.targetArch == "amd64" -> { - dependsOn(testNativeMacOsAmd64) - } - buildInfo.os.isLinux && buildInfo.targetArch == "aarch64" -> { - dependsOn(testNativeLinuxAarch64) - } - buildInfo.os.isLinux && buildInfo.targetArch == "amd64" -> { - if (buildInfo.musl) dependsOn(testNativeAlpineLinuxAmd64) - else dependsOn(testNativeLinuxAmd64) - } - buildInfo.os.isWindows && buildInfo.targetArch == "amd64" -> { - dependsOn(testNativeWindowsAmd64) - } - else -> { - doLast { - throw GradleException( - "Cannot build targeting ${buildInfo.os.name}/${buildInfo.targetArch} with musl=${buildInfo.musl}" - ) - } - } - } - } - -val checkNative by - tasks.registering { - group = "verification" - dependsOn(testNative) - } - -val buildNative by - tasks.registering { - group = "build" - dependsOn(checkNative) - } diff --git a/docs/docs.gradle.kts b/docs/docs.gradle.kts index 0ec7ce18..d7e6e871 100644 --- a/docs/docs.gradle.kts +++ b/docs/docs.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,8 +16,8 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension plugins { - pklAllProjects - pklKotlinTest + id("pklAllProjects") + id("pklKotlinTest") } sourceSets { diff --git a/pkl-bom/pkl-bom.gradle.kts b/pkl-bom/pkl-bom.gradle.kts index 09b54699..3212fcd3 100644 --- a/pkl-bom/pkl-bom.gradle.kts +++ b/pkl-bom/pkl-bom.gradle.kts @@ -14,7 +14,7 @@ * limitations under the License. */ plugins { - pklAllProjects + id("pklAllProjects") `java-platform` `maven-publish` signing diff --git a/pkl-cli/pkl-cli.gradle.kts b/pkl-cli/pkl-cli.gradle.kts index 6766105a..f25a54f8 100644 --- a/pkl-cli/pkl-cli.gradle.kts +++ b/pkl-cli/pkl-cli.gradle.kts @@ -18,14 +18,14 @@ import java.io.OutputStream import org.gradle.kotlin.dsl.support.serviceOf plugins { - pklAllProjects - pklKotlinLibrary - pklPublishLibrary - pklJavaExecutable - pklNativeExecutable + id("pklAllProjects") + id("pklKotlinLibrary") + id("pklPublishLibrary") + id("pklJavaExecutable") + id("pklNativeExecutable") `maven-publish` - // already on build script class path (see buildSrc/build.gradle.kts), + // already on build script class path (see build-logic/build.gradle.kts), // hence must only specify plugin ID here id(libs.plugins.shadow.get().pluginId) diff --git a/pkl-codegen-java/pkl-codegen-java.gradle.kts b/pkl-codegen-java/pkl-codegen-java.gradle.kts index 66685ebb..1a4f1b55 100644 --- a/pkl-codegen-java/pkl-codegen-java.gradle.kts +++ b/pkl-codegen-java/pkl-codegen-java.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,10 @@ * limitations under the License. */ plugins { - pklAllProjects - pklKotlinLibrary - pklPublishLibrary - pklJavaExecutable + id("pklAllProjects") + id("pklKotlinLibrary") + id("pklPublishLibrary") + id("pklJavaExecutable") } dependencies { @@ -56,7 +56,7 @@ publishing { """ Java source code generator that generates corresponding Java classes for Pkl classes, simplifying consumption of Pkl configuration as statically typed Java objects. - """ + """ .trimIndent() ) } diff --git a/pkl-codegen-kotlin/pkl-codegen-kotlin.gradle.kts b/pkl-codegen-kotlin/pkl-codegen-kotlin.gradle.kts index 95182c8a..6f6bef9a 100644 --- a/pkl-codegen-kotlin/pkl-codegen-kotlin.gradle.kts +++ b/pkl-codegen-kotlin/pkl-codegen-kotlin.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,10 @@ * limitations under the License. */ plugins { - pklAllProjects - pklKotlinLibrary - pklPublishLibrary - pklJavaExecutable + id("pklAllProjects") + id("pklKotlinLibrary") + id("pklPublishLibrary") + id("pklJavaExecutable") } publishing { @@ -29,7 +29,7 @@ publishing { """ Kotlin source code generator that generates corresponding Kotlin classes for Pkl classes, simplifying consumption of Pkl configuration as statically typed Kotlin objects. - """ + """ .trimIndent() ) } diff --git a/pkl-commons-cli/pkl-commons-cli.gradle.kts b/pkl-commons-cli/pkl-commons-cli.gradle.kts index c033383d..c3a9f19a 100644 --- a/pkl-commons-cli/pkl-commons-cli.gradle.kts +++ b/pkl-commons-cli/pkl-commons-cli.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +14,9 @@ * limitations under the License. */ plugins { - pklAllProjects - pklKotlinLibrary - pklPublishLibrary + id("pklAllProjects") + id("pklKotlinLibrary") + id("pklPublishLibrary") } val svmClasspath: Configuration by configurations.creating diff --git a/pkl-commons-test/pkl-commons-test.gradle.kts b/pkl-commons-test/pkl-commons-test.gradle.kts index 9f829f1f..f6f1dda9 100644 --- a/pkl-commons-test/pkl-commons-test.gradle.kts +++ b/pkl-commons-test/pkl-commons-test.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,8 +16,8 @@ import java.security.MessageDigest plugins { - pklAllProjects - pklKotlinLibrary + id("pklAllProjects") + id("pklKotlinLibrary") } // note: no need to publish this library diff --git a/pkl-commons/pkl-commons.gradle.kts b/pkl-commons/pkl-commons.gradle.kts index 8f824cdb..62120350 100644 --- a/pkl-commons/pkl-commons.gradle.kts +++ b/pkl-commons/pkl-commons.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +14,9 @@ * limitations under the License. */ plugins { - pklAllProjects - pklKotlinLibrary - pklPublishLibrary + id("pklAllProjects") + id("pklKotlinLibrary") + id("pklPublishLibrary") } publishing { diff --git a/pkl-config-java/pkl-config-java.gradle.kts b/pkl-config-java/pkl-config-java.gradle.kts index 5c1d4965..4203d303 100644 --- a/pkl-config-java/pkl-config-java.gradle.kts +++ b/pkl-config-java/pkl-config-java.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,10 @@ * limitations under the License. */ plugins { - pklAllProjects - pklJavaLibrary - pklFatJar - pklPublishLibrary + id("pklAllProjects") + id("pklJavaLibrary") + id("pklFatJar") + id("pklPublishLibrary") signing } diff --git a/pkl-config-kotlin/pkl-config-kotlin.gradle.kts b/pkl-config-kotlin/pkl-config-kotlin.gradle.kts index 803bfc87..5177fd78 100644 --- a/pkl-config-kotlin/pkl-config-kotlin.gradle.kts +++ b/pkl-config-kotlin/pkl-config-kotlin.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +14,9 @@ * limitations under the License. */ plugins { - pklAllProjects - pklKotlinLibrary - pklPublishLibrary + id("pklAllProjects") + id("pklKotlinLibrary") + id("pklPublishLibrary") } val pklConfigJava: Configuration by configurations.creating diff --git a/pkl-core/pkl-core.gradle.kts b/pkl-core/pkl-core.gradle.kts index 5df896b7..9ffbe0d2 100644 --- a/pkl-core/pkl-core.gradle.kts +++ b/pkl-core/pkl-core.gradle.kts @@ -17,10 +17,10 @@ import org.apache.tools.ant.filters.ReplaceTokens plugins { kotlin("jvm") // for `src/generator/kotlin` - pklAllProjects - pklJavaLibrary - pklPublishLibrary - pklNativeLifecycle + id("pklAllProjects") + id("pklJavaLibrary") + id("pklPublishLibrary") + id("pklNativeLifecycle") idea } diff --git a/pkl-doc/pkl-doc.gradle.kts b/pkl-doc/pkl-doc.gradle.kts index 89564352..5bc0de8e 100644 --- a/pkl-doc/pkl-doc.gradle.kts +++ b/pkl-doc/pkl-doc.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,11 +14,11 @@ * limitations under the License. */ plugins { - pklAllProjects - pklKotlinLibrary - pklJavaExecutable - pklNativeExecutable - pklHtmlValidator + id("pklAllProjects") + id("pklKotlinLibrary") + id("pklJavaExecutable") + id("pklNativeExecutable") + id("pklHtmlValidator") alias(libs.plugins.kotlinxSerialization) } diff --git a/pkl-executor/pkl-executor.gradle.kts b/pkl-executor/pkl-executor.gradle.kts index 2d6990dc..ba47f1a6 100644 --- a/pkl-executor/pkl-executor.gradle.kts +++ b/pkl-executor/pkl-executor.gradle.kts @@ -17,9 +17,9 @@ import java.nio.file.Files import java.nio.file.LinkOption plugins { - pklAllProjects - pklJavaLibrary - pklPublishLibrary + id("pklAllProjects") + id("pklJavaLibrary") + id("pklPublishLibrary") } val pklDistributionCurrent: Configuration by configurations.creating diff --git a/pkl-formatter/pkl-formatter.gradle.kts b/pkl-formatter/pkl-formatter.gradle.kts index f5ea674a..5191eb46 100644 --- a/pkl-formatter/pkl-formatter.gradle.kts +++ b/pkl-formatter/pkl-formatter.gradle.kts @@ -14,9 +14,9 @@ * limitations under the License. */ plugins { - pklAllProjects - pklJavaLibrary - pklPublishLibrary + id("pklAllProjects") + id("pklJavaLibrary") + id("pklPublishLibrary") } dependencies { diff --git a/pkl-gradle/pkl-gradle.gradle.kts b/pkl-gradle/pkl-gradle.gradle.kts index ffdb5ef4..bea7fe30 100644 --- a/pkl-gradle/pkl-gradle.gradle.kts +++ b/pkl-gradle/pkl-gradle.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,13 @@ * limitations under the License. */ plugins { - pklAllProjects - pklJavaLibrary - pklGradlePluginTest + id("pklAllProjects") + id("pklJavaLibrary") + id("pklGradlePluginTest") `java-gradle-plugin` `maven-publish` - pklPublishLibrary + id("pklPublishLibrary") signing } diff --git a/pkl-parser/pkl-parser.gradle.kts b/pkl-parser/pkl-parser.gradle.kts index 535f1abd..4a2aa43f 100644 --- a/pkl-parser/pkl-parser.gradle.kts +++ b/pkl-parser/pkl-parser.gradle.kts @@ -14,10 +14,10 @@ * limitations under the License. */ plugins { - pklAllProjects - pklJavaLibrary - pklJSpecify - pklPublishLibrary + id("pklAllProjects") + id("pklJavaLibrary") + id("pklJSpecify") + id("pklPublishLibrary") idea } diff --git a/pkl-server/pkl-server.gradle.kts b/pkl-server/pkl-server.gradle.kts index e5086d82..99e6c095 100644 --- a/pkl-server/pkl-server.gradle.kts +++ b/pkl-server/pkl-server.gradle.kts @@ -14,9 +14,9 @@ * limitations under the License. */ plugins { - pklAllProjects - pklKotlinLibrary - pklNativeLifecycle + id("pklAllProjects") + id("pklKotlinLibrary") + id("pklNativeLifecycle") } dependencies { diff --git a/pkl-tools/pkl-tools.gradle.kts b/pkl-tools/pkl-tools.gradle.kts index 514a139b..61fd0c0b 100644 --- a/pkl-tools/pkl-tools.gradle.kts +++ b/pkl-tools/pkl-tools.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ import kotlin.io.path.createDirectories import kotlin.io.path.writeText plugins { - pklAllProjects - pklFatJar + id("pklAllProjects") + id("pklFatJar") signing } diff --git a/settings.gradle.kts b/settings.gradle.kts index d883f0cf..0609beff 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -15,6 +15,8 @@ */ rootProject.name = "pkl" +includeBuild("build-logic") + include("bench") include("docs") diff --git a/stdlib/stdlib.gradle.kts b/stdlib/stdlib.gradle.kts index a6b6e148..d7cf6139 100644 --- a/stdlib/stdlib.gradle.kts +++ b/stdlib/stdlib.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved. + * Copyright © 2024-2026 Apple Inc. and the Pkl project authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,11 +14,11 @@ * limitations under the License. */ plugins { - pklAllProjects + id("pklAllProjects") base `maven-publish` - pklPublishLibrary - pklSpotlessFormat + id("pklPublishLibrary") + id("pklSpotlessFormat") signing }