Skip to content

Commit

Permalink
trigger livereload after updating classes
Browse files Browse the repository at this point in the history
  • Loading branch information
tschuehly committed Nov 3, 2023
1 parent 1a802eb commit 7a5a672
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import org.springframework.boot.devtools.filewatch.ChangedFiles
import org.springframework.boot.devtools.filewatch.FileChangeListener
import org.springframework.context.ApplicationContext
import org.springframework.context.ApplicationEventPublisher
import org.springframework.context.event.ContextRefreshedEvent


class ViewComponentChangeListener(
Expand Down Expand Up @@ -39,11 +40,14 @@ class ViewComponentChangeListener(
viewComponentName = javaClass.simpleName.lowercase()
)
parser.parseFile(true)
if(srcFile.extension == "kte" || srcFile.extension == "jte"){
applicationEventPublisher.publishEvent(ClassPathChangedEvent(this, changeSet, true))
}else{
applicationEventPublisher.publishEvent(ClassPathChangedEvent(this, changeSet, false))
}
// applicationEventPublisher.publishEvent(ContextRefreshedEvent(applicationContext))
// applicationEventPublisher.publishEvent(ClassPathChangedEvent(this, changeSet, false))
// if(srcFile.extension == "kte" || srcFile.extension == "jte"){
// // TODO: if restart is set to false then update resources in intelliJ triggers livereload
// applicationEventPublisher.publishEvent(ClassPathChangedEvent(this, changeSet, false))
// }else{
// applicationEventPublisher.publishEvent(ClassPathChangedEvent(this, changeSet, false))
// }
}
}

Expand Down
30 changes: 15 additions & 15 deletions examples/jte-example/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
rootProject.name = "jte-example"
//includeBuild("..\\..\\jte\\jte"){
// dependencySubstitution {
// substitute(module("de.tschuehly:spring-view-component-jte")).using(project(":"))
// }
//}
//includeBuild("..\\..\\jte\\jte-compiler"){
// dependencySubstitution {
// substitute(module("de.tschuehly:spring-view-component-jte-compiler")).using(project(":"))
// }
//}
//includeBuild("..\\..\\core"){
// dependencySubstitution {
// substitute(module("de.tschuehly:spring-view-component-core")).using(project(":"))
// }
//}
includeBuild("..\\..\\jte\\jte"){
dependencySubstitution {
substitute(module("de.tschuehly:spring-view-component-jte")).using(project(":"))
}
}
includeBuild("..\\..\\jte\\jte-compiler"){
dependencySubstitution {
substitute(module("de.tschuehly:spring-view-component-jte-compiler")).using(project(":"))
}
}
includeBuild("..\\..\\core"){
dependencySubstitution {
substitute(module("de.tschuehly:spring-view-component-core")).using(project(":"))
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
spring.view-component.local-development=true
server.port=8082
server.port=8082

logging.level.org.springframework: DEBUG

0 comments on commit 7a5a672

Please sign in to comment.