Skip to content
This repository was archived by the owner on Aug 1, 2019. It is now read-only.

Commit

Permalink
Add compatibility with node 6 / npm 3
Browse files Browse the repository at this point in the history
- directly depend on closure-util;
- add Travis tests using node 6 (current) and node 4 (LTS).
- depend on a working lessc version:
  less/less.js#2881
  • Loading branch information
gberaudo committed Apr 28, 2016
1 parent 714f77d commit 6bec4bd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ python:
addons:
postgresql: "9.4"

env:
- TRAVIS_NODE_VERSION="6"
- TRAVIS_NODE_VERSION="4"

install:
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
- npm -version
- make -f config/travis .build/dev-requirements.timestamp
- make -f config/travis install

Expand Down
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
SITE_PACKAGES = $(shell .build/venv/bin/python -c "import distutils; print(distutils.sysconfig.get_python_lib())" 2> /dev/null)
TEMPLATE_FILES_IN = $(filter-out ./.build/% ./node_modules/% ./v6_api/%, $(shell find . -type f -name '*.in'))
TEMPLATE_FILES = $(TEMPLATE_FILES_IN:.in=)
CLOSURE_UTIL_PATH := openlayers/node_modules/closure-util
CLOSURE_LIBRARY_PATH = $(shell node -e 'process.stdout.write(require("$(CLOSURE_UTIL_PATH)").getLibraryPath())' 2> /dev/null)
CLOSURE_COMPILER_PATH = $(shell node -e 'process.stdout.write(require("$(CLOSURE_UTIL_PATH)").getCompilerPath())' 2> /dev/null)
CLOSURE_LIBRARY_PATH = $(shell node -e 'process.stdout.write(require("closure-util").getLibraryPath())' 2> /dev/null)
CLOSURE_COMPILER_PATH = $(shell node -e 'process.stdout.write(require("closure-util").getCompilerPath())' 2> /dev/null)
OL_JS_FILES = $(shell find node_modules/openlayers/src/ol -type f -name '*.js' 2> /dev/null)
NGEO_JS_FILES = $(shell find node_modules/ngeo/src -type f -name '*.js' 2> /dev/null)
APP_JS_FILES = $(shell find c2corg_ui/static/js -type f -name '*.js')
Expand Down Expand Up @@ -110,7 +109,7 @@ c2corg_ui/locale/%/LC_MESSAGES/c2corg_ui-client.po: c2corg_ui/locale/c2corg_ui-c

c2corg_ui/static/build/build.js: build.json c2corg_ui/static/build/templatecache.js $(OL_JS_FILES) $(NGEO_JS_FILES) $(APP_JS_FILES) .build/node_modules.timestamp
mkdir -p $(dir $@)
./node_modules/openlayers/node_modules/.bin/closure-util build $< $@
./node_modules/.bin/closure-util build $< $@

c2corg_ui/static/build/build.min.css: $(LESS_FILES) .build/node_modules.timestamp
mkdir -p $(dir $@)
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"scripts": {},
"license": "BSD",
"dependencies": {
"closure-util": "1.10.0",
"angular-moment": "^1.0.0-beta.4",
"angular-ui-bootstrap": "1.1.2",
"async": "1.5.2",
Expand All @@ -20,7 +21,7 @@
"angular-gettext-tools": "2.1.11",
"openlayers": "git://github.com/openlayers/ol3#9baa296a49a75045e756089516f610c58cdc82eb",
"ngeo": "git://github.com/camptocamp/ngeo#fd9174ae4ee49c0ace7265f6263d7bf24c658786",
"less": "2.6.0",
"less": "git://github.com/less/less.js#ec04a03f1cba3a092d5cd7f7c5d8e28bb43c1932",
"less-plugin-clean-css": "1.5.1",
"nomnom": "1.8.1",
"typeahead.js": "0.11.1",
Expand Down

0 comments on commit 6bec4bd

Please sign in to comment.