Skip to content

Commit

Permalink
Integrate async project
Browse files Browse the repository at this point in the history
- docs are moved to grails-doc repo
- old async github workflows & associated config removed
- async & events split into separate directories
- shared example project now lives in grails-test-examples
- remove test and example projects from the bom
- fix async / events in the bom now that they're in grails-core
- change the build action to not fail fast so we can identify which version of java is failing
  • Loading branch information
jdaugherty committed Jan 8, 2025
1 parent 26a61c7 commit 5c4ceb8
Show file tree
Hide file tree
Showing 264 changed files with 306 additions and 6,184 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
permissions:
contents: read # to fetch code (actions/checkout)
strategy:
fail-fast: false
matrix:
java: [17, 21, 23]
os: [ubuntu-latest, windows-latest, macos-latest]
Expand All @@ -53,7 +54,7 @@ jobs:
env:
DEVELOCITY_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
run: ./gradlew build assemble groovydoc
run: ./gradlew build assemble groovydoc --continue
publish:
if: github.event_name == 'push' && needs.skip_check.outputs.found_skip_publish != 'true'
needs: build
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ classes
*.log
*.ipr
*.iml
*.db
*.iws
*.hprof
idea
Expand All @@ -23,7 +24,7 @@ stacktrace.log
/dist
/idea-target
target
/build
build
/grails.iws
.gradle
.DS_Store
Expand Down
70 changes: 39 additions & 31 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,19 @@ apply from: "gradle/idea.gradle"
subprojects { subproject ->

version = grailsVersion
group = "org.grails"

ext.isTestSuite = subproject.name.startsWith("grails-test-suite")
ext.isCiBuild = subproject.hasProperty("isCiBuild") || System.getenv().get("CI") as Boolean
ext.isTestSuite = subproject.name.startsWith('grails-test-suite')
ext.isExample = subproject.name.contains('grails-test-examples')
ext.isPlugin = subproject.name in ['grails-async-plugin', 'grails-events-plugin']
ext.isCiBuild = subproject.hasProperty('isCiBuild') || System.getenv().get('CI') as Boolean
ext.isAsyncProject = subproject.name.startsWith('grails-async') || subproject.name.startsWith('grails-events')

if (isPlugin) {
group = 'org.grails.plugins'
} else {
group = 'org.grails'
}

ext.pomInfo = {
delegate.name 'Grails® framework'
delegate.description 'Grails Web Application Framework'
Expand All @@ -196,7 +205,6 @@ subprojects { subproject ->
delegate.email 'grails-build@users.noreply.github.com'
}
}

}

