UNPKG

grunt-pugpig-editions-xml

Version:
83 lines (72 loc) 1.82 kB
/* * grunt-pugpig-editions-xml * * * Copyright (c) 2014 Daniel Furze * Licensed under the MIT license */ 'use strict'; module.exports = function (grunt) { // Load all npm grunt tasks require('load-grunt-tasks')(grunt); // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), config: { 'result': 'test/result/' }, 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: [ '<%= config.result %>' ] }, // Configuration to be run pugpig_editions_xml: { default_options: { options: { author: '<%= pkg.author.name %>', coverSrc: 'pubs/2015/cover.jpg', dest: '<%= config.result %>', editionName: '2015', fileName: 'editions', id: 'com.furzeface.daniel', issuesSrc: 'pubs/2015/issue.xml', selfLink: 'https://s3-eu-west-1.amazonaws.com/furzeface-cdn/editions.xml', summaryText: 'My First Publication Summary', title: 'My First Publication' } } }, // 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 results dir, then run this plugin's task(s), then test the result. grunt.registerTask('test', [ 'clean', 'pugpig_editions_xml', 'nodeunit' ]); // By default, lint and run all tests. grunt.registerTask('default', [ 'jshint', 'test' ]); };