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