Corrected automatic documentation generation.

This commit is contained in:
alextselegidis 2016-10-16 21:37:00 +02:00
parent 1b65423349
commit 6c85c1088b
2 changed files with 11 additions and 6 deletions

3
.gitignore vendored
View file

@ -12,3 +12,6 @@ src/storage/logs/*
src/storage/uploads/* src/storage/uploads/*
!src/storage/uploads/index.html !src/storage/uploads/index.html
src/config.php src/config.php
doc/apigen
doc/jsdoc
doc/plato

View file

@ -2,6 +2,7 @@ var gulp = require('gulp'),
exec = require('child_process').execSync, exec = require('child_process').execSync,
del = require('del'), del = require('del'),
fs = require('fs-extra'), fs = require('fs-extra'),
path = require('path'),
zip = require('zip-dir'); zip = require('zip-dir');
/** /**
@ -14,7 +15,7 @@ gulp.task('composer', function() {
del.sync([ del.sync([
'./composer', './composer',
'./src/vendor/**/*', './src/vendor/**/*',
'!./src/vendor/index.html', '!./src/vendor/index.html'
]); ]);
exec('composer update && composer install --prefer-dist', function (err, stdout, stderr) { exec('composer update && composer install --prefer-dist', function (err, stdout, stderr) {
@ -52,7 +53,7 @@ gulp.task('build', function(done) {
del.sync([ del.sync([
'.tmp-package/application/logs/*', '.tmp-package/application/logs/*',
'!.tmp-package/application/logs/index.html' '!.tmp-package/application/logs/index.html'
]) ]);
zip('.tmp-package', { saveTo: 'easyappointments.zip' }, function (err, buffer) { zip('.tmp-package', { saveTo: 'easyappointments.zip' }, function (err, buffer) {
if (err) if (err)
@ -66,10 +67,11 @@ gulp.task('build', function(done) {
* Generate code documentation. * Generate code documentation.
*/ */
gulp.task('doc', function(done) { gulp.task('doc', function(done) {
fs.removeSync('doc'); fs.removeSync('doc/apigen');
fs.mkdirSync('doc');
fs.mkdirSync('doc/apigen'); fs.mkdirSync('doc/apigen');
fs.removeSync('doc/jsdoc');
fs.mkdirSync('doc/jsdoc'); fs.mkdirSync('doc/jsdoc');
fs.removeSync('doc/plato');
fs.mkdirSync('doc/plato'); fs.mkdirSync('doc/plato');
var commands = [ var commands = [
@ -77,9 +79,9 @@ gulp.task('doc', function(done) {
'-s "src/application/controllers,src/application/models,src/application/libraries" ' + '-s "src/application/controllers,src/application/models,src/application/libraries" ' +
'-d "doc/apigen" --exclude "*external*" --tree --todo --template-theme "bootstrap"', '-d "doc/apigen" --exclude "*external*" --tree --todo --template-theme "bootstrap"',
'node node_modules/.bin/jsdoc "src/assets/js" -d "doc/jsdoc"', path.join('.', 'node_modules', '.bin', 'jsdoc') + ' "src/assets/js" -d "doc/jsdoc"',
'node node_modules/.bin/plato -r -d "doc/plato" "src/assets/js"' path.join('.', 'node_modules', '.bin', 'plato') + ' -r -d "doc/plato" "src/assets/js"'
]; ];
commands.forEach(function(command) { commands.forEach(function(command) {