diff --git a/Jakefile.js b/Jakefile.js index 5aabf9a1..f24b9566 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -9,16 +9,17 @@ var jake = require('jake'), require('jake-utils'); // constants -var VIS = './dist/vis.js'; -var VIS_CSS = './dist/vis.css'; -var VIS_TMP = './vis.js.tmp'; -var VIS_MIN = './dist/vis.min.js'; +var DIST = './dist'; +var VIS = DIST + '/vis.js'; +var VIS_CSS = DIST + '/vis.css'; +var VIS_TMP = DIST + '/vis.js.tmp'; +var VIS_MIN = DIST + '/vis.min.js'; /** * default task */ -desc('Execute all tasks: build all libraries'); -task('default', ['build', 'minify', 'test'], function () { +desc('Default task: build all libraries'); +task('default', ['build', 'minify'], function () { console.log('done'); }); @@ -27,6 +28,8 @@ task('default', ['build', 'minify', 'test'], function () { */ desc('Build the visualization library vis.js'); task('build', {async: true}, function () { + jake.mkdirP(DIST); + // concatenate and stringify the css files concat({ src: [ @@ -137,7 +140,7 @@ task('minify', function () { * test task */ desc('Test the library'); -task('test', ['build'], function () { +task('test', function () { // TODO: use a testing suite for testing: nodeunit, mocha, tap, ... var filelist = new jake.FileList(); filelist.include([ diff --git a/README.md b/README.md index a97439b5..b004b0dc 100644 --- a/README.md +++ b/README.md @@ -134,13 +134,9 @@ root of the project. cd vis npm install -To be able to run jake from the command line, jake must be installed globally: +Then, the project can be build running: - sudo npm install -g jake - -Then, the project can be build by executing jake in the root of the project: - - jake + npm run build ## License diff --git a/package.json b/package.json index b274d2b8..d6907b8b 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "browser" ], "scripts": { - "test": "jake test --trace" + "test": "jake test --trace", + "build": "jake --trace" }, "dependencies": {}, "devDependencies": { diff --git a/test/dataset.js b/test/dataset.js index 63446918..4934a7f3 100644 --- a/test/dataset.js +++ b/test/dataset.js @@ -1,6 +1,6 @@ var assert = require('assert'), moment = require('moment'), - vis = require('../vis.js'), + vis = require('../dist/vis.js'), DataSet = vis.DataSet; var now = new Date(); diff --git a/test/dataview.js b/test/dataview.js index 412caa5f..48721ece 100644 --- a/test/dataview.js +++ b/test/dataview.js @@ -1,6 +1,6 @@ var assert = require('assert'), moment = require('moment'), - vis = require('../vis.js'), + vis = require('../dist/vis.js'), DataSet = vis.DataSet, DataView = vis.DataView; diff --git a/test/eventbus.js b/test/eventbus.js index df4d8a94..9019effc 100644 --- a/test/eventbus.js +++ b/test/eventbus.js @@ -1,7 +1,7 @@ // test vis.EventBus var assert = require('assert'), - vis = require('../vis'); + vis = require('../dist/vis'); var bus = new vis.EventBus();