Gruntfile.js cleanup & removed unused dependency

- grunt-open is no longer needed
- grunt build isn't used, so get rid.
This commit is contained in:
Hannah Wolfe 2013-11-01 15:33:49 +00:00
parent a395361e6e
commit 56ea2bb557
2 changed files with 63 additions and 65 deletions

View File

@ -47,11 +47,10 @@ var path = require('path'),
build: buildDirectory,
nightlyBuild: path.join(buildDirectory, 'nightly'),
weeklyBuild: path.join(buildDirectory, 'weekly'),
buildBuild: path.join(buildDirectory, 'build'),
releaseBuild: path.join(buildDirectory, 'release'),
dist: distDirectory,
nightlyDist: path.join(distDirectory, 'nightly'),
weeklyDist: path.join(distDirectory, 'weekly'),
buildDist: path.join(distDirectory, 'build'),
releaseDist: path.join(distDirectory, 'release')
},
buildType: 'Build',
@ -121,14 +120,6 @@ var path = require('path'),
}
},
// Open the site in a browser
open: {
server: {
// TODO: Load this port from config?
path: 'http://127.0.0.1:2368'
}
},
// JSLint all the things!
jslint: {
server: {
@ -300,8 +291,8 @@ var path = require('path'),
},
clean: {
build: {
src: ['<%= paths.buildBuild %>/**']
release: {
src: ['<%= paths.releaseBuild %>/**']
},
test: {
src: ['content/data/ghost-test.db']
@ -323,11 +314,11 @@ var path = require('path'),
dest: '<%= paths.weeklyBuild %>/<%= pkg.version %>/'
}]
},
build: {
release: {
files: [{
expand: true,
src: buildGlob,
dest: '<%= paths.buildBuild %>/'
dest: '<%= paths.releaseBuild %>/'
}]
}
},
@ -349,20 +340,12 @@ var path = require('path'),
cwd: '<%= paths.weeklyBuild %>/<%= pkg.version %>/',
src: ['**']
},
build: {
options: {
archive: '<%= paths.buildDist %>/Ghost-Build.zip'
},
expand: true,
cwd: '<%= paths.buildBuild %>/',
src: ['**']
},
release: {
options: {
archive: '<%= paths.releaseDist %>/Ghost-<%= pkg.version %>.zip'
},
expand: true,
cwd: '<%= paths.buildBuild %>/',
cwd: '<%= paths.releaseBuild %>/',
src: ['**']
}
},
@ -793,6 +776,9 @@ var path = require('path'),
});
});
// ## Tools for packaging builds - these can be weeklies, nightlies or releases
/* These tools are currently unused
grunt.registerTask('nightly',
'Nightly builds\n' +
' - Do our standard build steps (sass, handlebars, etc)\n' +
@ -815,7 +801,15 @@ var path = require('path'),
'compress:nightly'
]);
grunt.registerTask('weekly', [
grunt.registerTask('weekly',
'Weekly builds\n' +
' - Do our standard build steps (sass, handlebars, etc)\n' +
' - Bump patch version in package.json, commit, tag and push\n' +
' - Generate changelog for the past 14 releases\n' +
' - Copy files to build-folder/#/#{version} directory\n' +
' - Clean out unnecessary files (travis, .git*, .af*, .groc*)\n' +
' - Zip files in build folder to dist-folder/#{version} directory',
[
'setCurrentBuildType:Weekly',
'shell:bourbon',
'sass:compress',
@ -828,28 +822,24 @@ var path = require('path'),
'copy:weekly',
'compress:weekly'
]);
*/
grunt.registerTask('build', [
grunt.registerTask('release',
'Release task - creates a final built zip\n' +
' - Do our standard build steps (sass, handlebars, etc)\n' +
' - Generate changelog for the past 14 releases\n' +
' - Copy files to release-folder/#/#{version} directory\n' +
' - Clean out unnecessary files (travis, .git*, .af*, .groc*)\n' +
' - Zip files in release-folder to dist-folder/#{version} directory',
[
'shell:bourbon',
'sass:compress',
'handlebars',
'concat',
'uglify',
'changelog',
'clean:build',
'copy:build',
'compress:build'
]);
grunt.registerTask('release', [
'shell:bourbon',
'sass:admin',
'handlebars',
'concat',
'uglify',
'changelog',
'clean:build',
'copy:build',
'clean:release',
'copy:release',
'compress:release'
]);
@ -863,8 +853,8 @@ var path = require('path'),
'watch'
]);
// TODO: Git submodule init/update (https://github.com/jaubourg/grunt-update-submodules)?
grunt.registerTask('init', 'Prepare the project for development', ['shell:bourbon', 'default']);
// ## Running the test suites
grunt.registerTask('test-unit', 'Run unit tests', ['clean:test', 'setTestEnv', 'loadConfig', 'express:test', 'mochacli:all']);
@ -874,13 +864,22 @@ var path = require('path'),
grunt.registerTask('validate', 'Run tests and lint code', ['jslint', 'test-unit', 'test-integration', 'test-functional']);
// ## Documentation
grunt.registerTask('docs', 'Generate Docs', ['groc']);
// TODO: Production build task that minifies with uglify:prod
grunt.registerTask('prod', ['sass:compress', 'handlebars', 'concat', 'uglify']);
// ## Tools for building assets
// TODO: Git submodule init/update (https://github.com/jaubourg/grunt-update-submodules)?
grunt.registerTask('init', 'Prepare the project for development', ['shell:bourbon', 'default']);
// Before running in production mode
grunt.registerTask('prod', 'Build CSS, JS & templates for production', ['sass:compress', 'handlebars', 'concat', 'uglify']);
// When you just say 'grunt'
grunt.registerTask('default', ['sass:compress', 'handlebars', 'concat']);
grunt.registerTask('default', 'Build CSS, JS & templates for development', ['sass:compress', 'handlebars', 'concat']);
};
module.exports = configureGrunt;

View File

@ -68,7 +68,6 @@
"grunt-groc": "~0.4.0",
"grunt-jslint": "~1.1.1",
"grunt-mocha-cli": "~1.3.0",
"grunt-open": "~0.2.2",
"grunt-shell": "~0.5.0",
"matchdep": "~0.3.0",
"mocha": "~1.13.0",