aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--juick-server/build.gradle7
-rw-r--r--juick-server/src/main/java/com/juick/server/configuration/WwwAppConfiguration.java8
2 files changed, 14 insertions, 1 deletions
diff --git a/juick-server/build.gradle b/juick-server/build.gradle
index 9b0a6496..54b39955 100644
--- a/juick-server/build.gradle
+++ b/juick-server/build.gradle
@@ -67,7 +67,8 @@ dependencies {
compile("org.springframework.boot:spring-boot-starter-security")
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.boot:spring-boot-starter-websocket")
-
+ compile 'org.springframework.boot:spring-boot-devtools'
+
compileOnly 'io.springfox:springfox-core:2.9.2'
compile 'org.apache.commons:commons-email:1.5'
@@ -114,6 +115,10 @@ bootJar {
launchScript()
}
+bootRun {
+ sourceResources sourceSets.main
+}
+
bootRun.dependsOn ':generateDebugKey'
compileFrontend.dependsOn 'yarn'
processResources.dependsOn 'compileFrontend'
diff --git a/juick-server/src/main/java/com/juick/server/configuration/WwwAppConfiguration.java b/juick-server/src/main/java/com/juick/server/configuration/WwwAppConfiguration.java
index f829a999..9f68032d 100644
--- a/juick-server/src/main/java/com/juick/server/configuration/WwwAppConfiguration.java
+++ b/juick-server/src/main/java/com/juick/server/configuration/WwwAppConfiguration.java
@@ -93,8 +93,16 @@ public class WwwAppConfiguration implements WebMvcConfigurer {
@Bean
public PebbleEngine pebbleEngine() {
+ boolean devToolsArePresent = false;
+ try {
+ Class.forName("org.springframework.boot.devtools.livereload.Connection");
+ devToolsArePresent = true;
+ } catch (ClassNotFoundException e) {
+ // release mode
+ }
return new PebbleEngine.Builder()
.loader(this.templateLoader())
+ .cacheActive(!devToolsArePresent)
.extension(springExtension())
.extension(new FormatterExtension())
.strictVariables(true)