Contains common grunt configuration
Require cornerstone-grunt in your Gruntfile.js and pass the grunt object to it. The module will initialize common grunt configuration in your project.
var cornerstone = require('cornerstone-grunt');
module.exports = function(grunt){
cornerstone(grunt);
};You may override any of the default configuration by passing another object as the second parameter to cornerstone-grunt.
var config = {
module: "module/app",
mainCss: [
"<%= module %>/css<%= sassOut %>base.css",
"<%= module %>/css<%= sassOut %>theme.css"
]
};
cornerstone(grunt, config);You may then attach any new tasks to the grunt object. Include any configuration for the new tasks in the config override.
grunt.loadNpmTasks('grunt-browserify-bower');You may override any of these variables to customize how grunt behaves.
- yeoman.dist: the distribution directory
- yeoman.app: the top level where your javascript and sass are contained, assumed to be in styles/ and scripts/ folders respectively
- bowerCssFiles: an array of bower css to combine and minify into vendor.css
- bowerJsFiles: an array of bower js files to combine and uglify into vendor.js
- testSetupTasks: an array of tasks that will be run concurrently before the unit tests,
add any setup you need for unit tests here.
If some of your tasks cannot be concurrent, provide a task that runs your sequential tasks
It cannot be an empty array.
grunt.registerTask('myTask', ['taskOne', 'taskTwo']) testSetupTasks: ['myTask']
The following tasks are set up by cornerstone-grunt
###Main Tasks
gruntdev
grunt proddefault action, minifies and runs unit testsjshintcoffeelintconcurrent:testtest:unitbuild
grunt buildmain build actionclean:disti18nconcurrent:distconcatngAnnotatecopy:distcssminuglify
grunt build-devclean:disti18nconcurrent:serverconcatcopy:dist
grunt devkicks off dev tasksnewer:jshintnewer:coffeelintconcurrent:testtest:unitbuild-devwatchgrunt watchmonitors for changesgrunt testruns test suitegrunt test:unitruns unit testsgrunt debug-karmaruns karma in Chrome for debugginggrunt custom-karmaruns karma without any overridesgrunt docsgenerates test plan documentation from automated testsgrunt poedit-basepathupdates the base path for POEdit files to your local path
###Subtasks
jshintValidate files with JSHintuglifyMinify files with UglifyJSconcatConcatenate filescssminMinify CSSimageminMinify PNG and JPEG imagescopyCopy filescleanClean files and folderscompassCompile Sass to CSS using CompasscoffeeCompile CoffeeScript files into JavaScriptconnectStart a connect web serverconcurrentRun grunt tasks concurrentlynewerRun a task with only those source files that have been modifiednewer-cleanRemove cached timestampsngAnnotateAnnotate AngularJS scripts for minificationkarmarun karmshellRun shell commands
###Custom Tasks
####docs
Generates test plan documentation from automated tests. It will look through the configured folder (the default folder is ./test), for the subfolders "phpunit" and "casperjs". If these folders exist it will traverse all of the tests in these folders and generate an md file that lists all of the test descriptions. For casperjs these are GIVEN, THEN, WHEN statements.
######Options
casperEnabledif false, casperjs tests will not be added to the output even if the casperjs folder exists, defaults totruephpEnabledif false, PHPUnit tests will not be added to the output even if the phpunit folder exists, defaults totruedirthe directory where tests are kept, defaults to./test/targetthe output file, defaults to./doc/TestPlan.md
To override the default configuration, you would need to add something similar to the following to Grunt's configuration:
{
docs: {
dir: "./test/",
target: "./doc/TestPlan.md"
}
}Copyright:: 2014 web-masons Contributors
Licensed under the Apache License, Version 2.0 (the 'License'); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request