diff --git a/.gitignore b/.gitignore index d2c07b634..e2de35dd2 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,4 @@ phpunit.xml # General NOTES.md +apigen/ diff --git a/Gruntfile.js b/Gruntfile.js index 2c37e7349..7c6662477 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -85,24 +85,15 @@ module.exports = function(grunt) { '__ngettext_noop:1,2,3d', '_c:1,2d', '_nc:1,2,4c,5d' - ] - }, - files: { - src: [ - '**/*.php', // Include all files - '!node_modules/**', // Exclude node_modules/ - ], - expand: true - } - }, - - exec: { - txpull: { // Pull Transifex translation - grunt exec:txpull - cmd: 'tx pull -a -f' // Change the percentage with --minimum-perc=yourvalue - }, - txpush_s: { // Push pot to Transifex - grunt exec:txpush_s - cmd: 'tx push -s' + ] }, + files: { + src: [ + '**/*.php', // Include all files + '!node_modules/**', // Exclude node_modules/ + ], + expand: true + } }, // concat: { @@ -284,6 +275,24 @@ module.exports = function(grunt) { } }, + exec: { + txpull: { // Pull Transifex translation - grunt exec:txpull + cmd: 'tx pull -a -f' // Change the percentage with --minimum-perc=yourvalue + }, + txpush_s: { // Push pot to Transifex - grunt exec:txpush_s + cmd: 'tx push -s' + }, + apigen: { + cmd: [ + 'rm -r ~/Sites/wpengine/api', + 'echo "Old API docs removed"', + 'apigen generate --config apigen/apigen.neon --debug', + 'echo "Docs regenerated"', + 'php apigen/hook-docs.php' + ].join( '&&' ) + } + }, + }); grunt.registerTask('styles', ['sass', 'csscomb', 'cmq', 'cssjanus','cssmin']); @@ -291,6 +300,9 @@ module.exports = function(grunt) { grunt.registerTask('tests', ['asciify', 'jshint', 'phpunit']); grunt.registerTask('default', ['styles', 'js', 'tests']); + // apigen + grunt.registerTask('apigen', ['exec:apigen']); + // Checktextdomain and makepot task(s) grunt.registerTask('build:i18n', ['checktextdomain', 'makepot', 'newer:potomo']);