Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 4 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
Showing with 87 additions and 47 deletions.
  1. +12 −37 build/compile.sh
  2. +34 −0 build/deps.sh
  3. +2 −10 build/lint.sh
  4. +39 −0 build/vars.sh
View
49 build/compile.sh
@@ -1,5 +1,5 @@
-# Closure-boilerplate Compile Script
+# Closure-Boilerplate Compile Script
# --
# @autor Jan Kuča
@@ -11,46 +11,19 @@
PROJECT_DIR_RELATIVE=$1
[ -z $1 ] && PROJECT_DIR_RELATIVE="."
-
-# The root project directory
-# All the following paths are relative to this directory
-PROJECT_DIR=`cd $PROJECT_DIR_RELATIVE ; pwd`
-
-# The directory in which is this script placed
-BUILD_DIR=$PROJECT_DIR/build
-
-# The public-facing directory (sometimes called the document root)
-PUBLIC_DIR=$PROJECT_DIR/public
-
-# The compile script output directory path
-TARGET_DIR=$PUBLIC_DIR/build
-
-# The compile script output file name
-# Relative to $TARGET_DIR
-TARGET_FILE=app.min.js
-
-# The source map file name
-# Relative to $TARGET_DIR
-SOURCE_MAP_FILE=source-map.json
-
-# The file (created by the script) including JS references from HTML files
-HTML_JS_FILE=$PUBLIC_DIR/app/js/html-references.temp.js
-
-# The closure-library directory path
-CLOSURE_LIBRARY_DIR=$PUBLIC_DIR/lib/closure-library
-
-# The Google Closure Compiler jar file path
-CLOSURE_COMPILER_PATH=$BUILD_DIR/closure-compiler/compiler.jar
+source $PROJECT_DIR_RELATIVE/build/vars.sh
# Make sure the target directory exists
echo "-- Make sure the target directory exists"
+echo $TARGET_DIR
mkdir -p $TARGET_DIR
-echo
+echo ""
# Extract JavaScript global references from HTML files into a temporary JS file
echo "-- Extract JavaScript references from HTML files"
+echo $HTML_JS_FILE
$BUILD_DIR/compile-html.js \
--root=$PUBLIC_DIR \
--exclude=$PUBLIC_DIR/lib \
@@ -58,13 +31,14 @@ $BUILD_DIR/compile-html.js \
--namespace="app.htmlReferences" \
> $HTML_JS_FILE \
|| exit 1
-echo
+echo -e "\n"
# Note: The output file has to be inside one of the roots below.
# Compile the JavaScript and generate a source map
echo "-- Compile the JavaScript and generate a source map"
+echo $TARGET_DIR/$TARGET_FILE
$CLOSURE_LIBRARY_DIR/closure/bin/build/closurebuilder.py \
--root="$PUBLIC_DIR/lib" \
--root="$PUBLIC_DIR/app" \
@@ -93,11 +67,12 @@ $BUILD_DIR/fix-source-map.js \
|| exit 1
echo
+
# Remove temporary files
-# Do not remove the files if you want the source-mapping to be complete.
-#echo "Remove temporary files"
-#rm $PUBLIC_DIR/app/js/controllers.temp.js
-#echo
+echo "Remove temporary files"
+echo -n "$HTML_JS_FILE: "
+rm $HTML_JS_FILE && echo "ok"
+echo ""
echo "== Successfully compiled =="
View
34 build/deps.sh
@@ -0,0 +1,34 @@
+
+# Closure-Boilerplate Dependency-Writer Script
+# --
+# @autor Jan Kuča
+
+
+
+# The $1 argument is the project root path (defaults to ".")
+# Note: The provided Sublime Text build command automatically passes
+# the $project_path variable to this script.
+PROJECT_DIR_RELATIVE=$1
+[ -z $1 ] && PROJECT_DIR_RELATIVE="."
+
+source $PROJECT_DIR_RELATIVE/build/vars.sh
+
+
+
+# Make sure the target directory exists
+echo "-- Make sure the target directory exists"
+echo -n "$TARGET_DIR: "
+mkdir -p $TARGET_DIR && echo "ok"
+echo ""
+
+
+echo "-- Create the dependency information file"
+echo $DEPS_FILE
+$CLOSURE_LIBRARY_DIR/closure/bin/build/depswriter.py \
+ --root_with_prefix="public/app ../../../app" \
+> $DEPS_FILE \
+|| exit 1
+echo ""
+
+
+echo "== Successfully created =="
View
12 build/lint.sh
@@ -11,19 +11,11 @@
PROJECT_DIR_RELATIVE=$1
[ -z $1 ] && PROJECT_DIR_RELATIVE="."
-
-# The Google Closure Linter executable path
-CLOSURE_LINTER_PATH="/usr/local/bin/gjslint"
-
-# The root project directory
-# All the following paths are relative to this directory
-PROJECT_DIR=`cd $PROJECT_DIR_RELATIVE ; pwd`
-
-# The public-facing directory (sometimes called the document root)
-PUBLIC_DIR=$PROJECT_DIR/public
+source $PROJECT_DIR_RELATIVE/build/vars.sh
+# Run Google Closure Linter
$CLOSURE_LINTER_PATH \
$PUBLIC_DIR/app/js/*.js \
\
View
39 build/vars.sh
@@ -0,0 +1,39 @@
+
+# Closure-Boilerplate Build Configuration
+# --
+# @autor Jan Kuča
+
+
+
+# The root project directory
+# All the following paths are relative to this directory
+PROJECT_DIR=`cd $PROJECT_DIR_RELATIVE ; pwd`
+
+# The directory in which is this script placed
+BUILD_DIR=$PROJECT_DIR/build
+
+# The public-facing directory (sometimes called the document root)
+PUBLIC_DIR=$PROJECT_DIR/public
+
+# The compile script output directory path
+TARGET_DIR=$PUBLIC_DIR/build
+
+# The compile script output file name
+# Relative to $TARGET_DIR
+TARGET_FILE=app.min.js
+
+# The source map file name
+# Relative to $TARGET_DIR
+SOURCE_MAP_FILE=source-map.json
+
+# The dependency file path
+DEPS_FILE=$TARGET_DIR/deps.js
+
+# The file (created by the script) including JS references from HTML files
+HTML_JS_FILE=$PUBLIC_DIR/app/js/html-references.temp.js
+
+# The closure-library directory path
+CLOSURE_LIBRARY_DIR=$PUBLIC_DIR/lib/closure-library
+
+# The Google Closure Compiler jar file path
+CLOSURE_COMPILER_PATH=$BUILD_DIR/closure-compiler/compiler.jar

No commit comments for this range

Something went wrong with that request. Please try again.