소스 검색

Revert back to the zip file

Jared 5 년 전
부모
커밋
459781d075
No account linked to committer's email address
2개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 2
    3
      JavaIntegration/src/main/java/org/openzen/zencode/java/ScriptingEngine.java
  2. BIN
      JavaIntegration/src/main/resources/StdLibs.zip

+ 2
- 3
JavaIntegration/src/main/java/org/openzen/zencode/java/ScriptingEngine.java 파일 보기

43
 		space = new ModuleSpace(registry, new ArrayList<>(), StorageType.getStandard());
43
 		space = new ModuleSpace(registry, new ArrayList<>(), StorageType.getStandard());
44
 		
44
 		
45
 		try {
45
 		try {
46
-			File stdlibsFolder = new File(ScriptingEngine.class.getResource("/StdLibs").getPath());
47
-            FolderPackage stdlibs = new FolderPackage(stdlibsFolder);
46
+            ZippedPackage stdlibs = new ZippedPackage(ScriptingEngine.class.getResourceAsStream("/StdLibs.zip"));
48
             SemanticModule stdlibModule = stdlibs.loadModule(space, "stdlib", null, new SemanticModule[0], FunctionParameter.NONE, stdlib);
47
             SemanticModule stdlibModule = stdlibs.loadModule(space, "stdlib", null, new SemanticModule[0], FunctionParameter.NONE, stdlib);
49
 			stdlibModule = Validator.validate(stdlibModule, error -> System.out.println(error.toString()));
48
 			stdlibModule = Validator.validate(stdlibModule, error -> System.out.println(error.toString()));
50
 			space.addModule("stdlib", stdlibModule);
49
 			space.addModule("stdlib", stdlibModule);
51
-		} catch (CompileException | ParseException ex) {
50
+		} catch (CompileException | ParseException | IOException ex) {
52
 			throw new RuntimeException(ex);
51
 			throw new RuntimeException(ex);
53
 		}
52
 		}
54
 		this.logger = new EmptyLogger();
53
 		this.logger = new EmptyLogger();

BIN
JavaIntegration/src/main/resources/StdLibs.zip 파일 보기


Loading…
취소
저장