vizicities/Gruntfile.js

166 wiersze
4.0 KiB
JavaScript

2013-10-30 23:35:47 +00:00
module.exports = function(grunt) {
var port = grunt.option('port') || 8000;
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! ViziCities <%= grunt.template.today("yyyy-mm-dd") %> */\n',
beautify : {
ascii_only : true
}
2013-10-30 23:35:47 +00:00
},
build: {
src: 'build/vizi.js',
dest: 'build/vizi.min.js'
}
},
concat: {
options: {},
dist: {
// src: ['src/shared/vendor/underscore.js', 'src/shared/vendor/three.js', 'src/client/*'],
src: [
'src/shared/vendor/underscore.js',
2013-10-31 14:45:46 +00:00
'src/shared/vendor/q.js',
2013-10-31 01:08:31 +00:00
'src/shared/vendor/three/three.js',
'src/shared/vendor/three/ColorConverter.js',
2013-11-01 01:08:53 +00:00
'src/shared/vendor/d3.js',
'src/shared/vendor/catiline.js',
'src/shared/vendor/dat.gui.js',
'src/shared/vendor/fpsmeter.js',
'src/shared/vendor/moment.js',
2014-02-15 14:11:13 +00:00
'src/shared/vendor/simplify.js',
'src/shared/vendor/throat.js',
2013-10-30 23:35:47 +00:00
'src/client/Vizi.js',
'src/client/Log.js',
'src/client/Mediator.js',
2014-07-01 15:54:41 +00:00
'src/client/Animation.js',
'src/client/debug/Dat.js',
'src/client/debug/FPS.js',
2013-11-01 14:35:33 +00:00
'src/client/debug/RendererInfo.js',
2013-11-03 20:21:57 +00:00
'src/client/ui/Loading.js',
2014-05-10 14:44:03 +00:00
'src/client/ui/Attribution.js',
2014-07-03 18:06:08 +00:00
'src/client/ui/OSMEdit.js',
2013-11-01 01:08:53 +00:00
'src/client/Geo.js',
2013-10-30 23:35:47 +00:00
'src/client/City.js',
'src/client/Loop.js',
2013-11-01 17:55:26 +00:00
'src/client/DOMEvents.js',
2013-10-30 23:35:47 +00:00
'src/client/webgl/WebGL.js',
'src/client/webgl/Scene.js',
2013-10-31 01:08:31 +00:00
'src/client/webgl/Camera.js',
2013-10-31 14:45:46 +00:00
'src/client/webgl/Renderer.js',
'src/client/objects/ObjectManager.js',
'src/client/objects/ObjectManagerOverpass.js',
2013-10-31 14:45:46 +00:00
'src/client/objects/Object.js',
2013-11-01 01:08:53 +00:00
'src/client/objects/Floor.js',
'src/client/data/Data.js',
'src/client/data/DataOverpass.js',
'src/client/Grid.js',
2014-02-12 21:53:39 +00:00
'src/client/controls/Mouse.js',
'src/client/controls/Keyboard.js',
'src/client/controls/Controls.js',
'src/client/Cache.js'
2013-10-30 23:35:47 +00:00
],
dest: 'build/vizi.js'
}
},
jshint: {
options: {
force: true,
2013-10-30 23:35:47 +00:00
curly: false,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
eqnull: true,
browser: true,
expr: true,
globals: {
head: false,
module: false,
console: false,
importScripts: true
2013-10-30 23:35:47 +00:00
},
ignores: ['src/shared/vendor/**']
},
files: [ 'Gruntfile.js', 'src/**' ]
},
2014-02-04 00:09:28 +00:00
mocha_phantomjs: {
files: ['test/*.html']
},
2013-10-30 23:35:47 +00:00
watch: {
main: {
files: [ 'Gruntfile.js', 'src/**', 'examples/**' ],
tasks: 'default',
options: {
livereload: 35730
2013-10-30 23:35:47 +00:00
}
}
},
connect: {
server: {
options: {
port: port,
// change hostname to 0.0.0.0 to open it up
hostname: 'localhost',
base: '.',
keepalive: true,
debug: true
2013-10-30 23:35:47 +00:00
}
}
},
notify: {
watch: {
2013-10-30 23:35:47 +00:00
options: {
// title: 'Watching files', // optional
message: 'Watching for changes' //required
}
},
finish: {
options: {
// title: 'Watching files', // optional
message: 'Build complete' //required
}
}
},
notify_hooks: {
options: {
enabled: true,
max_jshint_notifications: 5,
title: "ViziCities"
}
}
});
// Load the plugins
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-notify');
2014-02-04 00:09:28 +00:00
grunt.loadNpmTasks('grunt-mocha-phantomjs');
2013-10-30 23:35:47 +00:00
// Default task(s).
// grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'notify:finish']);
grunt.registerTask('default', ['jshint', 'concat', 'notify:finish']);
2013-10-30 23:35:47 +00:00
// Serve examples locally
grunt.registerTask('serve', ['connect']);
2013-10-30 23:35:47 +00:00
// Build files and refresh content on file changes
grunt.registerTask('dev', ['default', 'notify:watch', 'watch']);
2013-10-30 23:35:47 +00:00
2014-02-15 17:59:11 +00:00
// Minify
grunt.registerTask('min', ['jshint', 'concat', 'uglify', 'notify:finish']);
2014-02-03 22:14:27 +00:00
// Run tests
2014-02-04 00:09:28 +00:00
grunt.registerTask('test', ['jshint', 'mocha_phantomjs']);
2014-02-03 22:14:27 +00:00
grunt.task.run('notify_hooks');
};