2013-03-11 19:14:26 +00:00
|
|
|
module.exports = function(grunt) {
|
|
|
|
|
|
|
|
// Project configuration.
|
|
|
|
grunt.initConfig({
|
|
|
|
pkg: grunt.file.readJSON('package.json'),
|
|
|
|
|
|
|
|
clean: ['dist/'],
|
|
|
|
|
|
|
|
uglify: {
|
|
|
|
options: {
|
|
|
|
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
|
|
|
|
},
|
|
|
|
develop: {
|
2014-01-14 15:56:36 +00:00
|
|
|
src: 'dist/filer.js',
|
|
|
|
dest: 'dist/filer.min.js'
|
2013-03-11 19:14:26 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2013-11-08 20:33:44 +00:00
|
|
|
jshint: {
|
|
|
|
// Don't bother with src/path.js
|
2014-02-15 20:43:38 +00:00
|
|
|
all: [
|
|
|
|
'gruntfile.js',
|
|
|
|
'src/constants.js',
|
2014-03-10 18:28:22 +00:00
|
|
|
'src/errors.js',
|
2014-02-15 20:43:38 +00:00
|
|
|
'src/fs.js',
|
|
|
|
'src/index.js',
|
|
|
|
'src/shared.js',
|
|
|
|
'src/shell.js',
|
2014-03-08 01:21:10 +00:00
|
|
|
'src/fswatcher.js',
|
|
|
|
'src/environment.js',
|
2014-02-15 20:43:38 +00:00
|
|
|
'src/providers/**/*.js',
|
2014-03-18 16:29:20 +00:00
|
|
|
'src/adapters/**/*.js',
|
|
|
|
'src/directory-entry.js',
|
|
|
|
'src/open-file-description.js',
|
|
|
|
'src/super-node.js',
|
|
|
|
'src/node.js',
|
2014-03-18 18:16:12 +00:00
|
|
|
'src/stats.js',
|
|
|
|
'src/filesystem/**/*.js'
|
2014-02-15 20:43:38 +00:00
|
|
|
]
|
2013-11-08 20:33:44 +00:00
|
|
|
},
|
|
|
|
|
2014-03-27 01:07:10 +00:00
|
|
|
connect: {
|
|
|
|
server: {
|
|
|
|
options: {
|
|
|
|
port: 9001,
|
|
|
|
hostname: '127.0.0.1',
|
|
|
|
base: '.'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2014-01-21 21:25:09 +00:00
|
|
|
mocha: {
|
|
|
|
test: {
|
|
|
|
options: {
|
2014-03-27 01:07:10 +00:00
|
|
|
log: true,
|
|
|
|
urls: [ 'http://127.0.0.1:9001/tests/index.html' ]
|
2014-01-21 21:25:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2013-03-11 19:14:26 +00:00
|
|
|
requirejs: {
|
|
|
|
develop: {
|
|
|
|
options: {
|
|
|
|
paths: {
|
|
|
|
"src": "../src",
|
2014-03-12 20:49:20 +00:00
|
|
|
"build": "../build"
|
2013-03-11 19:14:26 +00:00
|
|
|
},
|
|
|
|
baseUrl: "lib",
|
|
|
|
name: "build/almond",
|
2013-12-15 03:36:24 +00:00
|
|
|
include: ["src/index"],
|
2014-01-14 15:56:36 +00:00
|
|
|
out: "dist/filer.js",
|
2013-03-11 19:14:26 +00:00
|
|
|
optimize: "none",
|
|
|
|
wrap: {
|
|
|
|
startFile: 'build/wrap.start',
|
|
|
|
endFile: 'build/wrap.end'
|
2013-11-27 18:08:26 +00:00
|
|
|
},
|
|
|
|
shim: {
|
2013-12-02 20:10:43 +00:00
|
|
|
// TextEncoder and TextDecoder shims. encoding-indexes must get loaded first,
|
|
|
|
// and we use a fake one for reduced size, since we only care about utf8.
|
2013-11-27 18:08:26 +00:00
|
|
|
"encoding": {
|
2013-12-02 20:10:43 +00:00
|
|
|
deps: ["encoding-indexes-shim"]
|
2013-11-27 18:08:26 +00:00
|
|
|
}
|
2013-03-11 19:14:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-11-27 18:08:26 +00:00
|
|
|
}
|
2013-03-11 19:14:26 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-clean');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-requirejs');
|
2013-11-08 20:33:44 +00:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-jshint');
|
2014-01-21 21:25:09 +00:00
|
|
|
grunt.loadNpmTasks('grunt-mocha');
|
2014-03-27 01:07:10 +00:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-connect');
|
2013-03-11 19:14:26 +00:00
|
|
|
|
|
|
|
grunt.registerTask('develop', ['clean', 'requirejs']);
|
|
|
|
grunt.registerTask('release', ['develop', 'uglify']);
|
2013-11-08 20:33:44 +00:00
|
|
|
grunt.registerTask('check', ['jshint']);
|
2014-03-27 01:07:10 +00:00
|
|
|
grunt.registerTask('test', ['check', 'connect', 'mocha']);
|
2013-03-11 19:14:26 +00:00
|
|
|
|
|
|
|
grunt.registerTask('default', ['develop']);
|
2013-11-22 21:12:31 +00:00
|
|
|
};
|