debugging exclude hot load
This commit is contained in:
parent
75f1aacb8b
commit
30f61eb47c
@ -7,15 +7,18 @@ import pub.doric.DoricNativeDriver;
|
||||
public class DoricContextDebuggable {
|
||||
private DoricContext doricContext;
|
||||
private DoricDebugDriver doricDebugDriver;
|
||||
public boolean isDebugging = false;
|
||||
|
||||
public DoricContextDebuggable(String contextId) {
|
||||
this.doricContext = DoricContextManager.getContext(contextId);
|
||||
}
|
||||
|
||||
public void startDebug() {
|
||||
|
||||
doricDebugDriver = new DoricDebugDriver(new IStatusCallback() {
|
||||
@Override
|
||||
public void start() {
|
||||
isDebugging = true;
|
||||
doricContext.setDriver(doricDebugDriver);
|
||||
doricContext.reInit();
|
||||
}
|
||||
@ -23,8 +26,13 @@ public class DoricContextDebuggable {
|
||||
}
|
||||
|
||||
public void stopDebug() {
|
||||
isDebugging = false;
|
||||
doricDebugDriver.destroy();
|
||||
doricContext.setDriver(DoricNativeDriver.getInstance());
|
||||
doricContext.reInit();
|
||||
}
|
||||
|
||||
public DoricContext getContext() {
|
||||
return doricContext;
|
||||
}
|
||||
}
|
||||
|
@ -85,9 +85,13 @@ public class DemoDebugActivity extends DoricActivity {
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onReloadEvent(ReloadEvent reloadEvent) {
|
||||
for (DoricContext context : DoricContextManager.aliveContexts()) {
|
||||
if (reloadEvent.source.contains(context.getSource())) {
|
||||
context.reload(reloadEvent.script);
|
||||
if (doricContextDebuggable != null && doricContextDebuggable.isDebugging) {
|
||||
System.out.println("is debugging");
|
||||
} else {
|
||||
for (DoricContext context : DoricContextManager.aliveContexts()) {
|
||||
if (reloadEvent.source.contains(context.getSource())) {
|
||||
context.reload(reloadEvent.script);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user