Skip to content

Commit

Permalink
Add Gradle precompiled script plugin sample
Browse files Browse the repository at this point in the history
See https://docs.gradle.org/current/userguide/custom_plugins.html#sec:precompiled_plugins

Signed-off-by: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  • Loading branch information
vlsi committed Sep 17, 2022
1 parent 8bf92a2 commit 1cf0662
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
4 changes: 4 additions & 0 deletions sandbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
14 changes: 14 additions & 0 deletions sandbox/gradle-precompiled-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugins {
id("dev.sigstore.sign")
}

sigstoreSign {
oidcClient {
gitHub()
}
}
1 change: 1 addition & 0 deletions sandbox/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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("../")
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
Expand Down

0 comments on commit 1cf0662

Please sign in to comment.