public static void loadResourceScript(String name) throws IOException{ loadResourceScript(name, true); }
public static void loadResourceScript(String name, boolean failIfNotFound) throws IOException{ loadResourceScript(RT.class, name, failIfNotFound); }
public static void loadResourceScript(Class c, String name) throws IOException{ loadResourceScript(c, name, true); }
public static void maybeLoadResourceScript(String name) throws IOException{ loadResourceScript(name, false); }
public static void maybeLoadResourceScript(String name) throws IOException{ loadResourceScript(name, false); }
public static void loadResourceScript(Class c, String name) throws IOException{ loadResourceScript(c, name, true); }
private static void loadRequestedScripts(String[] args) { String fileToLoad = getFileToLoad(args); if (fileToLoad != null && fileToLoad.length() > 1) { if (fileToLoad.startsWith("@")) { int offest = fileToLoad.startsWith("@/") ? 2 : 1; try { RT.loadResourceScript(fileToLoad.substring(offest)); } catch (IOException e) { System.out.println("Error loading resource script: " + fileToLoad); } } else { try { Compiler.loadFile(fileToLoad); } catch (IOException e) { System.out.println("Error loading file " + fileToLoad); } } } }
private void lazilyLoadGamerStub() { if (theClojureGamer == null) { try { // Load the Clojure script -- as a side effect this initializes the runtime. RT.loadResourceScript(getClojureGamerFile() + ".clj"); // Get a reference to the gamer-generating function. Var gamerVar = RT.var("gamer_namespace", getClojureGamerName()); // Call it! theClojureGamer = (Gamer)gamerVar.invoke(); } catch(Exception e) { GamerLogger.logError("GamePlayer", "Caught exception in Clojure initialization:"); GamerLogger.logStackTrace("GamePlayer", e); } } }
compile(scriptfile); else loadResourceScript(RT.class, scriptfile);