mirror of
https://gitee.com/BDWare/cp.git
synced 2025-01-10 01:44:08 +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);
|
||||
LOGGER.info("--compile-- " + preSubConName);
|
||||
|
||||
String setGlobalName = cm.main.substring(0, cm.main.length() - 4) + "SetGlobal";
|
||||
String setGlobalContract =
|
||||
"contract " + setGlobalName + "{ function setGlobal (_global) { Global = _global; }}";
|
||||
czb.put(setGlobalName + ".yjs",
|
||||
compile(new ByteArrayInputStream(setGlobalContract.getBytes(StandardCharsets.UTF_8)),
|
||||
setGlobalName + ".yjs"));
|
||||
LOGGER.info("--compile-- " + setGlobalName);
|
||||
String globalBeanName = cm.main.substring(0, cm.main.length() - 4) + "GlobalBean";
|
||||
String globalBeanContract =
|
||||
"contract " + globalBeanName + "{ function setGlobal (_global) { Global = _global; }\n" +
|
||||
" function getGlobal () { return Global; }}";
|
||||
czb.put(globalBeanName + ".yjs",
|
||||
compile(new ByteArrayInputStream(globalBeanContract.getBytes(StandardCharsets.UTF_8)),
|
||||
globalBeanName + ".yjs"));
|
||||
LOGGER.info("--compile-- " + globalBeanName);
|
||||
|
||||
return czb;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user