From 2770520ffac010dd6c60bb0a624fb38fce2265fa Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Mon, 4 Nov 2024 11:09:47 -0500 Subject: [PATCH] build - switch to grailsPublish --- build.gradle | 20 +++++++-- gradle.properties | 14 ++----- gradle/publishing.gradle | 89 ---------------------------------------- 3 files changed, 19 insertions(+), 104 deletions(-) delete mode 100644 gradle/publishing.gradle diff --git a/build.gradle b/build.gradle index 68300446..21a99b0b 100644 --- a/build.gradle +++ b/build.gradle @@ -7,14 +7,12 @@ buildscript { } dependencies { classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion" - classpath "io.github.gradle-nexus:publish-plugin:$gradlePublishPlugin" classpath 'com.adarshr:gradle-test-logger-plugin:4.0.0' } } plugins { id 'idea' - id 'io.github.gradle-nexus.publish-plugin' version "$gradlePublishPlugin" id "com.github.ben-manes.versions" version "0.39.0" } @@ -29,7 +27,7 @@ def publishedProjects = pluginProjects + profileProjects version projectVersion subprojects { Project project -> - group projectGroup + group "org.grails.plugins" version projectVersion ext { @@ -93,7 +91,21 @@ subprojects { Project project -> } if (project.name in publishedProjects) { - apply from: rootProject.file("gradle/publishing.gradle") + if(project.name in profileProjects) { + apply plugin:"org.grails.internal.grails-profile-publish" + } + else { + apply plugin:"org.grails.internal.grails-plugin-publish" + } + + grailsPublish { + userOrg = 'grails' + githubSlug = 'grails/grails-spring-security-rest' + license = 'Apache-2.0' + title = "Spring Security REST plugin" + desc = "Grails plugin to implement token-based, RESTful authentication using Spring Security" + developers = [alvarosanchez:"Alvaro Sanchez-Mariscal", jameskleeh:"James Kleeh", jdaugherty:"James Daugherty"] + } } } diff --git a/gradle.properties b/gradle.properties index 4c483165..0a7aaa18 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,15 +1,7 @@ -projectGroup=org.grails.plugins -projectVersion=5.0.0 +projectVersion=5.0.0-SNAPSHOT grailsVersion=6.1.1 -grailsGradlePluginVersion=6.1.1 +grailsGradlePluginVersion=6.2.1 grailsGradlePluginForProfileVersion=6.2.1 -gradlePublishPlugin=1.3.0 springSecurityCoreVersion=6.1.1 pac4jVersion=5.7.2 -jackson.version=2.15.0 - -# Publish Information -title=Spring Security REST plugin -projectDesc=Grails plugin to implement token-based, RESTful authentication using Spring Security -projectUrl=https://github.com/grails/grails-spring-security-rest -githubSlug=grails/grails-spring-security-rest \ No newline at end of file +jackson.version=2.15.0 \ No newline at end of file diff --git a/gradle/publishing.gradle b/gradle/publishing.gradle deleted file mode 100644 index 246534df..00000000 --- a/gradle/publishing.gradle +++ /dev/null @@ -1,89 +0,0 @@ -apply plugin: 'maven-publish' -apply plugin: 'signing' - -ext.set('signing.keyId', project.findProperty('signing.keyId') ?: System.getenv('SIGNING_KEY')) -ext.set('signing.password', project.findProperty('signing.password') ?: System.getenv('SIGNING_PASSPHRASE')) - -def pomInfo = { - delegate.name project.title - delegate.description project.projectDesc - delegate.url projectUrl - - delegate.licenses { - delegate.license { - delegate.name 'Apache-2.0' - delegate.url 'https://www.apache.org/licenses/LICENSE-2.0.txt' - delegate.distribution 'repo' - } - } - - delegate.scm { - delegate.url "scm:git@github.com:${githubSlug}.git" - delegate.connection "scm:git@github.com:${githubSlug}.git" - delegate.developerConnection "scm:git@github.com:${githubSlug}.git" - } - - delegate.developers { - delegate.developer { - delegate.id 'alvarosanchez' - delegate.name 'Alvaro Sanchez-Mariscal' - } - delegate.developer { - delegate.id 'jameskleeh' - delegate.name 'James Kleeh' - } - delegate.developer { - delegate.id 'jdaugherty' - delegate.name "James Daugherty" - } - } -} - -publishing { - publications { - maven(MavenPublication) { - artifactId = project.name - groupId = project.group - version = project.version - - if(!isProfile) { - from components.java - - artifact sourcesJar - artifact javadocJar - } - - pom.withXml { - def pomNode = asNode() - pomNode.children().last() + pomInfo - } - } - } - - if (isSnapshot) { - repositories { - maven { - credentials { - username = project.findProperty('artifactoryPublishUsername') ?: '' - password = project.findProperty('artifactoryPublishPassword') ?: '' - } - url = isProfile ? - uri('https://repo.grails.org/grails/libs-snapshots-local') : - uri('https://repo.grails.org/grails/plugins3-snapshots-local') - - - } - } - } -} - -afterEvaluate { - signing { - required = { isReleaseVersion && gradle.taskGraph.hasTask('publish') } - sign(publishing.publications.maven) - } -} - -tasks.withType(Sign) { - onlyIf { isReleaseVersion } -}