2014-06-18 21:39:05 +00:00
|
|
|
module.exports = function(grunt) {
|
|
|
|
|
|
|
|
// Project configuration.
|
|
|
|
grunt.initConfig({
|
|
|
|
//pkg: grunt.file.readJSON('package.json'),
|
|
|
|
jsdoc : {
|
|
|
|
src : {
|
2014-06-22 02:56:51 +00:00
|
|
|
src: ['../Tone/**/*.js', '../README.md'],
|
|
|
|
//src: ['../Tone.js'],
|
2014-06-18 21:39:05 +00:00
|
|
|
options: {
|
2014-06-19 17:38:21 +00:00
|
|
|
destination: '../doc',
|
2014-06-22 02:02:41 +00:00
|
|
|
//configure: './config/jsdoc.conf.json',
|
|
|
|
template : "./doc_config/template",
|
|
|
|
configure : "./doc_config/template/jsdoc.conf.json"
|
|
|
|
//template : "readable",
|
2014-06-18 21:39:05 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
dist : {
|
|
|
|
src: ['../Tone.js'],
|
|
|
|
options: {
|
|
|
|
destination: '../doc'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
requirejs : {
|
|
|
|
compile: {
|
|
|
|
options: {
|
|
|
|
baseUrl: "../",
|
|
|
|
name : "main",
|
|
|
|
out: "./Tone.js.tmp",
|
|
|
|
optimize : "none"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
concat: {
|
|
|
|
dist: {
|
|
|
|
options: {
|
|
|
|
// Replace all 'use strict' statements in the code with a single one at the top
|
|
|
|
banner: "require([",
|
|
|
|
separator: ',',
|
|
|
|
process: function(src, filepath) {
|
|
|
|
// remove the '.js'. h@ckz0rs.
|
|
|
|
return '"' + filepath.substring(3,(filepath.length-3)) + '"';
|
|
|
|
},
|
|
|
|
footer: "], function(){});",
|
|
|
|
|
|
|
|
},
|
|
|
|
files: {
|
|
|
|
'../main.js': ['../Tone/**/*.js'],
|
|
|
|
}
|
|
|
|
},
|
|
|
|
removeRequireString: {
|
|
|
|
options: {
|
|
|
|
process: function(src, filepath) {
|
|
|
|
// remove the '.js'. h@ckz0rs.
|
|
|
|
var withoutRequire = src.substr(0, src.indexOf("require([") - 1);
|
|
|
|
return withoutRequire;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
files: {
|
|
|
|
'../Tone.js': ['./Tone.js.tmp'],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
clean: {
|
|
|
|
options: {
|
|
|
|
force: true,
|
|
|
|
},
|
|
|
|
dist: ['../main.js','./Tone.js.tmp']
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// Load the plugin that provides the "uglify" task.
|
|
|
|
grunt.loadNpmTasks('grunt-jsdoc');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-requirejs');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-concat');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-clean');
|
|
|
|
|
|
|
|
// Default task(s).
|
|
|
|
grunt.registerTask('src', ['jsdoc:src']);
|
|
|
|
grunt.registerTask('dist', ['concat:dist','requirejs:compile','concat:removeRequireString','clean:dist','jsdoc:dist']);
|
2014-06-20 15:15:43 +00:00
|
|
|
grunt.registerTask('build', ['concat:dist','requirejs:compile','concat:removeRequireString','clean:dist']);
|
2014-06-18 21:39:05 +00:00
|
|
|
|
|
|
|
};
|