Skip to content

Commit

Permalink
Grails 7 - build cleanup related to grails-publish update
Browse files Browse the repository at this point in the history
  • Loading branch information
jdaugherty committed Dec 3, 2024
1 parent 8722ce0 commit 636065a
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 205 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ jobs:
id: tests
uses: gradle/gradle-build-action@v2
with:
arguments: check -Dgeb.env=chromeHeadless
arguments: check
- name: Run Build
if: github.event_name == 'push'
id: build
uses: gradle/gradle-build-action@v2
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
with:
arguments: build -Dgeb.env=chromeHeadless
arguments: build
- name: Publish Test Report
if: steps.build.outcome == 'failure' || steps.tests.outcome == 'failure'
uses: scacap/action-surefire-report@v1
Expand All @@ -45,8 +45,9 @@ jobs:
uses: gradle/gradle-build-action@v2
if: steps.build.outcome == 'success' && github.event_name == 'push'
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
MAVEN_PUBLISH_USERNAME: ${{ secrets.MAVEN_PUBLISH_USERNAME }}
MAVEN_PUBLISH_PASSWORD: ${{ secrets.MAVEN_PUBLISH_PASSWORD }}
MAVEN_PUBLISH_URL: ${{ secrets.MAVEN_PUBLISH_SNAPSHOT_URL }}
with:
arguments: -Dorg.gradle.internal.publish.checksums.insecure=true publish
- name: Build Documentation
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ jobs:
uses: gradle/gradle-build-action@v2
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_NEXUS_URL: ${{ secrets.SONATYPE_NEXUS_URL }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_PUBLISH_USERNAME }}
NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PUBLISH_PASSWORD }}
NEXUS_PUBLISH_NEXUS_URL: ${{ secrets.NEXUS_PUBLISH_RELEASE_URL }}
NEXUS_PUBLISH_STAGING_PROFILE_ID: ${{ secrets.NEXUS_PUBLISH_STAGING_PROFILE_ID }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
SECRING_FILE: ${{ secrets.SECRING_FILE }}
Expand Down Expand Up @@ -83,9 +83,10 @@ jobs:
uses: gradle/gradle-build-action@v2
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_PUBLISH_USERNAME }}
NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PUBLISH_PASSWORD }}
NEXUS_PUBLISH_NEXUS_URL: ${{ secrets.NEXUS_PUBLISH_RELEASE_URL }}
NEXUS_PUBLISH_STAGING_PROFILE_ID: ${{ secrets.NEXUS_PUBLISH_STAGING_PROFILE_ID }}
with:
arguments: |
findSonatypeStagingRepository
Expand Down
16 changes: 1 addition & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,4 @@ plugins {
id 'groovy'
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

subprojects {
configurations.configureEach {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.seleniumhq.selenium') {
details.useVersion(seleniumVersion)
}
}
}
}
compileJava.options.release = 17
3 changes: 0 additions & 3 deletions docs/src/docs/code/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ dependencies {
profile "org.grails.profiles:web"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.14.1"
runtime "com.h2database:h2"
testCompile "org.grails.plugins:geb"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
compile "org.grails.plugins:spring-security-acl:${file('../../../version.txt').text.trim()}"
}

Expand Down
17 changes: 0 additions & 17 deletions functional-test-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ buildscript {
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "org.grails.plugins:hibernate5:$gormVersion"
classpath "com.github.erdi:webdriver-binaries-gradle-plugin:3.2"
}
}

Expand All @@ -17,7 +15,6 @@ apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"com.github.erdi.webdriver-binaries"
apply plugin:"org.grails.grails-gsp"

