You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by jb...@apache.org on 2010/08/19 16:47:43 UTC
svn commit: r987168 - in /commons/sandbox/gsoc/2010/scxml-js/trunk: ./
test/rhino-jsc/ test/rhino-jsc/hello-world/
test/rhino-jsc/require-hello-world/ test/rhino-jsc/require-hello-world/foo/
test/rhino-jsc/require-hello-world/foo/bar/ test/rhino-jsc/re...
Author: jbeard
Date: Thu Aug 19 14:47:42 2010
New Revision: 987168
URL: http://svn.apache.org/viewvc?rev=987168&view=rev
Log:
Have begun experimenting to create a standalone executable. The idea is to use Google's closure compiler (supported by RequireJs) to create a single script file, and then to use Rhino's jsc JavaScript-to-bytecode compiler to compile it to a single executable class file. The class file is not standalone, but still requires Rhino's js.jar on the classpath to run. The committed files show this idea working for two simple examples.
Added:
commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/
commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/
commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/compile.sh (with props)
commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/run-compiled.sh (with props)
commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/test.js (with props)
commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/
commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/compile.sh (with props)
commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/foo/
commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/foo/bar/
commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/foo/bar/bat/
commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/foo/bar/bat/test.js (with props)
commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/main.js (with props)
commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/run-compiled.sh (with props)
commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/test-runner.js (with props)
Modified:
commons/sandbox/gsoc/2010/scxml-js/trunk/.gitignore
Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/.gitignore
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/.gitignore?rev=987168&r1=987167&r2=987168&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/.gitignore (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/.gitignore Thu Aug 19 14:47:42 2010
@@ -17,3 +17,6 @@ demo/hierarchical-layout/out.svg
*.log
demo/drawing-tool/lib/*
*~
+test/rhino-jsc/hello-world/test.class
+test/rhino-jsc/require-hello-world/main-built.js
+test/rhino-jsc/require-hello-world/main_built.class
Added: commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/compile.sh
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/compile.sh?rev=987168&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/compile.sh (added)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/compile.sh Thu Aug 19 14:47:42 2010
@@ -0,0 +1 @@
+java -cp ../../../lib/java/js.jar org.mozilla.javascript.tools.jsc.Main test.js
Propchange: commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/compile.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/compile.sh
------------------------------------------------------------------------------
svn:executable = *
Added: commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/run-compiled.sh
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/run-compiled.sh?rev=987168&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/run-compiled.sh (added)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/run-compiled.sh Thu Aug 19 14:47:42 2010
@@ -0,0 +1,2 @@
+#needs rhino on the classpath
+java -cp ../../../lib/java/js.jar:. test
Propchange: commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/run-compiled.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/run-compiled.sh
------------------------------------------------------------------------------
svn:executable = *
Added: commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/test.js
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/test.js?rev=987168&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/test.js (added)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/test.js Thu Aug 19 14:47:42 2010
@@ -0,0 +1 @@
+print("hello world!")
Propchange: commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/hello-world/test.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/compile.sh
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/compile.sh?rev=987168&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/compile.sh (added)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/compile.sh Thu Aug 19 14:47:42 2010
@@ -0,0 +1 @@
+java -cp ../../../lib/java/js.jar org.mozilla.javascript.tools.jsc.Main main-built.js
Propchange: commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/compile.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/compile.sh
------------------------------------------------------------------------------
svn:executable = *
Added: commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/foo/bar/bat/test.js
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/foo/bar/bat/test.js?rev=987168&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/foo/bar/bat/test.js (added)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/foo/bar/bat/test.js Thu Aug 19 14:47:42 2010
@@ -0,0 +1,4 @@
+require.def("foo/bar/bat/test",
+{
+ go: function(){print("hello world!")}
+});
Propchange: commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/foo/bar/bat/test.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/main.js
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/main.js?rev=987168&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/main.js (added)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/main.js Thu Aug 19 14:47:42 2010
@@ -0,0 +1,4 @@
+require(["foo/bar/bat/test"],
+function(testModule){
+ testModule.go();
+});
Propchange: commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/main.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/run-compiled.sh
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/run-compiled.sh?rev=987168&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/run-compiled.sh (added)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/run-compiled.sh Thu Aug 19 14:47:42 2010
@@ -0,0 +1,2 @@
+#needs rhino on the classpath
+java -cp ../../../lib/java/js.jar:. main_built
Propchange: commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/run-compiled.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/run-compiled.sh
------------------------------------------------------------------------------
svn:executable = *
Added: commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/test-runner.js
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/test-runner.js?rev=987168&view=auto
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/test-runner.js (added)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/test-runner.js Thu Aug 19 14:47:42 2010
@@ -0,0 +1,10 @@
+var pathToRequireJsDir = "../../../lib/js/requirejs/";
+
+load(pathToRequireJsDir + "require.js");
+load(pathToRequireJsDir + "require/rhino.js");
+
+require({
+ baseUrl : "."
+ },
+ ["main"]
+);
Propchange: commons/sandbox/gsoc/2010/scxml-js/trunk/test/rhino-jsc/require-hello-world/test-runner.js
------------------------------------------------------------------------------
svn:eol-style = native