feat:for reloading add "__dev__" case
This commit is contained in:
parent
0b0390edfe
commit
d49f6274f2
@ -100,12 +100,12 @@ public class DevKit implements IDevKit {
|
|||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void onReloadEvent(ReloadEvent reloadEvent) {
|
public void onReloadEvent(ReloadEvent reloadEvent) {
|
||||||
for (DoricContext context : DoricContextManager.aliveContexts()) {
|
for (DoricContext context : DoricContextManager.aliveContexts()) {
|
||||||
if (reloadEvent.source.contains(context.getSource())) {
|
|
||||||
if (doricContextDebuggable != null &&
|
if (doricContextDebuggable != null &&
|
||||||
doricContextDebuggable.isDebugging &&
|
doricContextDebuggable.isDebugging &&
|
||||||
doricContextDebuggable.getContext().getContextId().equals(context.getContextId())) {
|
doricContextDebuggable.getContext().getContextId().equals(context.getContextId())) {
|
||||||
System.out.println("is debugging context id: " + context.getContextId());
|
System.out.println("is debugging context id: " + context.getContextId());
|
||||||
} else {
|
} else {
|
||||||
|
if (reloadEvent.source.contains(context.getSource()) || context.getSource().equals("__dev__")) {
|
||||||
context.reload(reloadEvent.script);
|
context.reload(reloadEvent.script);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ - (void)webSocket:(SRWebSocket *)webSocket didReceiveMessage:(id)message {
|
|||||||
NSString *script = [dic valueForKey:@"script"];
|
NSString *script = [dic valueForKey:@"script"];
|
||||||
for (NSValue *value in [[DoricContextManager instance] aliveContexts]) {
|
for (NSValue *value in [[DoricContextManager instance] aliveContexts]) {
|
||||||
DoricContext *context = value.nonretainedObjectValue;
|
DoricContext *context = value.nonretainedObjectValue;
|
||||||
if ([source containsString:context.source]) {
|
if ([source containsString:context.source] || [context.source isEqualToString:@"__dev__"]) {
|
||||||
[context reload:script];
|
[context reload:script];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user