Skip to content

Commit

Permalink
Grails 7: further work and get tests working
Browse files Browse the repository at this point in the history
  • Loading branch information
bkoehm committed Nov 20, 2024
1 parent 1e03dd7 commit 775f614
Show file tree
Hide file tree
Showing 27 changed files with 332 additions and 531 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Java CI
on:
push:
branches:
- '[5-9]+.[0-9]+.x'
pull_request:
branches:
- '[5-9]+.[0-9]+.x'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
WORKSPACE: ${{ github.workspace }}
GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Run Tests
if: github.event_name == 'pull_request'
id: tests
uses: gradle/gradle-build-action@v2
with:
arguments: check -Dgeb.env=chromeHeadless
- 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
- name: Publish Test Report
if: steps.build.outcome == 'failure' || steps.tests.outcome == 'failure'
uses: scacap/action-surefire-report@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: Publish to repo.grails.org
id: publish
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 }}
with:
arguments: -Dorg.gradle.internal.publish.checksums.insecure=true publish
- name: Build Documentation
id: docs
uses: gradle/gradle-build-action@v2
with:
arguments: docs:docs
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[![Build Status](https://travis-ci.org/grails-plugins/grails-spring-security-acl.svg?branch=master)

Grails Spring Security ACL Plugin
==================================

Expand Down
6 changes: 2 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
subprojects {
configurations.configureEach {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if ((details.requested.group == 'org.codehaus.groovy' || details.requested.group == 'org.apache.groovy') && details.requested.name != 'groovy-bom') {
String groovyVersion = findProperty('groovyVersion') ?: libs.versions.groovy.get()
details.useTarget(group: 'org.apache.groovy', name: details.requested.name, version: groovyVersion)
details.because "The dependency coordinates are changed in Apache Groovy 4, plus ensure version"
if (details.requested.group == 'org.seleniumhq.selenium') {
details.useVersion(seleniumVersion)
}
}
}
Expand Down
69 changes: 53 additions & 16 deletions docs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ buildscript {
maven { url 'https://repo.grails.org/grails/core' }
}
dependencies {
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.6.1'
classpath 'org.asciidoctor:asciidoctorj-epub3:2.1.3'
classpath 'org.asciidoctor:asciidoctorj-pdf:2.3.18'
classpath 'org.asciidoctor:asciidoctor-gradle-jvm:4.0.3'
classpath "org.asciidoctor:asciidoctor-gradle-jvm-epub:4.0.3"
classpath "org.asciidoctor:asciidoctor-gradle-jvm-pdf:4.0.3"
classpath "org.asciidoctor:asciidoctor-gradle-jvm-gems:4.0.3"
}
}

import org.apache.tools.ant.taskdefs.condition.Os
apply plugin: 'org.asciidoctor.convert'
apply plugin: "org.asciidoctor.jvm.gems"
apply plugin: 'org.asciidoctor.jvm.convert'
apply plugin: "org.asciidoctor.jvm.pdf"
apply plugin: "org.asciidoctor.jvm.epub"

def asciidoctorAttributes = [
copyright : 'Apache License, Version 2.0',
Expand All @@ -34,28 +37,62 @@ def asciidoctorAttributes = [
projectVersion : project.projectVersion,
]

repositories {
mavenCentral()
maven { url 'https://repo.grails.org/grails/core' }
ruby.gems()
}

import org.apache.tools.ant.taskdefs.condition.Os
import org.asciidoctor.gradle.AsciidoctorTask
dependencies {
asciidoctorGems 'rubygems:rouge:4.4.0'
}

tasks.withType(AsciidoctorTask) {
asciidoctor {
sourceDir file('src/docs')
sources {
include 'index.adoc'
}
outputDir = new File(buildDir, 'docs')
attributes asciidoctorAttributes
outputDir new File(buildDir, 'docs')
separateOutputDirs = false
}

asciidoctorPdf {
dependsOn asciidoctorGemsPrepare
sourceDir = file('src/docs')
sources {
include 'index.adoc'
}
outputDir = new File(buildDir, 'docs')

asciidoctorj {
requires 'rouge'
attributes asciidoctorAttributes
}
}

asciidoctorEpub {
dependsOn asciidoctorGemsPrepare
sourceDir = file('src/docs')
sources {
include 'index.adoc'
}
outputDir = new File(buildDir, 'docs')

task asciidoc(type: AsciidoctorTask, description: 'Generates single-page HTML, PDF, and EPUB3') {
group 'documentation'
backends 'html5', 'pdf', 'epub3'
asciidoctorj {
requires 'rouge'
attributes asciidoctorAttributes
}

ebookFormats = ["EPUB3"]
}

tasks.named("asciidoctor").configure {
dependsOn = ['asciidoctorPdf', 'asciidoctorEpub']
}

task docs(dependsOn: [asciidoc]) {
group 'documentation'
tasks.register("docs") {
group = "documentation"
dependsOn = ["asciidoctor"]
doLast {
File dir = new File(buildDir, 'docs')
['epub', 'pdf'].each { String ext ->
Expand All @@ -73,4 +110,4 @@ task docs(dependsOn: [asciidoc]) {
include '**/*.png'
}
}
}
}
19 changes: 10 additions & 9 deletions docs/src/docs/index.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
:includedir: src/docs/
= Spring Security ACL Plugin - Reference Documentation
Burt Beckwith

Expand All @@ -8,20 +9,20 @@ Burt Beckwith
:toclevels: 2
:numbered:

include::introduction.adoc[]
include::{includedir}introduction.adoc[]

include::installing.adoc[]
include::{includedir}installing.adoc[]

include::usage.adoc[]
include::{includedir}usage.adoc[]

include::tutorial.adoc[]
include::{includedir}tutorial.adoc[]

include::sampleApp.adoc[]
include::{includedir}sampleApp.adoc[]

include::AclUtilService.adoc[]
include::{includedir}AclUtilService.adoc[]

include::Scripts.adoc[]
include::{includedir}Scripts.adoc[]

include::TagLibraries.adoc[]
include::{includedir}TagLibraries.adoc[]

include::history.adoc[]
include::{includedir}history.adoc[]
32 changes: 17 additions & 15 deletions functional-test-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:5.0.1"
classpath "org.grails.plugins:hibernate5:$gormVersion"
classpath "gradle.plugin.com.github.erdi.webdriver-binaries:webdriver-binaries-gradle-plugin:2.7"
classpath "com.github.erdi:webdriver-binaries-gradle-plugin:3.2"
}
}

Expand Down Expand Up @@ -41,12 +41,11 @@ dependencies {
implementation "org.grails:grails-plugin-url-mappings"
implementation "org.grails:grails-plugin-interceptors"
implementation "org.grails:grails-web-boot"
implementation "org.grails.plugins:cache"
implementation "org.grails.plugins:async"
implementation "org.grails.plugins:scaffolding"
implementation "org.grails.plugins:events"
implementation "org.grails.plugins:hibernate5"
implementation "org.hibernate:hibernate-core:$hibernateCoreVersion"
implementation "org.hibernate:hibernate-core-jakarta:$hibernateCoreVersion"
implementation "org.grails.plugins:gsp"
console "org.grails:grails-console"
profile "org.grails.profiles:web"
Expand All @@ -55,24 +54,27 @@ dependencies {
runtimeOnly "com.h2database:h2"
testImplementation "org.grails:grails-gorm-testing-support"
testImplementation "org.grails:grails-web-testing-support"
testImplementation "io.micronaut:micronaut-http-client:$micronautVersion"
testImplementation "org.grails.plugins:geb"
testRuntimeOnly "org.seleniumhq.selenium:selenium-chrome-driver:4.19.1"
testImplementation "org.seleniumhq.selenium:selenium-remote-driver:4.19.1"
testImplementation "org.seleniumhq.selenium:selenium-api:4.19.1"
implementation project(':spring-security-acl')
}
integrationTestImplementation testFixtures('org.grails.plugins:geb')

webdriverBinaries {
chromedriver '2.46.0'
geckodriver '0.29.1'
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 "webdriver.chrome.driver", System.getProperty('webdriver.chrome.driver')
systemProperty "webdriver.gecko.driver", System.getProperty('webdriver.gecko.driver')
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 {
events "passed", "skipped", "failed"
Expand Down
Loading

0 comments on commit 775f614

Please sign in to comment.