alltube/Gruntfile.js

163 lines
5.6 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
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: {
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: {
standard: 'PSR12',
2016-08-01 03:16:33 +02:00
bin: 'vendor/bin/phpcs'
2016-03-30 01:49:08 +02:00
},
2015-04-13 00:53:05 +02:00
php: {
2019-10-03 21:41:54 +02:00
src: ['*.php', 'classes/*.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
}
},
2019-03-31 17:18:57 +02:00
phpstan: {
options: {
level: 'max',
bin: 'vendor/bin/phpstan',
config: 'phpstan.neon'
2019-03-31 17:18:57 +02:00
},
php: {
src: ['*.php', 'classes/*.php', 'controllers/*.php']
},
tests: {
src: ['tests/*.php']
}
},
2016-06-22 12:02:48 +02:00
jslint: {
2015-04-13 00:53:05 +02:00
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',
2016-08-01 12:28:35 +02:00
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'
},
src: ['*.php', 'config/*', '!config/config.yml', 'dist/**', '.htaccess', 'img/**', 'LICENSE', 'README.md', 'robots.txt', 'resources/sitemap.xml', 'resources/manifest.json', 'templates/**', 'templates_c/', 'vendor/**', 'classes/**', 'controllers/**', 'bower_components/**', 'i18n/**', '!vendor/ffmpeg/**', '!vendor/bin/ffmpeg', '!vendor/anam/phantomjs-linux-x86-binary/**', '!vendor/bin/phantomjs', '!vendor/phpunit/**', '!vendor/squizlabs/**', '!vendor/rinvex/countries/resources/geodata/*.json', '!vendor/countries/country/resources/flags/*.svg', 'node_modules/open-sans-fontface/fonts/**']
}
2016-08-01 13:00:29 +02:00
},
phpdocumentor: {
doc: {
options: {
directory: 'classes/,controllers/,tests/'
}
}
2016-08-20 13:07:31 +02:00
},
jsonlint: {
manifests: {
2017-05-15 07:25:14 +02:00
src: ['*.json', 'resources/*.json'],
2016-08-20 13:07:31 +02:00
options: {
format: true
}
}
2016-08-20 13:54:14 +02:00
},
fixpack: {
package: {
src: 'package.json'
}
2017-05-29 19:11:16 +02:00
},
potomo: {
dist: {
options: {
poDel: false
},
files: {
2017-05-29 19:28:42 +02:00
'i18n/fr_FR/LC_MESSAGES/Alltube.mo': 'i18n/fr_FR/LC_MESSAGES/Alltube.po',
2017-10-12 23:45:34 +02:00
'i18n/zh_CN/LC_MESSAGES/Alltube.mo': 'i18n/zh_CN/LC_MESSAGES/Alltube.po',
2018-01-26 19:59:33 +01:00
'i18n/es_ES/LC_MESSAGES/Alltube.mo': 'i18n/es_ES/LC_MESSAGES/Alltube.po',
'i18n/de_DE/LC_MESSAGES/Alltube.mo': 'i18n/de_DE/LC_MESSAGES/Alltube.po',
'i18n/pt_BR/LC_MESSAGES/Alltube.mo': 'i18n/pt_BR/LC_MESSAGES/Alltube.po',
'i18n/ar_001/LC_MESSAGES/Alltube.mo': 'i18n/ar_001/LC_MESSAGES/Alltube.po'
2017-05-29 19:11:16 +02:00
}
}
2017-06-01 01:38:35 +02:00
},
csslint: {
2017-06-01 11:38:35 +02:00
options: {
'box-sizing': false,
'bulletproof-font-face': false
},
2017-06-01 01:38:35 +02:00
css: {
src: 'css/*'
}
2017-12-20 11:21:36 +01:00
},
markdownlint: {
doc: {
src: ['README.md', 'CONTRIBUTING.md', 'resources/*.md']
}
2019-09-21 12:53:42 +02:00
},
githooks: {
all: {
'pre-commit': 'lint'
}
}
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-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');
2016-08-01 13:00:29 +02:00
grunt.loadNpmTasks('grunt-phpdocumentor');
2016-08-20 13:07:31 +02:00
grunt.loadNpmTasks('grunt-jsonlint');
2016-08-20 13:54:14 +02:00
grunt.loadNpmTasks('grunt-fixpack');
2017-05-29 19:11:16 +02:00
grunt.loadNpmTasks('grunt-potomo');
2017-06-01 01:38:35 +02:00
grunt.loadNpmTasks('grunt-contrib-csslint');
2017-12-20 11:21:36 +01:00
grunt.loadNpmTasks('grunt-markdownlint');
2019-03-31 17:18:57 +02:00
grunt.loadNpmTasks('grunt-phpstan');
2019-09-21 12:53:42 +02:00
grunt.loadNpmTasks('grunt-githooks');
grunt.loadNpmTasks('grunt-changed');
2014-12-30 00:38:34 +01:00
2019-09-21 13:19:24 +02:00
grunt.registerTask('default', ['cssmin', 'potomo', 'phpdocumentor']);
grunt.registerTask(
'lint',
[
'csslint',
'jslint',
'fixpack',
'jsonlint',
'markdownlint',
'changed:phpcs',
'changed:phpstan'
]
);
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
};