diff --git a/sandbox/README.md b/sandbox/README.md index 93913763..4f1ee93a 100644 --- a/sandbox/README.md +++ b/sandbox/README.md @@ -13,3 +13,7 @@ Try running `./gradlew :gradle-sign-file:signFile`. The output will be put into `gradle-sign-file/build/sigstore/signFile` + +* [Precompiled plugin](gradle-precompiled-plugin) + Shows the way `dev.sigstore.sign` can be a part of a + [precompiled script plugin](https://docs.gradle.org/current/userguide/custom_plugins.html#sec:precompiled_plugins). diff --git a/sandbox/gradle-precompiled-plugin/build.gradle.kts b/sandbox/gradle-precompiled-plugin/build.gradle.kts new file mode 100644 index 00000000..99d95d2b --- /dev/null +++ b/sandbox/gradle-precompiled-plugin/build.gradle.kts @@ -0,0 +1,14 @@ +plugins { + `kotlin-dsl` +} + +repositories { + gradlePluginPortal() +} + +dependencies { + // dev.sigstore.sign:dev.sigsore.sign.gradle.plugin is preferable, + // however Gradle does not recognize .gradle.plugin within included build, + // so we use the fallback + implementation("dev.sigstore:sigstore-gradle-sign-plugin") +} diff --git a/sandbox/gradle-precompiled-plugin/src/main/kotlin/sigstore-conventions.gradle.kts b/sandbox/gradle-precompiled-plugin/src/main/kotlin/sigstore-conventions.gradle.kts new file mode 100644 index 00000000..f18f2d8e --- /dev/null +++ b/sandbox/gradle-precompiled-plugin/src/main/kotlin/sigstore-conventions.gradle.kts @@ -0,0 +1,9 @@ +plugins { + id("dev.sigstore.sign") +} + +sigstoreSign { + oidcClient { + gitHub() + } +} diff --git a/sandbox/settings.gradle.kts b/sandbox/settings.gradle.kts index 49aadc53..2e87a5d8 100644 --- a/sandbox/settings.gradle.kts +++ b/sandbox/settings.gradle.kts @@ -2,6 +2,7 @@ rootProject.name = "sigstore-sandbox" include("gradle-sign-file") include("gradle-sign-java-library") +include("gradle-precompiled-plugin") // Include dev.sigstore.sign plugin includeBuild("../") diff --git a/sigstore-gradle/sigstore-gradle-sign-plugin/build.gradle.kts b/sigstore-gradle/sigstore-gradle-sign-plugin/build.gradle.kts index 2696c785..825a3073 100644 --- a/sigstore-gradle/sigstore-gradle-sign-plugin/build.gradle.kts +++ b/sigstore-gradle/sigstore-gradle-sign-plugin/build.gradle.kts @@ -6,7 +6,7 @@ plugins { description = "Gradle plugin to that automatically signs all Publications in Sigstore" dependencies { - implementation(project(":sigstore-gradle:sigstore-gradle-sign-base-plugin")) + api(project(":sigstore-gradle:sigstore-gradle-sign-base-plugin")) testImplementation(project(":sigstore-testkit")) }