Skip to content

Commit b6f961d

Browse files
Merge branch '7.0.x' into fix/docs-title-sequence
2 parents c721a4b + 6c1d3d8 commit b6f961d

File tree

62 files changed

+223
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+223
-20
lines changed

DEVELOPMENT.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,27 @@ These can be set on the command line like so:
4444
* `skipMongodbTests` - does not run mongo related tests
4545
* `skipTests` - no tests will run
4646

47+
## Test slicing
48+
49+
Test classes tagged with `@spock.lang.Tag('some-tag')` can be run separately.\
50+
Tags are inherited from superclasses, so a test class is also included if any of its ancestors is tagged.
51+
52+
Example:
53+
54+
```bash
55+
./gradlew iT -PincludeTestTags=geb
56+
```
57+
58+
Available project properties:
59+
60+
* `includeTestTags` - comma-separated list of test tags to include
61+
* `excludeTestTags` - comma-separated list of test tags to exclude
62+
63+
Example with multiple tags:
64+
65+
```bash
66+
./gradlew iT -PincludeTestTags=geb,api
67+
```
68+
4769
## Start a mongo docker container (containers will start by default)
4870
`docker run -d --name mongo-on-docker -p 27017:27017 mongo`

dependencies.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ext {
2525
'ant.version' : '1.10.15',
2626
'asciidoctor-gradle-jvm.version': '4.0.5',
2727
'asciidoctorj.version' : '3.0.0',
28-
'asset-pipeline-gradle.version' : '5.0.32',
28+
'asset-pipeline-gradle.version' : '5.0.34',
2929
'byte-buddy.version' : '1.17.7',
3030
'commons-text.version' : '1.13.1',
3131
'directory-watcher.version' : '0.19.1',
@@ -37,7 +37,7 @@ ext {
3737
'jna.version' : '5.17.0',
3838
'jquery.version' : '3.7.1',
3939
'objenesis.version' : '3.4',
40-
'spring-boot.version' : '3.5.11',
40+
'spring-boot.version' : '3.5.13',
4141
]
4242

4343
// Note: the name of the dependency must be the prefix of the property name so properties in the pom are resolved correctly
@@ -67,13 +67,13 @@ ext {
6767
]
6868

6969
bomDependencyVersions = [
70-
'asset-pipeline-bom.version' : '5.0.32',
70+
'asset-pipeline-bom.version' : '5.0.34',
7171
'bootstrap-icons.version' : '1.13.1',
7272
'bootstrap.version' : '5.3.8',
7373
'commons-codec.version' : '1.18.0',
7474
'commons-lang3.version' : '3.20.0',
7575
'geb-spock.version' : '8.0.1',
76-
'groovy.version' : '4.0.30',
76+
'groovy.version' : '4.0.31',
7777
'jackson.version' : '2.19.1',
7878
'jquery.version' : '3.7.1',
7979
'liquibase-hibernate5.version': '4.27.0',

etc/bin/verify-cli-distribution.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ echo "Checking Shell CLI ..."
9191
echo "✅ Generated Shell App"
9292

9393
echo "Checking Forge CLI ..."
94-
./grails-forge-cli create-app -x -g mongodb ForgeApp
94+
./grails-forge-cli create-app -x -g mongodb -f gradle-settings-file ForgeApp
9595
echo "✅ Generated Forge App"
9696

9797
echo "✅✅✅ All cli binary distribution checks passed successfully for Apache Grails ${VERSION}."

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
projectVersion=7.0.10-SNAPSHOT
16+
projectVersion=7.0.11-SNAPSHOT
1717

1818
javaVersion=17
1919

gradle/functional-test-config.gradle

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,20 @@ tasks.withType(Test).configureEach { Test task ->
9595
task.outputs.dir rootProject.layout.buildDirectory.dir('mongo-test-serialize')
9696
}
9797

98-
task.useJUnitPlatform()
98+
task.useJUnitPlatform {
99+
if (project.hasProperty('includeTestTags')) {
100+
// Will only run tests that are tagged with specific tags
101+
// e.g. @spock.lang.Tag('geb')
102+
// Run with: ./gradlew iT -PincludeTestTags=geb (comma-separated list)
103+
includeTags((project.property('includeTestTags') as String).split(',')*.trim() as String[])
104+
}
105+
if (project.hasProperty('excludeTestTags')) {
106+
// Will not run tests that are tagged with specific tags
107+
// e.g. @spock.lang.Tag('geb')
108+
// Run with: ./gradlew iT -PincludeTestTags=geb
109+
excludeTags((project.property('excludeTestTags') as String).split(',')*.trim() as String[])
110+
}
111+
}
99112
task.testLogging {
100113
events('passed', 'skipped', 'failed', 'standardOut', 'standardError')
101114
showExceptions = true

grails-core/src/test/groovy/grails/util/GrailsUtilTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class GrailsUtilTests {
3333

3434
@Test
3535
public void testGrailsVersion() {
36-
assertEquals("7.0.10-SNAPSHOT", GrailsUtil.getGrailsVersion());
36+
assertEquals("7.0.11-SNAPSHOT", GrailsUtil.getGrailsVersion());
3737
}
3838

3939
@AfterEach

grails-geb/src/testFixtures/groovy/grails/plugin/geb/ContainerGebSpec.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import geb.Page
2424
import geb.test.GebTestManager
2525
import spock.lang.Shared
2626
import spock.lang.Specification
27+
import spock.lang.Tag
2728

2829
import grails.plugin.geb.support.ContainerSupport
2930
import grails.plugin.geb.support.ReportingSupport
@@ -55,6 +56,8 @@ import grails.plugin.geb.support.delegate.PageDelegate
5556
* @author James Daugherty
5657
* @since 4.1
5758
*/
59+
@Tag('geb')
60+
@Tag('container-geb')
5861
@CompileStatic
5962
abstract class ContainerGebSpec extends Specification implements ContainerSupport, ReportingSupport, BrowserDelegate, PageDelegate, DriverDelegate, DownloadSupportDelegate {
6063

grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -734,9 +734,6 @@ class GrailsGradlePlugin extends GroovyPlugin {
734734
it.dependsOn(project.tasks.named('compileGroovy', GroovyCompile), project.tasks.named('classes'))
735735
it.mustRunAfter(project.tasks.named('classes'))
736736
it.mainClassCacheFile.set(mainClassFileContainer)
737-
it.outputs.upToDateWhen {
738-
mainClassFileContainer.orNull?.asFile?.exists()
739-
}
740737
}
741738

742739
project.afterEvaluate {

grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/views/gsp/GroovyPagePlugin.groovy

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class GroovyPagePlugin implements Plugin<Project> {
5555
SourceSetOutput output = mainSourceSet?.output
5656
FileCollection classesDirs = resolveClassesDirs(output, project)
5757
Provider<Directory> destDir = project.layout.buildDirectory.dir('gsp-classes/main')
58+
Provider<Directory> webappDestDir = project.layout.buildDirectory.dir('gsp-classes/webapp')
5859
output?.dir('gsp-classes')
5960

6061
FileCollection allClasspath = project.getObjects().fileCollection().from(
@@ -75,7 +76,7 @@ class GroovyPagePlugin implements Plugin<Project> {
7576
}
7677

7778
def compileWebappGroovyPages = tasks.register('compileWebappGroovyPages', GroovyPageForkCompileTask) {
78-
it.destinationDirectory.set(destDir)
79+
it.destinationDirectory.set(webappDestDir)
7980
it.source = project.layout.projectDirectory.dir('src/main/webapp')
8081
it.tmpDirPath = getTmpDirPath(project)
8182
it.serverpath.set('/')
@@ -96,14 +97,18 @@ class GroovyPagePlugin implements Plugin<Project> {
9697
war.from(destDir) { CopySpec it ->
9798
it.into('WEB-INF/classes')
9899
}
100+
war.from(webappDestDir) { CopySpec it ->
101+
it.into('WEB-INF/classes')
102+
}
99103
} else if (war.name == 'war') {
100104
war.from(destDir)
105+
war.from(webappDestDir)
101106
}
102107

103108
if (war.classpath) {
104-
war.classpath = war.classpath + project.files(destDir)
109+
war.classpath = war.classpath + project.files(destDir, webappDestDir)
105110
} else {
106-
war.classpath = project.files(destDir)
111+
war.classpath = project.files(destDir, webappDestDir)
107112
}
108113
}
109114

@@ -115,8 +120,12 @@ class GroovyPagePlugin implements Plugin<Project> {
115120
jar.from(destDir) { CopySpec it ->
116121
it.into('BOOT-INF/classes')
117122
}
123+
jar.from(webappDestDir) { CopySpec it ->
124+
it.into('BOOT-INF/classes')
125+
}
118126
} else if (jar.name == 'jar') {
119127
jar.from(destDir)
128+
jar.from(webappDestDir)
120129
}
121130
}
122131
}

grails-gradle/tasks/src/main/groovy/org/grails/gradle/plugin/run/FindMainClassTask.groovy

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,6 @@ abstract class FindMainClassTask extends DefaultTask {
9393
@TaskAction
9494
void setMainClassProperty() {
9595
File cacheFile = mainClassCacheFile.get().asFile
96-
if (cacheFile.exists()) {
97-
// the only time this task should invoke is when gradle has deemed it necessary to run, always remove the
98-
// the cache file to prevent invalid states when running tasks other than bootRun, bootJar, or bootWar
99-
cacheFile.delete()
100-
}
10196

10297
if (mainClassName.isPresent()) {
10398
def overrideClassName = mainClassName.get()

0 commit comments

Comments
 (0)