From a92494412ffd12b60a9ac8466113098323272e28 Mon Sep 17 00:00:00 2001 From: zml Date: Sat, 15 Oct 2022 17:56:33 -0700 Subject: [PATCH] chore: Update readme for new plugin modules --- README.md | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ce5e2aa..ef68259 100644 --- a/README.md +++ b/README.md @@ -46,4 +46,66 @@ sponge { // [...] -``` \ No newline at end of file +``` + +## [`org.spongepowered.gradle.ore`](https://plugins.gradle.org/plugin/org.spongepowered.gradle.ore) + +A plugin to deploy artifacts to the [Ore](https://ore.spongepowered.org) plugin repository. + +When using SpongeGradle, this plugin is auto-configured based on the plugin configuration used. + +Multiple publications are supported for situations where a project produces multiple artifacts. + +Full DSL: + +```kotlin +oreDeployment { + oreEndpoint("https://ore.spongepowered.org/") // default + apiKey().set( + providers.gradleProperty("org.spongepowered.ore.apiToken") + .orElse(providers.environmentVariable("ORE_TOKEN")) + ) // default value + + publications { + register("default") { + // Ore project ID, taken from the first plugin created by SpongeGradle when present + projectId.set("id") + createForumPost.set(true) // default + // Contents (aka release notes) for the version + versionBody.set("") // default (empty) + // Channel + channel.set("Release") // default + // Artifact -- must be a single file + publishArtifacts.from(tasks.jar.map { it.outputs }) // default when SpongeGradle is present + } + } + + // alternatively: + defaultPublication { + // same as above + } +} +``` + +## [`org.spongepowered.gradle.repository`](https://plugins.gradle.org/plugin/org.spongepowered.gradle.repository) + +Provides a simple way to register Sponge's maven repository in a buildscript: + +```groovy +plugins { + id 'org.spongepowered.gradle.repository' version '' +} + +repositories { + sponge.releases() + sponge.snapshots() +} +``` + +This extension is applied to both the `settings` `dependencyResolutionManagement` repository section, as well as the buildscript `repositories` section. + +> **Note** +> The Kotlin stub generation for `settings.gradle.kts` files does not generate stubs for the `dependencyResolutionManagement.repositories {}` block. The extension will have to be read manually, using something like: +> ```kotlin +> val sponge = (this as ExtensionAware).extensions.getByType(org.spongepowered.gradle.repository.SpongeRepositoryExtension::class) +> ```