Initial commit
This commit is contained in:
34
node_modules/node-blockly/blockly/tests/compile/compile.sh
generated
vendored
Executable file
34
node_modules/node-blockly/blockly/tests/compile/compile.sh
generated
vendored
Executable file
@@ -0,0 +1,34 @@
|
||||
# Find the Closure Compiler.
|
||||
if [ -f "$(npm root)/google-closure-compiler/compiler.jar" ]; then
|
||||
COMPILER="$(npm root)/google-closure-compiler/compiler.jar"
|
||||
elif [ -f *compiler*.jar ]; then
|
||||
COMPILER="*compiler*.jar"
|
||||
# TODO: Check whether multiple files were found.
|
||||
else
|
||||
echo "ERROR: Closure Compiler not found."
|
||||
echo "Download from this URL, and place jar file in current directory."
|
||||
echo "https://dl.google.com/closure-compiler/compiler-latest.zip"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo Using $COMPILER as the compiler.
|
||||
rm main_compressed.js 2> /dev/null
|
||||
echo Compiling Blockly...
|
||||
java -jar $COMPILER --js='main.js' \
|
||||
--js='../../core/**.js' \
|
||||
--js='../../blocks/**.js' \
|
||||
--js='../../generators/**.js' \
|
||||
--js='../../msg/js/**.js' \
|
||||
--js='../../../closure-library/closure/goog/**.js' \
|
||||
--js='../../../closure-library/third_party/closure/goog/**.js' \
|
||||
--generate_exports \
|
||||
--externs ../../externs/svg-externs.js \
|
||||
--compilation_level ADVANCED_OPTIMIZATIONS \
|
||||
--dependency_mode=STRICT --entry_point=Main \
|
||||
--js_output_file main_compressed.js
|
||||
if [ -s main_compressed.js ]; then
|
||||
echo Compilation OK.
|
||||
else
|
||||
echo Compilation FAIL.
|
||||
exit 1
|
||||
fi
|
||||
39
node_modules/node-blockly/blockly/tests/compile/index.html
generated
vendored
Normal file
39
node_modules/node-blockly/blockly/tests/compile/index.html
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Blockly: Advanced Compilation Test</title>
|
||||
<script src="main_compressed.js"></script>
|
||||
<style>
|
||||
body {
|
||||
background-color: #fff;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
h1 {
|
||||
font-weight: normal;
|
||||
font-size: 140%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Blockly: Advanced Compilation Test</h1>
|
||||
|
||||
<p>To run this test manually, download
|
||||
<a href="https://dl.google.com/closure-compiler/compiler-latest.zip">closure-compiler-vxxxxxxxx.jar</a>,
|
||||
place it in this directory, then run compile.js from the command line.</p>
|
||||
|
||||
<p>Measure the size of main_compressed.js (295kb as of October 2017), then reload
|
||||
this page and see if Blockly works.</p>
|
||||
|
||||
<div id="blocklyDiv" style="height: 480px; width: 600px;"></div>
|
||||
<xml id="toolbox" style="display: none">
|
||||
<block type="controls_if"></block>
|
||||
<block type="logic_compare"></block>
|
||||
<block type="controls_repeat_ext"></block>
|
||||
<block type="math_number"></block>
|
||||
<block type="math_arithmetic"></block>
|
||||
<block type="text"></block>
|
||||
<block type="text_print"></block>
|
||||
</xml>
|
||||
</body>
|
||||
</html>
|
||||
17
node_modules/node-blockly/blockly/tests/compile/main.js
generated
vendored
Normal file
17
node_modules/node-blockly/blockly/tests/compile/main.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
goog.provide('Main');
|
||||
// Messages (in some language)
|
||||
goog.require('Blockly.Msg.en');
|
||||
// Core
|
||||
goog.require('Blockly');
|
||||
// Blocks
|
||||
goog.require('Blockly.Constants.Logic');
|
||||
goog.require('Blockly.Constants.Loops');
|
||||
goog.require('Blockly.Constants.Math');
|
||||
goog.require('Blockly.Constants.Text');
|
||||
|
||||
Main.init = function() {
|
||||
Blockly.inject('blocklyDiv', {
|
||||
'toolbox': document.getElementById('toolbox')
|
||||
});
|
||||
};
|
||||
window.addEventListener('load', Main.init);
|
||||
Reference in New Issue
Block a user