Skip to content

Commit 61b6c99

Browse files
committed
release: v0.8.1 hotfix bug that occurred in a strategy pattern
- Updated `spring-view-component-thymeleaf`, `spring-view-component-jte`, and `spring-view-component-kte` versions to 0.8.1 in various build files and README.md - Improved view handling by removing the dependence on componentTemplate property and handling the template suffix inside ViewContext specific implementations - Removed an unnecessary includeBuild operation from settings.gradle.kts - Fixed the access modifier for a Pointcut definition in JteViewContextAspect.kt - Removed an unused variable in ViewComponentAutoConfiguration.kt - Updated version in the core library's build.gradle.kts file to 0.8.1 - Updated dependencies in kte, jte, thymeleaf project's build.gradle.kts files to use the correct version of the core library
1 parent 7679e9d commit 61b6c99

File tree

22 files changed

+41
-48
lines changed

22 files changed

+41
-48
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ spring.view-component.local-development=true
227227
<summary>Gradle</summary>
228228

229229
```kotlin
230-
implementation("de.tschuehly:spring-view-component-thymeleaf:0.8.0")
230+
implementation("de.tschuehly:spring-view-component-thymeleaf:0.8.1")
231231
sourceSets {
232232
main {
233233
resources {
@@ -249,7 +249,7 @@ sourceSets {
249249
<dependency>
250250
<groupId>de.tschuehly</groupId>
251251
<artifactId>spring-view-component-thymeleaf</artifactId>
252-
<version>0.8.0</version>
252+
<version>0.8.1</version>
253253
</dependency>
254254
</dependencies>
255255
<build>
@@ -286,7 +286,7 @@ plugins {
286286
id("gg.jte.gradle") version("3.1.12")
287287
}
288288

289-
implementation("de.tschuehly:spring-view-component-jte:0.8.0")
289+
implementation("de.tschuehly:spring-view-component-jte:0.8.1")
290290

291291
jte{
292292
generate()
@@ -305,7 +305,7 @@ jte{
305305
<dependency>
306306
<groupId>de.tschuehly</groupId>
307307
<artifactId>spring-view-component-jte</artifactId>
308-
<version>0.8.0</version>
308+
<version>0.8.1</version>
309309
</dependency>
310310
</dependencies>
311311
<build>
@@ -343,7 +343,7 @@ jte{
343343
<summary>Gradle</summary>
344344

345345
```kotlin
346-
implementation("de.tschuehly:spring-view-component-kte:0.8.0")
346+
implementation("de.tschuehly:spring-view-component-kte:0.8.1")
347347
jte{
348348
generate()
349349
sourceDirectory = Path("src/main/kotlin")

core/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ plugins {
1414
}
1515

1616
group = "de.tschuehly"
17-
version = "0.8.0"
17+
version = "0.8.1"
1818
java.sourceCompatibility = JavaVersion.VERSION_17
1919

2020
repositories {

core/src/main/kotlin/de/tschuehly/spring/viewcomponent/core/IViewContext.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,11 @@ import org.springframework.context.ApplicationContext
55
interface IViewContext {
66
companion object {
77
var applicationContext: ApplicationContext? = null
8-
var componentTemplate: String? = null
9-
var templateSuffx: String = ""
108

119
fun <T> server(clazz: Class<T>): T{
1210
return applicationContext?.getBean(clazz) ?: throw RuntimeException(clazz.simpleName)
1311
}
1412

15-
fun getViewComponentTemplate(context: IViewContext): String {
16-
return getViewComponentTemplateWithoutSuffix(context) + templateSuffx
17-
}
1813

1914
fun getViewComponentTemplateWithoutSuffix(context: IViewContext): String {
2015
val componentName = getViewComponentName(context.javaClass)

core/src/main/kotlin/de/tschuehly/spring/viewcomponent/core/ViewComponentAutoConfiguration.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ class ViewComponentAutoConfiguration {
3030
viewComponentProperties: ViewComponentProperties
3131
): FileSystemWatcher {
3232
val fileSystemWatcher = FileSystemWatcher()
33-
val buildDir = applicationContext.getBeansWithAnnotation(ViewComponent::class.java).values.map {
34-
it.javaClass.protectionDomain.codeSource.location.path
35-
}.first()
36-
3733
val viewComponentDirectory = File(viewComponentProperties.viewComponentRoot)
3834
val templateRoot = File(viewComponentProperties.standaloneTemplateRoot)
3935
fileSystemWatcher.addSourceDirectory(viewComponentDirectory)

core/src/main/kotlin/de/tschuehly/spring/viewcomponent/core/component/ViewComponentAspect.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class ViewComponentAspect(val applicationContext: ApplicationContext) {
2727
throw ViewComponentException("${returnValue.javaClass} needs to implement ViewContext abstract class")
2828
}
2929
IViewContext.applicationContext = applicationContext
30-
IViewContext.componentTemplate = IViewContext.getViewComponentTemplateWithoutSuffix(viewContext)
3130
return viewContext
3231
}
3332
}

core/src/main/kotlin/de/tschuehly/spring/viewcomponent/core/component/ViewContextMethodReturnValueHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ViewContextMethodReturnValueHandler : HandlerMethodReturnValueHandler {
2323
val viewContext = returnValue?.takeIf {
2424
(IViewContext::class.java.isAssignableFrom(it.javaClass))
2525
} as IViewContext
26-
mavContainer.view = IViewContext.componentTemplate
26+
mavContainer.view = IViewContext.getViewComponentTemplateWithoutSuffix(context = viewContext)
2727
mavContainer.addAttribute(viewContext)
2828
}
2929

examples/jte-example/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ repositories {
2626
dependencies {
2727
implementation("org.springframework.boot:spring-boot-starter-web")
2828

29-
implementation("de.tschuehly:spring-view-component-jte:0.8.0")
29+
implementation("de.tschuehly:spring-view-component-jte:0.8.1")
3030

3131
implementation("org.webjars.npm:htmx.org:1.9.11")
3232
implementation("org.webjars:webjars-locator-core:0.58")
3333

3434
testImplementation("org.springframework.boot:spring-boot-starter-test")
3535
testRuntimeOnly("org.springframework.boot:spring-boot-devtools")
36-
testImplementation(testFixtures("de.tschuehly:spring-view-component-core:0.8.0"))
36+
testImplementation(testFixtures("de.tschuehly:spring-view-component-core:0.8.1"))
3737
}
3838

3939
tasks.withType<Test> {

examples/jte-example/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<description>JTE Example</description>
1616
<properties>
1717
<java.version>17</java.version>
18-
<view.component.version>0.8.0</view.component.version>
18+
<view.component.version>0.8.1</view.component.version>
1919
</properties>
2020
<dependencies>
2121
<dependency>

examples/kte-example/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ repositories {
3131
}
3232

3333
dependencies {
34-
implementation("de.tschuehly:spring-view-component-kte:0.8.0")
35-
implementation("de.tschuehly:spring-view-component-core:0.8.0")
34+
implementation("de.tschuehly:spring-view-component-kte:0.8.1")
35+
implementation("de.tschuehly:spring-view-component-core:0.8.1")
3636
implementation("io.github.wimdeblauwe:htmx-spring-boot:3.1.1")
3737

3838
implementation("org.webjars.npm:htmx.org:1.9.11")
@@ -47,7 +47,7 @@ dependencies {
4747

4848
testImplementation("org.springframework.boot:spring-boot-starter-test")
4949
testImplementation("org.springframework.boot:spring-boot-devtools")
50-
testImplementation(testFixtures("de.tschuehly:spring-view-component-core:0.8.0"))
50+
testImplementation(testFixtures("de.tschuehly:spring-view-component-core:0.8.1"))
5151
}
5252

5353
tasks.withType<KotlinCompile> {

examples/kte-example/settings.gradle.kts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ includeBuild("..\\..\\kte"){
66
substitute(module("de.tschuehly:spring-view-component-kte")).using(project(":"))
77
}
88
}
9-
includeBuild("..\\..\\jte"){
10-
dependencySubstitution {
11-
substitute(module("de.tschuehly:spring-view-component-jte")).using(project(":"))
12-
}
13-
}
149
includeBuild("..\\..\\core"){
1510
dependencySubstitution {
1611
substitute(module("de.tschuehly:spring-view-component-core")).using(project(":"))

0 commit comments

Comments
 (0)