grunt-pugpig-contents-xml
Version:
Generate contents XML file for PugPig publications.
70 lines (58 loc) • 1.55 kB
JavaScript
/*
* grunt-pugpig-contents-xml
* https://github.com/furzeface/grunt-pugpig-contents-xml
*
* Copyright (c) 2014 Daniel Furze
* Licensed under the MIT license.
*/
;
module.exports = function (grunt) {
// load all npm grunt tasks
require('load-grunt-tasks')(grunt);
// Project configuration.
grunt.initConfig({
jshint: {
all: [
'Gruntfile.js',
'tasks/*.js',
'<%= nodeunit.tests %>'
],
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
}
},
// Before generating any new files, remove any previously-created files.
clean: {
tests: ['tmp']
},
// Configuration to be run (and then tested).
pugpig_contents_xml: {
options: {
dest: 'tmp/',
},
default_options: {
options: {
fileName: 'content',
id: 'com.spotlight.contacts.2015',
subtitle: 'Contacts - The Handbook: Contacts 2015',
title: 'Contacts 2015'
},
src: [
'demo/**/*.html'
]
}
},
// Unit tests.
nodeunit: {
tests: ['test/*_test.js']
}
});
// Actually load this plugin's task(s).
grunt.loadTasks('tasks');
// Whenever the "test" task is run, first clean the "tmp" dir, then run this
// plugin's task(s), then test the result.
grunt.registerTask('test', ['clean', 'pugpig_contents_xml', 'nodeunit']);
// By default, lint and run all tests.
grunt.registerTask('default', ['jshint', 'test']);
};