Skip to content

Commit

Permalink
extract configuration variables to an extra file (buils/vars.sh)
Browse files Browse the repository at this point in the history
  • Loading branch information
jankuca committed Mar 5, 2012
1 parent 0ad2fda commit f88575a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 41 deletions.
33 changes: 2 additions & 31 deletions build/compile.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Closure-boilerplate Compile Script
# Closure-Boilerplate Compile Script
# --
# @autor Jan Kuča

Expand All @@ -11,36 +11,7 @@
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



Expand Down
12 changes: 2 additions & 10 deletions build/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
\
Expand Down
36 changes: 36 additions & 0 deletions build/vars.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

# 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 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

0 comments on commit f88575a

Please sign in to comment.