Skip to content

Commit 7042540

Browse files
committed
fix issue: configuration change shall trigger app reload on dev mode
1 parent 8de1f9b commit 7042540

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/main/java/act/app/DevModeClassLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ private void setupFsChangeDetectors() {
274274
libChangeDetector = new FsChangeDetector(lib, App.F.JAR_FILE, libChangeListener);
275275
}
276276

277-
File conf = layout.conf(appBase);
277+
File conf = RuntimeDirs.conf(app());
278278
if (null != conf && conf.canRead()) {
279279
confChangeDetector = new FsChangeDetector(conf, App.F.CONF_FILE.or(App.F.ROUTES_FILE), confChangeListener);
280280
}

src/main/java/act/app/ProjectLayout.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
import java.io.IOException;
99
import java.util.Properties;
1010

11+
import static act.app.RuntimeDirs.CLASSES;
12+
import static act.app.RuntimeDirs.CONF;
13+
1114
/**
1215
* Defines the project file structure supported by Act.
1316
* <p>Used ONLY at dev time for Act to decide where to pick up
@@ -207,11 +210,9 @@ public File target(File appBase) {
207210

208211
@Override
209212
public File conf(File appBase) {
210-
File file = Utils.file(resource(appBase), "app.conf");
211-
if (file.exists()) {
212-
return file;
213-
}
214-
return Utils.file(resource(appBase), "app.conf");
213+
File confBase = Act.isDev() ? resource(appBase) : new File(appBase, CLASSES);
214+
File file = new File(confBase, CONF);
215+
return file.exists() ? file : confBase;
215216
}
216217

217218
@Override

0 commit comments

Comments
 (0)