Browse Source

Revert back to the zip file

Jared 5 years ago
parent
commit
459781d075
No account linked to committer's email address

+ 2
- 3
JavaIntegration/src/main/java/org/openzen/zencode/java/ScriptingEngine.java View File

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 View File


Loading…
Cancel
Save