mirror of
https://gitee.com/BDWare/cp.git
synced 2025-01-10 09:54:07 +00:00
feat: update YJSCompiler
compile getGlobal in all contracts
This commit is contained in:
parent
ad8de7a92c
commit
c077d425ab
@ -163,13 +163,14 @@ public class YJSCompiler {
|
|||||||
czb.put(preSubConName + ".yjs", preSubNode);
|
czb.put(preSubConName + ".yjs", preSubNode);
|
||||||
LOGGER.info("--compile-- " + preSubConName);
|
LOGGER.info("--compile-- " + preSubConName);
|
||||||
|
|
||||||
String setGlobalName = cm.main.substring(0, cm.main.length() - 4) + "SetGlobal";
|
String globalBeanName = cm.main.substring(0, cm.main.length() - 4) + "GlobalBean";
|
||||||
String setGlobalContract =
|
String globalBeanContract =
|
||||||
"contract " + setGlobalName + "{ function setGlobal (_global) { Global = _global; }}";
|
"contract " + globalBeanName + "{ function setGlobal (_global) { Global = _global; }\n" +
|
||||||
czb.put(setGlobalName + ".yjs",
|
" function getGlobal () { return Global; }}";
|
||||||
compile(new ByteArrayInputStream(setGlobalContract.getBytes(StandardCharsets.UTF_8)),
|
czb.put(globalBeanName + ".yjs",
|
||||||
setGlobalName + ".yjs"));
|
compile(new ByteArrayInputStream(globalBeanContract.getBytes(StandardCharsets.UTF_8)),
|
||||||
LOGGER.info("--compile-- " + setGlobalName);
|
globalBeanName + ".yjs"));
|
||||||
|
LOGGER.info("--compile-- " + globalBeanName);
|
||||||
|
|
||||||
return czb;
|
return czb;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user