Skip to content

Commit 566f3d2

Browse files
committed
Make grace-cache-core and grace-plugin-cache works
- Add grace-cache-core and grace-plugin-cache submodules - Update Gradle build script - Add grails-plugin.xml - Add `@TagLib` to `grails-plugin.xml` - Migrate some JUnit 4 tests to JUnit 5 - Remove demo tests See gh-1209
1 parent 534255f commit 566f3d2

File tree

12 files changed

+33
-194
lines changed

12 files changed

+33
-194
lines changed

grace-cache-core/build.gradle

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
dependencies {
2-
api "org.graceframework:grace-datastore-core:$gormVersion"
3-
api "org.graceframework:grace-datastore-gorm:$gormVersion", {
2+
api project(":grace-core")
3+
api libs.spring.aop
4+
api libs.spring.context
5+
api libs.grace.datastore.core
6+
api libs.grace.datastore.gorm, {
47
exclude group: 'org.graceframework', module: 'grace-datastore-gorm-validation'
58
}
6-
api "org.graceframework:grace-core"
7-
api "org.graceframework:grace-web-gsp"
8-
api "org.springframework.boot:spring-boot-autoconfigure"
9-
annotationProcessor "org.springframework.boot:spring-boot-autoconfigure-processor"
10-
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
11-
compileOnly "jakarta.servlet:jakarta.servlet-api"
12-
compileOnly "org.graceframework:grace-boot"
139
}

grace-plugin-cache/build.gradle

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
dependencies {
2-
api "org.graceframework:grace-datastore-core:$gormVersion"
3-
api "org.graceframework:grace-datastore-gorm:$gormVersion", {
4-
exclude group: 'org.graceframework', module: 'grace-datastore-gorm-validation'
5-
}
6-
api "org.graceframework:grace-core"
7-
api "org.graceframework:grace-web-gsp"
8-
api "org.springframework.boot:spring-boot-autoconfigure"
9-
annotationProcessor "org.springframework.boot:spring-boot-autoconfigure-processor"
10-
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
11-
compileOnly "jakarta.servlet:jakarta.servlet-api"
12-
compileOnly "org.graceframework:grace-boot"
2+
api project(":grace-api")
3+
api project(":grace-cache-core")
4+
api project(":grace-core")
5+
implementation project(":grace-web-gsp")
6+
implementation project(":grace-web-taglib")
7+
8+
api libs.spring.boot.autoconfigure
9+
annotationProcessor libs.spring.boot.autoconfigureProcessor
10+
annotationProcessor libs.spring.boot.configurationProcessor
11+
testImplementation project(":grace-test")
12+
testImplementation project(":grace-test-support")
13+
testImplementation libs.assertj.core
14+
testImplementation libs.gpars
1315
}

grace-plugin-cache/src/main/groovy/grails/plugin/cache/CacheGrailsPlugin.groovy

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,19 @@
1515
*/
1616
package grails.plugin.cache
1717

18-
import grails.plugins.Plugin
1918
import groovy.transform.CompileStatic
2019

20+
import grails.plugins.Plugin
21+
import grails.util.GrailsUtil
22+
2123
@CompileStatic
2224
class CacheGrailsPlugin extends Plugin {
2325

24-
def grailsVersion = "2023.0.0 > *"
26+
def version = GrailsUtil.getGrailsVersion()
27+
def grailsVersion = '2023.0.0 > *'
2528
def observe = ['controllers', 'services']
2629
def loadAfter = ['controllers', 'services']
27-
def authorEmail = '[email protected]'
2830
def title = 'Grace Cache Plugin'
2931
def description = 'Provides AST transformations for caching method calls'
30-
def documentation = 'https://github.com/graceframework/grace-cache'
31-
def license = 'APACHE'
32-
def issueManagement = [system: 'Github', url: 'https://github.com/graceframework/grace-cache/issues']
33-
def scm = [url: 'https://github.com/graceframework/grace-cache']
34-
35-
def pluginExcludes = [
36-
'cache/Application',
37-
'**/com/demo/**',
38-
'grails-app/views/**',
39-
'**/*.gsp'
40-
]
4132

4233
}

grace-plugin-cache/src/main/groovy/grails/plugin/cache/CacheTagLib.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*/
1515
package grails.plugin.cache
1616

17+
import grails.gsp.TagLib
1718
import grails.plugin.cache.util.ClassUtils
1819
import groovy.transform.Memoized
1920
import groovy.util.logging.Slf4j
@@ -25,6 +26,7 @@ import org.grails.web.servlet.mvc.GrailsWebRequest
2526
import org.springframework.web.context.request.RequestContextHolder
2627

2728
@Slf4j
29+
@TagLib
2830
class CacheTagLib {
2931

3032

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<plugin name='cache'>
2+
<type>grails.plugin.cache.CacheGrailsPlugin</type>
3+
</plugin>

grace-plugin-cache/src/test/groovy/com/demo/BasicCachingServiceNoCacheManagerSpec.groovy

Lines changed: 0 additions & 23 deletions
This file was deleted.

grace-plugin-cache/src/test/groovy/com/demo/BasicCachingServiceSpec.groovy

Lines changed: 0 additions & 61 deletions
This file was deleted.

grace-plugin-cache/src/test/groovy/com/demo/ClassMarkedCacheableSpec.groovy

Lines changed: 0 additions & 73 deletions
This file was deleted.

grace-plugin-cache/src/test/groovy/grails/plugin/cache/GrailsConcurrentLinkedMapCacheManagerTests.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
package grails.plugin.cache
1616

1717
import groovyx.gpars.GParsPool
18-
import org.junit.Test
18+
import org.junit.jupiter.api.Test
1919

2020
/**
2121
* @author Jakob Drangmeister

grace-plugin-cache/src/test/groovy/grails/plugin/cache/GrailsConcurrentLinkedMapCacheTests.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package grails.plugin.cache
1616

1717
import org.springframework.cache.support.SimpleValueWrapper
1818
import org.apache.groovy.util.concurrent.concurrentlinkedhashmap.ConcurrentLinkedHashMap
19-
import org.junit.Test
19+
import org.junit.jupiter.api.Test
2020

2121
/**
2222
* @author Jakob Drangmeister

0 commit comments

Comments
 (0)