Skip to content

Commit

Permalink
Use older version of compiler
Browse files Browse the repository at this point in the history
Fix dev appserver imports
Fix js compilation warnings
Add js sourcemaps
  • Loading branch information
adamjmcgrath committed May 9, 2015
1 parent 8ddd5b7 commit 2c3bd2e
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ before_script:

# closure compiler
- mkdir -p vendors/closure
- wget http://dl.google.com/closure-compiler/compiler-latest.zip && unzip compiler-latest.zip -d vendors/closure
- wget https://dl.google.com/closure-compiler/compiler-20140625.zip && unzip compiler-20140625.zip -d vendors/closure
- export CLOSURE_JAR=vendors/closure/compiler.jar

# closure templates compiler
Expand Down
15 changes: 10 additions & 5 deletions scripts/compilejs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ LEADERBOARD_SOURCE=$FFC_SOURCE/leaderboard
SUGGEST_SOURCE=$FFC_SOURCE/suggest
TEMPLATE_SOURCE=$FFC_SOURCE/template
GROW_SOURCE=$FFC_PATH/lib/growjs
FFC_QUIZ_JS_OUTPUT=$FFC_PATH/static/js/quiz.js
FFC_LEADERBOARD_JS_OUTPUT=$FFC_PATH/static/js/leaderboard.js
FFC_SETTINGS_JS_OUTPUT=$FFC_PATH/static/js/settings.js
FFC_LEAGUE_FORM_JS_OUTPUT=$FFC_PATH/static/js/leagueform.js
FFC_DEPS_OUTPUT=$FFC_PATH/static/js/deps.js
JS_OUTPUT_FOLDER=$FFC_PATH/static/js
FFC_QUIZ_JS_OUTPUT=$JS_OUTPUT_FOLDER/quiz.js
FFC_LEADERBOARD_JS_OUTPUT=$JS_OUTPUT_FOLDER/leaderboard.js
FFC_LEADERBOARD_JS_MAP=$JS_OUTPUT_FOLDER/leaderboard.map
FFC_SETTINGS_JS_OUTPUT=$JS_OUTPUT_FOLDER/settings.js
FFC_LEAGUE_FORM_JS_OUTPUT=$JS_OUTPUT_FOLDER/leagueform.js
FFC_DEPS_OUTPUT=$JS_OUTPUT_FOLDER/deps.js
EXTERNS_SOURCE=$FFC_SOURCE/externs


Expand Down Expand Up @@ -83,9 +85,12 @@ if [ $1 == "leaderboard" ] || [ $1 == "all" ]; then
--output_mode=compiled \
--compiler_jar=$CLOSURE_COMPILER_PATH \
--compiler_flags="--compilation_level=ADVANCED_OPTIMIZATIONS" \
--compiler_flags="--create_source_map=$JS_OUTPUT_FOLDER/leaderboard.map" \
--compiler_flags="--externs=$EXTERNS_SOURCE/channel.js" \
--compiler_flags="--output_wrapper=\"(function() {%output%})();\"" \
> $FFC_LEADERBOARD_JS_OUTPUT

echo "//# sourceMappingURL=/static/js/leaderboard.map" >> $FFC_LEADERBOARD_JS_OUTPUT
fi

if [ $1 == "settings" ] || [ $1 == "all" ]; then
Expand Down
27 changes: 6 additions & 21 deletions scripts/restore_dev_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,13 @@

import os
import sys
sys.path.append('/usr/local/google_appengine')
import dev_appserver

APPENGINE_PATH = '/usr/local/google_appengine/'

def fix_appengine_path():
EXTRA_PATHS = [
APPENGINE_PATH,
os.path.join(APPENGINE_PATH, 'lib', 'antlr3'),
os.path.join(APPENGINE_PATH, 'lib', 'django'),
os.path.join(APPENGINE_PATH, 'lib', 'fancy_urllib'),
os.path.join(APPENGINE_PATH, 'lib', 'ipaddr'),
os.path.join(APPENGINE_PATH, 'lib', 'webapp2'),
os.path.join(APPENGINE_PATH, 'lib', 'webob-1.1.1'),
os.path.join(APPENGINE_PATH, 'lib', 'yaml', 'lib'),
os.path.join(APPENGINE_PATH, 'lib', 'webapp2-2.5.2'),
os.path.join(APPENGINE_PATH, 'lib', 'jinja2-2.6'),
]
sys.path.extend(EXTRA_PATHS)

fix_appengine_path()

# Add models to path.
sys.path.insert(0, '/Users/adammcgrath/dev/projects/ffc/src/')
dev_appserver.fix_sys_path()

dir = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(dir, '../src'))

from google.appengine.ext import ndb
from google.appengine.ext.remote_api import remote_api_stub
Expand Down
3 changes: 3 additions & 0 deletions src/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ handlers:
static_files: static/img/favicon.ico
upload: static/img/favicon\.ico

- url: /static/js/src/
static_dir: .

- url: /static
static_dir: static

Expand Down
2 changes: 1 addition & 1 deletion src/javascript/leaderboard/leaderboardmodel.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ ffc.leaderboard.LeaderBoardModel.prototype.sort = function(sort, dir) {


/**
* @param {Object} result The service result.
* @param {Object} data The service result.
*/
ffc.leaderboard.LeaderBoardModel.prototype.handleResult = function(data) {
this.previousValue = data['prev'];
Expand Down

0 comments on commit 2c3bd2e

Please sign in to comment.