From bee51df7b36c264e599e69b1d0a5b5a2d561cc82 Mon Sep 17 00:00:00 2001 From: James Roseborough Date: Tue, 2 Oct 2012 02:34:34 +0000 Subject: [PATCH] Clean up build for distribution. --- build-perf.xml | 15 +++++++-------- build.xml | 1 + src/core/org/luaj/vm2/Globals.java | 2 -- src/core/org/luaj/vm2/lib/OsLib.java | 9 --------- src/core/org/luaj/vm2/lib/PackageLib.java | 6 +++++- src/jse/org/luaj/vm2/luajc/JavaBuilder.java | 14 ++++++++------ 6 files changed, 21 insertions(+), 26 deletions(-) diff --git a/build-perf.xml b/build-perf.xml index 62d6b9e7..63007823 100644 --- a/build-perf.xml +++ b/build-perf.xml @@ -1,13 +1,13 @@ - - + + - + @@ -30,7 +30,7 @@ dest="lib/mochalua-1.0.jar"/> - + @@ -51,10 +51,9 @@ =========== @{luaprog} ============= - - - - + + + diff --git a/build.xml b/build.xml index b2af82f7..f3b04d5c 100644 --- a/build.xml +++ b/build.xml @@ -54,6 +54,7 @@ + diff --git a/src/core/org/luaj/vm2/Globals.java b/src/core/org/luaj/vm2/Globals.java index e9305993..923df0ca 100644 --- a/src/core/org/luaj/vm2/Globals.java +++ b/src/core/org/luaj/vm2/Globals.java @@ -29,8 +29,6 @@ import org.luaj.vm2.lib.BaseLib; import org.luaj.vm2.lib.DebugLib; import org.luaj.vm2.lib.PackageLib; import org.luaj.vm2.lib.ResourceFinder; -import org.luaj.vm2.lib.jme.JmePlatform; -import org.luaj.vm2.lib.jse.JsePlatform; /** * Global environment used by luaj. diff --git a/src/core/org/luaj/vm2/lib/OsLib.java b/src/core/org/luaj/vm2/lib/OsLib.java index b80f391a..287e9676 100644 --- a/src/core/org/luaj/vm2/lib/OsLib.java +++ b/src/core/org/luaj/vm2/lib/OsLib.java @@ -27,15 +27,6 @@ import org.luaj.vm2.Globals; import org.luaj.vm2.LuaTable; import org.luaj.vm2.LuaValue; import org.luaj.vm2.Varargs; -import org.luaj.vm2.lib.PackageLib.java_searcher; -import org.luaj.vm2.lib.PackageLib.loadlib; -import org.luaj.vm2.lib.PackageLib.lua_searcher; -import org.luaj.vm2.lib.PackageLib.preload_searcher; -import org.luaj.vm2.lib.PackageLib.require; -import org.luaj.vm2.lib.PackageLib.searchpath; -import org.luaj.vm2.lib.jme.JmePlatform; -import org.luaj.vm2.lib.jse.JseOsLib; -import org.luaj.vm2.lib.jse.JsePlatform; /** * Subclass of {@link LibFunction} which implements the standard lua {@code os} library. diff --git a/src/core/org/luaj/vm2/lib/PackageLib.java b/src/core/org/luaj/vm2/lib/PackageLib.java index a9cd9331..1755df36 100644 --- a/src/core/org/luaj/vm2/lib/PackageLib.java +++ b/src/core/org/luaj/vm2/lib/PackageLib.java @@ -64,7 +64,11 @@ public class PackageLib extends OneArgFunction { /** The default value to use for package.path. This can be set with the system property * "luaj.package.path", and is "?.lua" by default. */ - public static String DEFAULT_LUA_PATH = System.getProperty("luaj.package.path", "?.lua"); + public static String DEFAULT_LUA_PATH = System.getProperty("luaj.package.path"); + static { + if (DEFAULT_LUA_PATH == null) + DEFAULT_LUA_PATH = "?.lua"; + } /** The globals that were used to load this library. */ Globals globals; diff --git a/src/jse/org/luaj/vm2/luajc/JavaBuilder.java b/src/jse/org/luaj/vm2/luajc/JavaBuilder.java index 127d5267..2387975b 100644 --- a/src/jse/org/luaj/vm2/luajc/JavaBuilder.java +++ b/src/jse/org/luaj/vm2/luajc/JavaBuilder.java @@ -346,7 +346,7 @@ public class JavaBuilder { LocalVariableGen local = mg.addLocalVariable(name, type, null, null); int index = local.getIndex(); map.put(islot, Integer.valueOf(index)); - localVarGenBySlot.put(slot, local); + localVarGenBySlot.put(islot, local); return index; } private int findSlotIndex( int slot, boolean isupvalue ) { @@ -699,9 +699,10 @@ public class JavaBuilder { init.append(factory.createInvoke(STR_LUASTRING, "valueOf", TYPE_LUASTRING, ARG_TYPES_STRING, Constants.INVOKESTATIC)); } else { - char[] c = new char[ls.m_length]; - for ( int j=0; j 1) l.setStart(lastInstrHandles[start_pc-2]);