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
grunt
dev
grunt prod
default action, minifies and runs unit testsjshint
coffeelint
concurrent:test
test:unit
build
grunt build
main build actionclean:dist
i18n
concurrent:dist
concat
ngAnnotate
copy:dist
cssmin
uglify
grunt build-dev
clean:dist
i18n
concurrent:server
concat
copy:dist
grunt dev
kicks off dev tasksnewer:jshint
newer:coffeelint
concurrent:test
test:unit
build-dev
watch
grunt watch
monitors for changesgrunt test
runs test suitegrunt test:unit
runs unit testsgrunt debug-karma
runs karma in Chrome for debugginggrunt custom-karma
runs karma without any overridesgrunt docs
generates test plan documentation from automated testsgrunt poedit-basepath
updates the base path for POEdit files to your local path
###Subtasks
jshint
Validate files with JSHintuglify
Minify files with UglifyJSconcat
Concatenate filescssmin
Minify CSSimagemin
Minify PNG and JPEG imagescopy
Copy filesclean
Clean files and folderscompass
Compile Sass to CSS using Compasscoffee
Compile CoffeeScript files into JavaScriptconnect
Start a connect web serverconcurrent
Run grunt tasks concurrentlynewer
Run a task with only those source files that have been modifiednewer-clean
Remove cached timestampsngAnnotate
Annotate AngularJS scripts for minificationkarma
run karmshell
Run 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
casperEnabled
if false, casperjs tests will not be added to the output even if the casperjs folder exists, defaults totrue
phpEnabled
if false, PHPUnit tests will not be added to the output even if the phpunit folder exists, defaults totrue
dir
the directory where tests are kept, defaults to./test/
target
the 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