Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 32 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ buildscript {
classpath "org.grails.plugins:views-gradle:2.1.1"
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.6.1'
classpath "gradle.plugin.com.energizedwork.webdriver-binaries:webdriver-binaries-gradle-plugin:$webdriverBinariesVersion"
classpath "org.gradle:test-retry-gradle-plugin:1.3.1"
}
}

Expand Down Expand Up @@ -51,7 +52,7 @@ if (isReleaseVersion) {
}
}

subprojects { subproject ->
subprojects { Project subproject ->

repositories {
maven { url "https://repo.grails.org/grails/core" }
Expand Down Expand Up @@ -82,11 +83,16 @@ subprojects { subproject ->
ext['gorm.version'] = gormVersion

if(subproject.name.startsWith("examples-grails")) {
apply plugin:"org.grails.grails-web"
apply plugin:"org.grails.grails-gsp"

if (subproject.name != "examples-grails-data-service") {
apply plugin:"org.grails.grails-web"
apply plugin:"org.grails.grails-gsp"
apply plugin:"com.energizedwork.webdriver-binaries"
}
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->

configurations.all { Configuration configuration->
configuration.resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if(details.requested.group == 'org.codehaus.groovy' && details.requested.name.startsWith('groovy')) {
details.useVersion(groovyVersion)
}
Expand All @@ -104,12 +110,14 @@ subprojects { subproject ->
details.requested.name != 'grails-datastore-gorm-hibernate5') {
details.useVersion(gormVersion)
}
if (details.requested.group == "io.micronaut") {
details.useVersion(micronautVersion)
}
if (details.requested.group == "io.micronaut.spring") {
details.useVersion(micronautSpringVersion)
}
}
}
boolean usesGeb = subproject.name.contains('examples-grails')
if (usesGeb) {
apply plugin:"com.energizedwork.webdriver-binaries"
}

dependencies {
testImplementation "io.projectreactor:reactor-test:3.4.12"
Expand Down Expand Up @@ -170,14 +178,6 @@ subprojects { subproject ->
documentation.extendsFrom(compileClasspath)
}

// Uncomment below code to force refresh dependencies
/*configurations.all {
resolutionStrategy {
cacheDynamicVersionsFor 0, 'hours'
cacheChangingModulesFor 0, 'hours'
}
}*/

if(isPluginProject) {
group "org.grails.plugins"
version project.rootProject.version
Expand Down Expand Up @@ -206,6 +206,7 @@ subprojects { subproject ->
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: "org.gradle.test-retry"

sourceCompatibility = "1.8"
targetCompatibility = "1.8"
Expand All @@ -226,7 +227,20 @@ subprojects { subproject ->

apply from: "${rootProject.projectDir}/gradle/testVerbose.gradle"

groovydoc.classpath += configurations.documentation
tasks.withType(Test) {
configure {
retry {
maxRetries = 2
maxFailures = 20
failOnPassedAfterRetry = true
filter {
excludeClasses.add("*GroovyChangeLogSpec")
}
}
}
}

groovydoc.classpath = configurations.documentation

publishing {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package example

import datasources.Application
import grails.core.GrailsApplication
import grails.gorm.transactions.Rollback
import grails.testing.mixin.integration.Integration
import grails.util.GrailsWebMockUtil
Expand All @@ -18,8 +19,13 @@ class DatabasePerTenantIntegrationSpec extends Specification {
BookService bookService
AnotherBookService anotherBookService
GrailsWebRequest webRequest
GrailsApplication grailsApplication

def setup() {
//To register MimeTypes
if (grailsApplication.mainContext.parent) {
grailsApplication.mainContext.getBean("mimeTypesHolder")
}
webRequest = GrailsWebMockUtil.bindMockWebRequest()
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package example

import datasources.Application
import grails.core.GrailsApplication
import grails.gorm.transactions.Rollback
import grails.testing.mixin.integration.Integration
import grails.util.GrailsWebMockUtil
Expand All @@ -18,8 +19,13 @@ class PartitionedMultiTenancyIntegrationSpec extends Specification {
BookService bookService
AnotherBookService anotherBookService
GrailsWebRequest webRequest
GrailsApplication grailsApplication

def setup() {
//To register MimeTypes
if (grailsApplication.mainContext.parent) {
grailsApplication.mainContext.getBean("mimeTypesHolder")
}
webRequest = GrailsWebMockUtil.bindMockWebRequest()
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package example

import datasources.Application
import grails.core.GrailsApplication
import grails.gorm.transactions.Rollback
import grails.testing.mixin.integration.Integration
import grails.util.GrailsWebMockUtil
Expand All @@ -20,8 +21,13 @@ class SchemaPerTenantIntegrationSpec extends Specification {
AnotherBookService anotherBookService
GrailsWebRequest webRequest
HibernateDatastore hibernateDatastore
GrailsApplication grailsApplication

def setup() {
//To register MimeTypes
if (grailsApplication.mainContext.parent) {
grailsApplication.mainContext.getBean("mimeTypesHolder")
}
hibernateDatastore.addTenantForSchema("moreBooks")
hibernateDatastore.addTenantForSchema("evenMoreBooks")
webRequest = GrailsWebMockUtil.bindMockWebRequest()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
package example


import grails.core.GrailsApplication
import grails.gorm.transactions.Rollback
import grails.test.hibernate.HibernateSpec
import org.grails.datastore.mapping.config.Settings
import org.grails.datastore.mapping.multitenancy.exceptions.TenantNotFoundException
import org.grails.datastore.mapping.multitenancy.resolvers.SystemPropertyTenantResolver
import org.grails.testing.GrailsUnitTest

/**
* Created by graemerocher on 06/04/2017.
*/
class SchemaPerTenantSpec extends HibernateSpec {
class SchemaPerTenantSpec extends HibernateSpec implements GrailsUnitTest{

BookService bookDataService = hibernateDatastore.getService(BookService)

Expand All @@ -22,6 +25,10 @@ class SchemaPerTenantSpec extends HibernateSpec {
}

def setup() {
//To register MimeTypes
if (grailsApplication.mainContext.parent) {
grailsApplication.mainContext.getBean("mimeTypesHolder")
}
hibernateDatastore.addTenantForSchema("moreBooks")
hibernateDatastore.addTenantForSchema("evenMoreBooks")
}
Expand Down
7 changes: 5 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jansiVersion=2.4.0
javaParserCoreVersion=3.23.0
jaxbVersion=2.3.1
junitJupiterVersion=5.8.2
micronautVersion=3.2.0
micronautSpringVersion=4.0.1
picocliVersion=4.6.2
projectVersion=7.1.1-SNAPSHOT
pluginGrailsVersion=5.0.0
Expand All @@ -29,10 +31,11 @@ webdriverBinariesVersion=1.4

# Following are used only for example projects
fieldsVersion=3.0.0.RC1
grailsVersion=5.1.0-SNAPSHOT
grailsVersion=5.0.3-SNAPSHOT
micrometer.version=1.8.0
scaffoldingVersion=4.0.0.RC1
testingSupportVersion=2.2.1-SNAPSHOT
testingSupportVersion=2.3.0-SNAPSHOT
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.daemon=true
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1536M -XX:MaxMetaspaceSize=512M
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ project(":examples-standalone-hibernate5").projectDir = new File(settingsDir, "e
include "examples-spring-boot-hibernate5"
project(":examples-spring-boot-hibernate5").projectDir = new File(settingsDir, "examples/spring-boot-hibernate5")

include "examples-test-data-service"
project(":examples-test-data-service").projectDir = new File(settingsDir, "examples/test-data-service")
include "examples-grails-data-service"
project(":examples-grails-data-service").projectDir = new File(settingsDir, "examples/grails-data-service")


findProject(':boot-plugin').name = 'gorm-hibernate5-spring-boot'
Expand Down