if (subproject.name != 'grails-bom') {
Expand All @@ -207,7 +215,7 @@ subprojects { subproject ->
apply plugin: 'project-report'
}

if (!isTestSuite) {
if (!isTestSuite && !isExample) {

apply plugin: 'maven-publish'
apply plugin: 'signing'
Expand Down Expand Up @@ -248,36 +256,36 @@ subprojects { subproject ->

publications {
maven(MavenPublication) {
pom {
name = 'Grails® framework'
description = 'Grails Web Application Framework'
url = 'https://grails.org/'

licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
// Historically async mapped the core libraries to different artifact ids
Map mappedArtifactIds = [
'grails-async-core' : 'grails-async',
'grails-async-plugin' : 'async',
'grails-events-core' : 'grails-events',
'grails-events-plugin': 'events'

]
if(mappedArtifactIds.containsKey(subproject.name)) {
artifactId = mappedArtifactIds[subproject.name]
}

scm {
url = 'scm:git@github.com:grails/grails-core.git'
connection = 'scm:git@github.com:grails/grails-core.git'
developerConnection = 'scm:git@github.com:grails/grails-core.git'
}
pom.withXml {
def pomNode = asNode()
pomNode.children().last() + pomInfo

developers {
developer {
id = 'graemerocher'
name = 'Graeme Rocher'
email = 'grails-build@users.noreply.github.com'
}
}
// dependency management shouldn't be included
try { pomNode.dependencyManagement.replaceNode({}) } catch (Throwable ignore) {}
}

if (subproject.name != 'grails-bom') {
from components.java
}

if(isAsyncProject) {
versionMapping {
usage('java-api') { fromResolutionOf('runtimeClasspath') }
usage('java-runtime') { fromResolutionResult() }
}
}
}
}
}
Expand All @@ -301,10 +309,10 @@ subprojects { subproject ->
}
}

if (subproject.name in ['grails-dependencies', 'grails-bom']) return
if (subproject.name in ['grails-dependencies', 'grails-bom'] || isExample) return

dependencies {
api platform(project(':grails-bom'))
implementation platform(project(':grails-bom'))
}

if (subproject.name =~ /^(grails-web|grails-plugin-|grails-test-suite|grails-test)/) {
Expand Down
12 changes: 0 additions & 12 deletions dependabot/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,6 @@ dependencies {
api "org.webjars.npm:bootstrap-icons:${project['bootstrap-icons.version']}"
api "org.webjars.npm:jquery:${project['jquery.version']}"
api "org.gebish:geb-spock:${project['geb-spock.version']}"
api "org.grails.plugins:async:${project['grails-async.version']}"
api "org.grails.plugins:events:${project['grails-async.version']}"
api "org.grails:grails-async:${project['grails-async.version']}"
api "org.grails:grails-async-gpars:${project['grails-async.version']}"
api "org.grails:grails-async-rxjava:${project['grails-async.version']}"
api "org.grails:grails-async-rxjava2:${project['grails-async.version']}"
api "org.grails:grails-events-gpars:${project['grails-async.version']}"
api "org.grails:grails-events-rxjava:${project['grails-async.version']}"
api "org.grails:grails-events-rxjava2:${project['grails-async.version']}"
api "org.grails:grails-events-compat:${project['grails-async.version']}"
api "org.grails:grails-events-spring:${project['grails-async.version']}"
api "org.grails:grails-events-transform:${project['grails-async.version']}"
api "org.grails:grails-datastore-gorm-hibernate5:${project['grails-datastore-gorm-hibernate5.version']}"
api "org.grails:grails-datastore-gorm-mongodb:${project['grails-datastore-gorm-mongodb.version']}"
api "org.grails:grails-datastore-async:${project['grails-datastore.version']}"
Expand Down
12 changes: 9 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ plexusComponentApiVersion=1.0-alpha-33
plexusSecDispatcherVersion=1.4
plexusSisuInjectVersion=2.6.0
slf4jVersion=2.0.16
rxJava1Version=1.3.8
rxJava2Version=2.2.21
gparsVersion=1.2.1

org.gradle.caching=true
org.gradle.parallel=true
Expand All @@ -25,22 +28,25 @@ org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1536M -XX:MaxMetaspaceSize=1024M
# snapshot or documentation publishes.
preventSnapshotPublish=false

# Generated on Mon Dec 23 19:03:18 EST 2024 by: ./gradlew :grails-bom:syncProps
# This prevents the Grails Gradle Plugin from unnecessarily excluding slf4j-simple in the generated POMs
# https://github.com/grails/grails-gradle-plugin/issues/222
slf4jPreventExclusion=true

# Generated on Tue Jan 07 15:14:48 EST 2025 by: ./gradlew :grails-bom:syncProps
# Only version value modifications allowed after this point. Do not insert or change version names.
ant.version=1.10.15
asciidoctorj.version=3.0.0
asset-pipeline-gradle.version=5.0.5
asset-pipeline-grails.version=5.0.5
byte-buddy.version=1.15.5
bootstrap.version=5.3.3
bootstrap-icons.version=1.11.3
byte-buddy.version=1.15.5
commons-codec.version=1.17.1
commons-text.version=1.12.0
converters.version=6.0.0-SNAPSHOT
directory-watcher.version=0.18.0
flying-saucer-pdf-openpdf.version=9.4.0
geb-spock.version=7.0
grails-async.version=6.0.0-SNAPSHOT
grails-datastore.version=9.0.0-SNAPSHOT
grails-datastore-gorm-hibernate5.version=9.0.0-SNAPSHOT
grails-datastore-gorm-mongodb.version=9.0.0-SNAPSHOT
Expand Down
5 changes: 3 additions & 2 deletions gradle/assemble.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ tasks.register('sourcesJars', Sync) {
from rootProject.subprojects.findAll { subproject ->
!subproject.name.startsWith('grails-test-suite') &&
!subproject.name.startsWith('grails-dependencies') &&
!subproject.name.startsWith('grails-bom')
!subproject.name.startsWith('grails-bom') &&
!subproject.name.contains('grails-test-examples')
}.sourcesJar*.outputs*.files
// sourcesFor comes from GrailsBuildPlugin
from {
Expand Down Expand Up @@ -149,7 +150,7 @@ class GrailsCreateStartScripts extends CreateStartScripts {
tasks.register('install') { task ->
dependsOn 'populateDependencies', 'grailsCreateStartScripts'
subprojects { Project project ->
if(!project.name.startsWith('grails-test-suite')) {
if(!project.name.startsWith('grails-test-suite') && !project.name.startsWith('grails-test-examples')) {
task.dependsOn("$project.name:publishToMavenLocal")
}
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/docs.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ tasks.register('docs') {
}

task javadoc(type:Javadoc, group: 'documentation') {
def subs = subprojects.findAll { it.name != 'grails-dependencies' && it.name != 'grails-bom' }
def subs = subprojects.findAll { it.name != 'grails-dependencies' && it.name != 'grails-bom' && !it.name.startsWith('grails-test-suite') && !it.name.contains('grails-test-examples') }
classpath = files(subs.configurations.compileClasspath)
dependsOn stubs
maxMemory = '256M'
Expand All @@ -94,7 +94,7 @@ task javadoc(type:Javadoc, group: 'documentation') {
tasks.register('groovydoc', Groovydoc) {
final Set<Project> subProjects = subprojects.findAll {
!(it.name in ['grails-dependencies', 'grails-bom', 'grails-bootstrap', 'grails-gradle-model', 'grails-shell'])
&& !it.name.startsWith("grails-test-suite") }
&& !it.name.startsWith('grails-test-suite') && !it.name.contains('grails-test-examples') }
def groovydocClasspath = files(configurations.documentation + subProjects.configurations.compileClasspath)
// exclude problematic jar file from javadoc classpath
// http://www.adam-bien.com/roller/abien/entry/trouble_with_crippled_java_ee
Expand Down
4 changes: 2 additions & 2 deletions gradle/idea.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import groovy.xml.XmlParser

idea {
project {
jdkName "1.7"
languageLevel "1.7"
jdkName "17"
languageLevel "17"
ipr {
withXml { provider ->
def node = provider.asNode()
Expand Down
13 changes: 0 additions & 13 deletions grails-async/.github/dependabot.yml

This file was deleted.

Loading

0 comments on commit 5c4ceb8

Please sign in to comment.