changeset 172:4edbf3204ca6

add build.sh and dist git-svn-id: https://luan-java.googlecode.com/svn/trunk@173 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Sun, 22 Jun 2014 06:12:29 +0000
parents 3dcb0f9bee82
children 58c6ca5d4524
files build.sh core/src/luan/Luan.java core/src/luan/LuanState.java core/src/luan/init.luan core/src/luan/version.luan dist/luan-core-trunk.jar dist/luan-web-trunk.jar
diffstat 7 files changed, 19 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
diff -r 3dcb0f9bee82 -r 4edbf3204ca6 build.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build.sh	Sun Jun 22 06:12:29 2014 +0000
@@ -0,0 +1,15 @@
+VERSION=trunk
+echo "_G._VERSION = 'Luan $VERSION'" >`pwd`/core/src/luan/version.luan
+
+rm dist/*.jar
+
+SRC=`pwd`/core/src
+CLASSPATH=$SRC
+javac `find $SRC -name *.java`
+jar cvf dist/luan-core-$VERSION.jar `find $SRC -name *.class -o -name *.luan`
+
+SRC=`pwd`/web/src
+CLASSPATH=`pwd`/core/src:$SRC
+for i in `pwd`/web/ext/* ; do CLASSPATH=$CLASSPATH:$i ; done
+javac `find $SRC -name *.java`
+jar cvf dist/luan-web-$VERSION.jar `find $SRC -name *.class -o -name *.luan`
diff -r 3dcb0f9bee82 -r 4edbf3204ca6 core/src/luan/Luan.java
--- a/core/src/luan/Luan.java	Sun Jun 22 05:41:22 2014 +0000
+++ b/core/src/luan/Luan.java	Sun Jun 22 06:12:29 2014 +0000
@@ -4,7 +4,6 @@
 
 
 public final class Luan {
-	public static final String version = "Luan 0.1";
 
 	public static void main(String[] args) {
 		LuanState luan = LuanState.newStandard();
diff -r 3dcb0f9bee82 -r 4edbf3204ca6 core/src/luan/LuanState.java
--- a/core/src/luan/LuanState.java	Sun Jun 22 05:41:22 2014 +0000
+++ b/core/src/luan/LuanState.java	Sun Jun 22 06:12:29 2014 +0000
@@ -63,7 +63,6 @@
 	protected LuanState() {
 		global = new LuanTable();
 		global.put("_G",global);
-		global.put( "_VERSION", Luan.version );
 		loaded = new LuanTable();
 		preload = new LuanTable();
 		searchers = new LuanTable();
diff -r 3dcb0f9bee82 -r 4edbf3204ca6 core/src/luan/init.luan
--- a/core/src/luan/init.luan	Sun Jun 22 05:41:22 2014 +0000
+++ b/core/src/luan/init.luan	Sun Jun 22 06:12:29 2014 +0000
@@ -21,7 +21,7 @@
 Package.global(Basic,"assert_number")
 Package.global(Basic,"assert_string")
 Package.global(Basic,"assert_table")
-Package.global(Basic,"do_file")
+local do_file = Package.global(Basic,"do_file")
 Package.global(Basic,"error")
 Package.global(Basic,"get_metatable")
 Package.global(Basic,"ipairs")
@@ -39,6 +39,8 @@
 local to_string = Package.global(Basic,"to_string")
 Package.global(Basic,"type")
 
+do_file "java:luan/version.luan"
+
 local String = Package.global_import("String","luan.lib.StringLib.LOADER")
 
 -- improved global_import
diff -r 3dcb0f9bee82 -r 4edbf3204ca6 core/src/luan/version.luan
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/src/luan/version.luan	Sun Jun 22 06:12:29 2014 +0000
@@ -0,0 +1,1 @@
+_G._VERSION = 'Luan trunk'
diff -r 3dcb0f9bee82 -r 4edbf3204ca6 dist/luan-core-trunk.jar
Binary file dist/luan-core-trunk.jar has changed
diff -r 3dcb0f9bee82 -r 4edbf3204ca6 dist/luan-web-trunk.jar
Binary file dist/luan-web-trunk.jar has changed