Skip to content
Permalink
Browse files

Small improvements for ./do.sh. Added grunt 'lint' task.

Test server can be run on arbitrary port.
  • Loading branch information...
koto committed Oct 22, 2014
1 parent bbe645f commit d5685fc1bee3adf0850b14b5744ce6b2ae5ef963
Showing with 33 additions and 4 deletions.
  1. +4 −0 Gruntfile.js
  2. +22 −3 do.sh
  3. +7 −1 test_server.py
@@ -64,6 +64,10 @@ module.exports = function(grunt) {
'shell:doScript:testserver'
]);

grunt.registerTask('lint', [
'shell:doScript:lint'
]);

grunt.registerTask('default', [
'build-extension'
]);
25 do.sh
@@ -53,6 +53,7 @@ e2e_assert_dependencies() {

e2e_build_templates() {
e2e_assert_dependencies
set -e
mkdir -p "$BUILD_TPL_DIR"
rm -rf "$BUILD_TPL_DIR/*"
# Compile soy templates
@@ -160,9 +161,9 @@ e2e_testserver() {
--root_with_prefix="lib/zlib.js/ ../../../lib/zlib.js/" \
> "$BUILD_DIR/test_js_deps-runfiles.js"

rm "$BUILD_DIR/all_tests.js"
rm -f "$BUILD_DIR/all_tests.js"
echo "Starting the End-To-End test server (Press Ctrl-C to stop)..."
$PYTHON_CMD test_server.py
$PYTHON_CMD test_server.py $*
echo "Done."
}

@@ -183,6 +184,21 @@ e2e_lint() {
fi
}

e2e_build() {
TARGET=$1
shift
if [ "$TARGET" == "extension" ]; then
e2e_build_extension $*;
elif [ "$TARGET" == "library" ]; then
e2e_build_library $*;
elif [ "$TARGET" == "templates" ]; then
e2e_build_templates $*;
else
echo "Invalid build target $TARGET"
exit 1
fi
}

RETVAL=0

CMD=$1
@@ -195,6 +211,9 @@ case "$CMD" in
install_deps)
e2e_install_deps;
;;
build)
e2e_build $*;
;;
build_extension)
e2e_build_extension;
;;
@@ -211,7 +230,7 @@ case "$CMD" in
e2e_build_clean;
;;
testserver)
e2e_testserver;
e2e_testserver $*;
;;
lint)
e2e_lint $*;
@@ -22,8 +22,14 @@
import os.path
import SimpleHTTPServer
import StringIO
import sys

PORT=8000
if len(sys.argv) > 1:
PORT = int(sys.argv[1])

server_address = ("127.0.0.1", PORT)

server_address = ("127.0.0.1", 8000)
# ./do.sh testserver generates the file
DEPS_FILE="build/test_js_deps-runfiles.js"
ALL_JSTESTS_FILE="build/all_tests.js"

0 comments on commit d5685fc

Please sign in to comment.
You can’t perform that action at this time.