alltube/Gruntfile.js

91 lines
2.8 KiB
JavaScript
Raw Normal View History

2014-12-30 00:38:34 +01:00
/*jslint node: true */
module.exports = function (grunt) {
'use strict';
2015-04-13 00:53:05 +02:00
grunt.initConfig(
{
2016-04-29 21:34:57 +02:00
githash: {
main: {
options: {}
}
},
2015-04-13 00:53:05 +02:00
uglify: {
combine: {
files: {
'dist/main.js': ['js/cast.js']
}
2014-12-30 00:38:34 +01:00
}
},
2015-04-13 00:53:05 +02:00
cssmin: {
combine: {
files: {
'dist/main.css': ['css/*.css']
}
}
2015-04-13 00:52:37 +02:00
},
2015-04-13 00:53:05 +02:00
watch: {
scripts: {
files: ['js/*.js'],
tasks: ['uglify']
},
styles: {
files: ['css/*.css'],
tasks: ['cssmin']
}
2015-04-13 00:52:37 +02:00
},
2015-04-13 00:53:05 +02:00
phpcs: {
2016-03-30 01:49:08 +02:00
options: {
2016-08-01 03:16:33 +02:00
standard: 'PSR2',
bin: 'vendor/bin/phpcs'
2016-03-30 01:49:08 +02:00
},
2015-04-13 00:53:05 +02:00
php: {
2015-10-31 15:42:25 +01:00
src: ['*.php', 'classes/*.php', 'controllers/*.php']
2015-04-13 00:53:05 +02:00
},
2015-08-29 22:03:10 +02:00
tests: {
src: ['tests/*.php']
2016-06-22 12:02:48 +02:00
}
},
jslint: {
2015-04-13 00:53:05 +02:00
js: {
src: ['js/*.js']
},
Gruntfile: {
src: ['Gruntfile.js']
}
2015-08-29 22:03:10 +02:00
},
phpunit: {
2016-08-01 12:28:35 +02:00
options: {
bin: './vendor/bin/phpunit',
stopOnError: true,
stopOnFailure: true,
followOutput: true
},
2015-08-29 22:03:10 +02:00
classes: {
dir: 'tests/'
}
},
compress: {
release: {
options: {
2016-04-29 21:34:57 +02:00
archive: 'alltube-<%= githash.main.tag %>.zip'
},
2015-11-22 00:41:30 +01:00
src: ['*.php', '!config.yml', 'dist/**', 'fonts/**', '.htaccess', 'img/**', 'js/**', 'LICENSE', 'README.md', 'robots.txt', 'sitemap.xml', 'templates/**', 'templates_c/', 'vendor/**', 'classes/**', 'controllers/**', 'bower_components/**', '!vendor/ffmpeg/**', '!vendor/bin/ffmpeg']
}
2015-04-13 00:52:37 +02:00
}
2014-12-30 00:38:34 +01:00
}
2015-04-13 00:53:05 +02:00
);
2014-12-30 00:38:34 +01:00
2016-04-29 21:34:57 +02:00
grunt.loadNpmTasks('grunt-githash');
2014-12-30 00:38:34 +01:00
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-watch');
2015-04-13 00:52:37 +02:00
grunt.loadNpmTasks('grunt-phpcs');
2015-08-29 22:03:10 +02:00
grunt.loadNpmTasks('grunt-phpunit');
grunt.loadNpmTasks('grunt-contrib-compress');
2016-06-22 12:02:48 +02:00
grunt.loadNpmTasks('grunt-jslint');
2014-12-30 00:38:34 +01:00
grunt.registerTask('default', ['uglify', 'cssmin']);
2016-06-22 12:02:48 +02:00
grunt.registerTask('lint', ['phpcs', 'jslint']);
2015-08-29 22:03:10 +02:00
grunt.registerTask('test', ['phpunit']);
2016-04-29 21:34:57 +02:00
grunt.registerTask('release', ['default', 'githash', 'compress']);
2014-12-30 00:38:34 +01:00
};