Skip to content

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesfredley committed Sep 8, 2024
1 parent f92918e commit 8016143
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 37 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ jobs:
FOLDER: docs/build/docs
DOC_SUB_FOLDER: mongodb
DOC_FOLDER: gh-pages
COMMIT_EMAIL: '[email protected]'
COMMIT_NAME: 'grails-build'
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }}
COMMIT_NAME: ${{ env.GIT_USER_NAME }}
VERSION: ${{ steps.release_version.outputs.release_version }}
- name: Run post-release
if: success()
Expand Down
28 changes: 8 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@ buildscript {
classpath "com.github.erdi:webdriver-binaries-gradle-plugin:3.2"
classpath "io.github.gradle-nexus:publish-plugin:1.3.0"
}

configurations.configureEach {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
// This is a workaround for dependencies exposing a different version of Groovy
// than the one used by Gradle. This causes issues with the Groovy compiler.
if (details.requested.group == 'org.apache.groovy' || details.requested.group == 'org.codehaus.groovy') {
details.useTarget(group: "org.codehaus.groovy", name: details.requested.name, version: GroovySystem.version)
details.because "Use Groovy 3.0.x library shipped with Gradle"
}
}
}
}

logger.lifecycle "GORM VERSION = ${project.datastoreVersion}"
Expand Down Expand Up @@ -83,19 +72,15 @@ allprojects {
}
}

configurations.all {
resolutionStrategy.dependencySubstitution {
substitute(module("org.codehaus.groovy:groovy-bom:3.0.8")).using(module("org.apache.groovy:groovy-bom:$groovyVersion"))
}

configurations.configureEach {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if ((details.requested.group == 'org.codehaus.groovy' || details.requested.group == 'org.apache.groovy') && details.requested.name != 'groovy-bom') {
details.useTarget(group: 'org.apache.groovy', name: details.requested.name, version: "$groovyVersion")
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 == "io.micronaut" && details.requested.name == "micronaut-inject-groovy") {
details.useVersion("4.6.1")
details.useVersion(micronautVersion)
}
}
}
Expand Down Expand Up @@ -128,10 +113,9 @@ subprojects { Project subproject ->

if (project.name == "examples-test-data-service") {
apply plugin:"org.grails.grails-web"
//apply plugin:"org.grails.plugins.views-json"
}

configurations.all {
configurations.configureEach {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if(details.requested.group == 'org.apache.groovy' && details.requested.name.startsWith('groovy')) {
details.useVersion(groovyVersion)
Expand Down Expand Up @@ -238,6 +222,10 @@ subprojects { Project subproject ->
apply plugin: 'maven-publish'
apply plugin: 'signing'

if (project.name == "examples-test-data-service") {
apply plugin:"org.grails.plugins.views-json"
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
Expand Down
2 changes: 0 additions & 2 deletions examples/grails3-hibernate5-mongodb/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
group "examples"



dependencies {
implementation "org.springframework.boot:spring-boot-starter-logging"
implementation "org.springframework.boot:spring-boot-autoconfigure"
Expand Down
9 changes: 0 additions & 9 deletions examples/grails3-mongodb-database-per-tenant/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ dependencies {
testImplementation "org.seleniumhq.selenium:selenium-support:$seleniumVersion"
}

configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if ((details.requested.group == 'org.codehaus.groovy')) {
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"
}
}
}

tasks.withType(Test) {
systemProperty "geb.env", System.getProperty('geb.env')
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
Expand Down
16 changes: 14 additions & 2 deletions examples/test-data-service/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
apply plugin: 'java'
buildscript {
repositories {
maven { url "https://repo.grails.org/grails/core" }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "org.grails.plugins:views-gradle:$grailsViewsVersion"
}
}

apply plugin: "java"

dependencies {
profile "org.grails.profiles:rest-api"
compileOnly "org.grails.plugins:views-json:$grailsViewsVersion"
compileOnly "org.grails.plugins:views-json-templates:$grailsViewsVersion"
implementation "org.springframework.boot:spring-boot-starter-logging"
implementation "org.springframework.boot:spring-boot-autoconfigure"
implementation "org.grails:grails-core:$grailsVersion"
Expand All @@ -22,7 +35,6 @@ dependencies {
implementation "org.grails.plugins:views-json-templates"
implementation 'org.grails.plugins:spring-security-core:4.0.3'
implementation 'org.grails.plugins:spring-security-rest:3.0.1'
profile "org.grails.profiles:rest-api"
testImplementation "org.grails:grails-gorm-testing-support:$testingSupportVersion"
testImplementation "org.grails:grails-web-testing-support"
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ gebPluginVersion=4.0.0
gormVersion=9.0.0-SNAPSHOT
grailsGradlePluginVersion=7.0.0-SNAPSHOT
grailsShellVersion=7.0.0-SNAPSHOT
grailsViewsVersion=3.2.3
groovyVersion=4.0.22
h2Version=1.4.200
hibernateCoreVersion=5.6.15.Final
Expand All @@ -21,6 +22,7 @@ jansiVersion=2.4.1
javaParserCoreVersion=3.25.9
junitJupiterVersion=5.9.3
junitJupiterPlatformVersion=1.9.3
micronautVersion=4.5.3
mongodbDriverVersion=5.1.4
testcontainersMongodbVersion=1.20.1
projectVersion=9.0.0-SNAPSHOT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
import org.grails.datastore.mapping.transactions.DatastoreTransactionManager;
import org.grails.datastore.mapping.transactions.TransactionCapableDatastore;
import org.grails.datastore.mapping.validation.ValidatorRegistry;
import org.grails.spring.context.support.PluginAwareResourceBundleMessageSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.context.support.StaticMessageSource;
Expand Down Expand Up @@ -574,10 +575,10 @@ public void setCodecs(List<Codec<?>> codecs) {
/**
* The message source used for validation messages
*
* @param messageSource The message source
* @param messageSource The message sources
*/
@Autowired(required = false)
public void setMessageSource(MessageSource messageSource) {
public void setMessageSource(PluginAwareResourceBundleMessageSource messageSource) {
if(messageSource != null) {
configureValidatorRegistry(connectionSources.getDefaultConnectionSource().getSettings(), (MongoMappingContext) mappingContext, messageSource);
}
Expand Down

0 comments on commit 8016143

Please sign in to comment.