repositories {
Expand Down Expand Up @@ -52,25 +49,11 @@ dependencies {
testImplementation "org.grails:grails-gorm-testing-support"
testImplementation "org.grails:grails-web-testing-support"
integrationTestImplementation testFixtures('org.grails.plugins:geb')

testRuntimeOnly "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion"
testRuntimeOnly "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"
testRuntimeOnly "org.seleniumhq.selenium:selenium-safari-driver:$seleniumVersion"
testImplementation "org.seleniumhq.selenium:selenium-remote-driver:$seleniumVersion"
testImplementation "org.seleniumhq.selenium:selenium-api:$seleniumVersion"
implementation project(':spring-security-acl')
}

tasks.withType(Test) {
useJUnitPlatform()
systemProperty "geb.env", System.getProperty('geb.env')
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
if (System.getenv('CHROMEWEBDRIVER')) {
systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver"
}
if (System.getenv('GECKOWEBDRIVER')) {
systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver"
}

beforeTest { descriptor -> logger.quiet " -- $descriptor" }
testLogging {
Expand Down

This file was deleted.

7 changes: 1 addition & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
projectVersion=5.0.0-SNAPSHOT
grailsVersion=7.0.0-SNAPSHOT
grailsGradlePluginVersion=7.0.0-SNAPSHOT
gormVersion=9.0.0-SNAPSHOT
springSecurityVersion=6.3.4
springSecurityCoreVersion=7.0.0-SNAPSHOT
jakartaServletApiVersion=6.0.0
hibernateCoreVersion=5.6.15.Final
ehcacheVersion=3.10.8
seleniumVersion=4.26.0
projectDesc=Adds Spring Security ACL support to a Grails application.
developers=Burt Beckwith
websiteUrl=http://grails-plugins.github.io/grails-spring-security-acl/
issueTrackerUrl=https://github.com/grails-plugins/grails-spring-security-acl/issues
vcsUrl=https://github.com/grails-plugins/grails-spring-security-acl
githubSlug=grails-plugins/grails-spring-security-acl
121 changes: 9 additions & 112 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,51 +1,25 @@
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://repo.grails.org/grails/core" }
gradlePluginPortal()
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "io.github.gradle-nexus:publish-plugin:1.3.0"
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
}
}

plugins {
id 'maven-publish'
id 'groovy'
id 'java-library'
id 'signing'
}

version projectVersion
group "org.grails.plugins"

ext {
isSnapshot = project.projectVersion.endsWith('-SNAPSHOT')
isReleaseVersion = !isSnapshot
}

apply plugin: 'org.grails.grails-plugin'
apply plugin: 'org.grails.grails-gsp'

if (isReleaseVersion) {
apply plugin: 'io.github.gradle-nexus.publish-plugin'

nexusPublishing {
repositories {
sonatype {
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : ''
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : ''
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.hasProperty("sonatypeOssStagingProfileId") ? project.sonatypeOssStagingProfileId : ''
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
username = ossUser
password = ossPass
stagingProfileId = ossStagingProfileId
}
}
}
}
apply plugin: 'org.grails.grails-publish'

repositories {
mavenLocal()
Expand Down Expand Up @@ -86,89 +60,12 @@ dependencies {
api "org.springframework.security:spring-security-acl:$springSecurityVersion"
}

ext."signing.keyId" = project.hasProperty("signing.keyId") ? project.getProperty('signing.keyId') : System.getenv('SIGNING_KEY')
ext."signing.secretKeyRingFile" = project.hasProperty("signing.secretKeyRingFile") ? project.getProperty('signing.secretKeyRingFile') : "${System.properties['user.home']}${File.separator}.gnupg${File.separator}secring.gpg"
ext."signing.password" = project.hasProperty("signing.password") ? project.getProperty('signing.password') : System.getenv('SIGNING_PASSPHRASE')
ext.pomInfo = {
delegate.name "Grails Spring Security ACL Plugin"
delegate.description project.projectDesc
delegate.url project.hasProperty('websiteUrl') ? project.websiteUrl : "http://grails-plugins.github.io/grails-spring-security-acl/"

delegate.licenses {
delegate.license {
delegate.name 'The Apache Software License, Version 2.0'
delegate.url 'https://www.apache.org/licenses/LICENSE-2.0.txt'
delegate.distribution 'repo'
}
}

delegate.scm {
delegate.url project.hasProperty('vcsUrl') ? project.vcsUrl : "https://github.com/grails-plugins/grails-spring-security-acl"
delegate.connection "scm:git@github.com:${githubSlug}.git"
delegate.developerConnection "scm:git@github.com:${githubSlug}.git"
}

delegate.issueManagement {
delegate.url project.issueTrackerUrl
delegate.system 'GitHub'
}

if (developers) {
delegate.developers {
for (dev in developers.split(',')) {
delegate.developer {
delegate.id dev.toLowerCase().replace(' ', '')
delegate.name dev
}
}
}
}
}

publishing {
if (isSnapshot) {
repositories {
maven {
credentials {
username = System.getenv("ARTIFACTORY_USERNAME") ?: project.hasProperty("artifactoryPublishUsername") ? project.artifactoryPublishUsername : ''
password = System.getenv("ARTIFACTORY_PASSWORD") ?: project.hasProperty("artifactoryPublishPassword") ? project.artifactoryPublishPassword : ''
}
url "https://repo.grails.org/grails/plugins3-snapshots-local"
}
}
grailsPublish {
license {
name = 'Apache-2.0'
}

publications {
maven(MavenPublication) {
groupId = project.group
artifactId project.name
version = project.version

from components.java

artifact sourcesJar
artifact javadocJar
artifact source: "${buildDir}/classes/groovy/main/META-INF/grails-plugin.xml",
classifier: "plugin",
extension: 'xml'

pom.withXml {
def xml = asNode()

xml.children().last() + pomInfo
// dependency management shouldn't be included
def n = xml.get("dependencyManagement")
if (n)
xml.remove(n)
}
}
}
}

signing {
sign publishing.publications.maven
}

tasks.withType(Sign) {
onlyIf { isReleaseVersion }
githubSlug = 'grails/grails-spring-security-acl'
title = 'Grails Spring Security ACL Plugin'
desc = project.projectDesc
developers = ['burtbeckwith': 'Burt Beckwith']
}

0 comments on commit 636065a

Please sign in to comment.