Skip to content

Commit

Permalink
patch: remove extension in favor of task variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Im-Fran committed Jan 31, 2024
1 parent c18efa4 commit da1b6d9
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 47 deletions.
2 changes: 1 addition & 1 deletion SonatypeCentralUpload/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id("com.gradle.plugin-publish") version "1.2.1"
}

version = "1.0.1"
version = "1.0.2"
group = "cl.franciscosolis"

// Set up the publishing plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ class SonatypeCentralUploadPluginFunctionalTest {
rootProject.name = "SonatypeCentralUploadTest"
""".trimIndent())
buildFile.writeText("""
import cl.franciscosolis.sonatypecentralupload.SonatypeCentralUploadTask
plugins {
id("cl.franciscosolis.gradledotenv") version "1.0.1"
id("cl.franciscosolis.sonatype-central-upload")
Expand All @@ -64,7 +62,7 @@ class SonatypeCentralUploadPluginFunctionalTest {
}
}
named<SonatypeCentralUploadTask>("sonatypeCentralUpload") {
sonatypeCentralUpload {
dependsOn(named("randomTask"))
username = env["SONATYPE_USERNAME"] ?: ""
password = env["SONATYPE_PASSWORD"] ?: ""
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ import org.gradle.api.Project

class SonatypeCentralUploadPlugin: Plugin<Project> {
override fun apply(project: Project) {
val extension: SonatypeCentralUploadExtension = project.extensions.create("sonatypeCentralUpload", SonatypeCentralUploadExtension::class.java)
project.tasks.register("sonatypeCentralUpload", SonatypeCentralUploadTask::class.java) { task ->
task.username.set(extension.username)
task.password.set(extension.password)
task.signingKey.set(extension.signingKey)
task.signingKeyPassphrase.set(extension.signingKeyPassphrase)
task.publicKey.set(extension.publicKey)
task.archives.set(extension.archives)
task.pom.set(extension.pom)
}
project.tasks.register("sonatypeCentralUpload", SonatypeCentralUploadTask::class.java)
}
}

0 comments on commit da1b6d9

Please sign in to comment.