2017-08-04 16:28:16 +02:00
|
|
|
// Librerie NPM richieste per l'esecuzione
|
2020-08-06 10:17:56 +02:00
|
|
|
const gulp = require('gulp');
|
|
|
|
const merge = require('merge-stream');
|
|
|
|
const del = require('del');
|
|
|
|
const debug = require('gulp-debug');
|
2017-08-04 16:28:16 +02:00
|
|
|
|
2020-08-06 10:17:56 +02:00
|
|
|
const mainBowerFiles = require('main-bower-files');
|
|
|
|
const gulpIf = require('gulp-if');
|
2017-08-04 16:28:16 +02:00
|
|
|
|
|
|
|
// Minificatori
|
2020-08-06 10:17:56 +02:00
|
|
|
const minifyJS = require('gulp-uglify');
|
|
|
|
const minifyCSS = require('gulp-clean-css');
|
|
|
|
const minifyJSON = require('gulp-json-minify');
|
2017-08-04 16:28:16 +02:00
|
|
|
|
|
|
|
// Interpretatori CSS
|
2020-08-06 10:17:56 +02:00
|
|
|
const sass = require('gulp-sass');
|
|
|
|
const less = require('gulp-less');
|
|
|
|
const stylus = require('gulp-stylus');
|
|
|
|
const autoprefixer = require('gulp-autoprefixer');
|
2017-08-04 16:28:16 +02:00
|
|
|
|
|
|
|
// Concatenatore
|
2020-08-06 10:17:56 +02:00
|
|
|
const concat = require('gulp-concat');
|
2017-08-04 16:28:16 +02:00
|
|
|
|
|
|
|
// Altro
|
2020-08-06 10:17:56 +02:00
|
|
|
const flatten = require('gulp-flatten');
|
|
|
|
const rename = require('gulp-rename');
|
2020-08-03 15:29:19 +02:00
|
|
|
|
|
|
|
// Release
|
2020-08-06 10:17:56 +02:00
|
|
|
const glob = require('globby');
|
|
|
|
const md5File = require('md5-file')
|
|
|
|
const fs = require('fs');
|
|
|
|
const archiver = require('archiver');
|
|
|
|
const shell = require('shelljs');
|
|
|
|
const inquirer = require('inquirer');
|
2017-08-04 16:28:16 +02:00
|
|
|
|
|
|
|
// Configurazione
|
2020-08-06 10:17:56 +02:00
|
|
|
const config = {
|
2017-08-04 16:28:16 +02:00
|
|
|
production: 'assets/dist', // Cartella di destinazione
|
|
|
|
development: 'assets/src', // Cartella dei file di personalizzazione
|
|
|
|
debug: false,
|
|
|
|
main: {
|
|
|
|
bowerDirectory: './node_modules',
|
|
|
|
bowerJson: './package.json',
|
|
|
|
},
|
|
|
|
paths: {
|
|
|
|
js: 'js',
|
|
|
|
css: 'css',
|
|
|
|
images: 'img',
|
|
|
|
fonts: 'fonts'
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// Elaborazione e minificazione di JS
|
2020-06-30 13:24:55 +02:00
|
|
|
const JS = gulp.parallel(() => {
|
|
|
|
return gulp.src(mainBowerFiles('**/*.js', {
|
|
|
|
paths: config.main,
|
|
|
|
debugging: config.debug,
|
|
|
|
}))
|
2017-08-04 16:28:16 +02:00
|
|
|
.pipe(concat('app.min.js'))
|
2020-07-09 09:02:40 +02:00
|
|
|
.pipe(minifyJS())
|
2017-08-04 16:28:16 +02:00
|
|
|
.pipe(gulp.dest(config.production + '/' + config.paths.js));
|
2020-06-30 13:24:55 +02:00
|
|
|
}, srcJS);
|
2017-08-04 16:28:16 +02:00
|
|
|
|
|
|
|
// Elaborazione e minificazione di JS personalizzati
|
2020-06-30 13:24:55 +02:00
|
|
|
function srcJS() {
|
2020-08-06 10:17:56 +02:00
|
|
|
const js = gulp.src([
|
2020-06-30 13:24:55 +02:00
|
|
|
config.development + '/' + config.paths.js + '/*.js',
|
|
|
|
])
|
2017-08-04 16:28:16 +02:00
|
|
|
.pipe(concat('custom.min.js'))
|
2020-08-06 10:17:56 +02:00
|
|
|
//.pipe(minifyJS())
|
2017-08-04 16:28:16 +02:00
|
|
|
.pipe(gulp.dest(config.production + '/' + config.paths.js));
|
2019-07-26 17:40:52 +02:00
|
|
|
|
2020-08-06 10:17:56 +02:00
|
|
|
const indip = gulp.src([
|
2019-07-26 17:40:52 +02:00
|
|
|
config.development + '/' + config.paths.js + '/functions/*.js',
|
|
|
|
])
|
|
|
|
.pipe(concat('functions.min.js'))
|
2020-07-09 09:02:40 +02:00
|
|
|
//.pipe(minifyJS())
|
2019-07-26 17:40:52 +02:00
|
|
|
.pipe(gulp.dest(config.production + '/' + config.paths.js));
|
2020-06-30 13:24:55 +02:00
|
|
|
|
|
|
|
return merge(js, indip);
|
|
|
|
}
|
2017-08-04 16:28:16 +02:00
|
|
|
|
|
|
|
// Elaborazione e minificazione di CSS
|
2020-06-30 13:24:55 +02:00
|
|
|
const CSS = gulp.parallel(() => {
|
|
|
|
return gulp.src(mainBowerFiles('**/*.{css,scss,less,styl}', {
|
|
|
|
paths: config.main,
|
|
|
|
debugging: config.debug,
|
|
|
|
}))
|
2017-08-04 16:28:16 +02:00
|
|
|
.pipe(gulpIf('*.scss', sass(), gulpIf('*.less', less(), gulpIf('*.styl', stylus()))))
|
2020-06-30 13:24:55 +02:00
|
|
|
.pipe(autoprefixer())
|
2017-08-04 16:28:16 +02:00
|
|
|
.pipe(minifyCSS({
|
|
|
|
rebase: false,
|
|
|
|
}))
|
|
|
|
.pipe(concat('app.min.css'))
|
|
|
|
.pipe(flatten())
|
|
|
|
.pipe(gulp.dest(config.production + '/' + config.paths.css));
|
2020-06-30 13:24:55 +02:00
|
|
|
}, srcCSS);
|
2017-08-04 16:28:16 +02:00
|
|
|
|
|
|
|
// Elaborazione e minificazione di CSS personalizzati
|
2020-06-30 13:24:55 +02:00
|
|
|
function srcCSS() {
|
2020-08-06 10:17:56 +02:00
|
|
|
const css = gulp.src([
|
2020-06-30 13:24:55 +02:00
|
|
|
config.development + '/' + config.paths.css + '/*.{css,scss,less,styl}',
|
|
|
|
])
|
2017-08-04 16:28:16 +02:00
|
|
|
.pipe(gulpIf('*.scss', sass(), gulpIf('*.less', less(), gulpIf('*.styl', stylus()))))
|
2020-06-30 13:24:55 +02:00
|
|
|
.pipe(autoprefixer())
|
2017-08-04 16:28:16 +02:00
|
|
|
.pipe(minifyCSS({
|
|
|
|
rebase: false,
|
|
|
|
}))
|
|
|
|
.pipe(concat('style.min.css'))
|
|
|
|
.pipe(flatten())
|
|
|
|
.pipe(gulp.dest(config.production + '/' + config.paths.css));
|
|
|
|
|
2020-08-06 10:17:56 +02:00
|
|
|
const print = gulp.src([
|
2020-06-30 13:24:55 +02:00
|
|
|
config.development + '/' + config.paths.css + '/print/*.{css,scss,less,styl}',
|
|
|
|
config.bowerDirectory + '/fullcalendar/fullcalendar.print.css',
|
|
|
|
], {
|
|
|
|
allowEmpty: true
|
|
|
|
})
|
2017-08-04 16:28:16 +02:00
|
|
|
.pipe(gulpIf('*.scss', sass(), gulpIf('*.less', less(), gulpIf('*.styl', stylus()))))
|
2020-06-30 13:24:55 +02:00
|
|
|
.pipe(autoprefixer())
|
2017-08-04 16:28:16 +02:00
|
|
|
.pipe(minifyCSS({
|
|
|
|
rebase: false,
|
|
|
|
}))
|
|
|
|
.pipe(concat('print.min.css'))
|
|
|
|
.pipe(flatten())
|
|
|
|
.pipe(gulp.dest(config.production + '/' + config.paths.css));
|
|
|
|
|
2020-08-06 10:17:56 +02:00
|
|
|
const themes = gulp.src([
|
2020-06-30 13:24:55 +02:00
|
|
|
config.development + '/' + config.paths.css + '/themes/*.{css,scss,less,styl}',
|
2020-07-21 17:44:55 +02:00
|
|
|
config.main.bowerDirectory + '/admin-lte/dist/css/skins/_all-skins.min.css',
|
2020-06-30 13:24:55 +02:00
|
|
|
])
|
2017-08-04 16:28:16 +02:00
|
|
|
.pipe(gulpIf('*.scss', sass(), gulpIf('*.less', less(), gulpIf('*.styl', stylus()))))
|
2020-06-30 13:24:55 +02:00
|
|
|
.pipe(autoprefixer())
|
2017-08-04 16:28:16 +02:00
|
|
|
.pipe(minifyCSS({
|
|
|
|
rebase: false,
|
|
|
|
}))
|
|
|
|
.pipe(concat('themes.min.css'))
|
|
|
|
.pipe(flatten())
|
|
|
|
.pipe(gulp.dest(config.production + '/' + config.paths.css));
|
|
|
|
|
2020-06-30 13:24:55 +02:00
|
|
|
return merge(css, print, themes);
|
|
|
|
}
|
2017-08-04 16:28:16 +02:00
|
|
|
|
|
|
|
|
2020-06-30 13:24:55 +02:00
|
|
|
// Elaborazione delle immagini
|
|
|
|
const images = srcImages;
|
|
|
|
/*
|
|
|
|
gulp.parallel(() => {*/
|
2020-08-06 10:17:56 +02:00
|
|
|
//const src = mainBowerFiles('**/*.{jpg,png,jpeg,gif}', {
|
2020-06-30 13:24:55 +02:00
|
|
|
/*
|
|
|
|
paths: config.main,
|
|
|
|
debugging: config.debug,
|
2017-08-04 16:28:16 +02:00
|
|
|
});
|
|
|
|
|
2020-06-30 13:24:55 +02:00
|
|
|
return gulp.src(src, {
|
|
|
|
allowEmpty: true
|
|
|
|
})
|
|
|
|
.pipe(flatten())
|
|
|
|
.pipe(gulp.dest(config.production + '/' + config.paths.images));
|
|
|
|
}, srcImages);
|
|
|
|
*/
|
|
|
|
|
2017-08-04 16:28:16 +02:00
|
|
|
// Elaborazione delle immagini personalizzate
|
2020-06-30 13:24:55 +02:00
|
|
|
function srcImages() {
|
|
|
|
return gulp.src([
|
|
|
|
config.development + '/' + config.paths.images + '/**/*.{jpg,png,jpeg,gif}',
|
|
|
|
])
|
2017-08-04 16:28:16 +02:00
|
|
|
.pipe(gulp.dest(config.production + '/' + config.paths.images));
|
2020-06-30 13:24:55 +02:00
|
|
|
}
|
2017-08-04 16:28:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
// Elaborazione dei fonts
|
2020-06-30 13:24:55 +02:00
|
|
|
const fonts = gulp.parallel(() => {
|
|
|
|
return gulp.src(mainBowerFiles('**/*.{otf,eot,svg,ttf,woff,woff2}', {
|
|
|
|
paths: config.main,
|
|
|
|
debugging: config.debug,
|
|
|
|
}))
|
2017-08-04 16:28:16 +02:00
|
|
|
.pipe(flatten())
|
|
|
|
.pipe(gulp.dest(config.production + '/' + config.paths.fonts));
|
2020-06-30 13:24:55 +02:00
|
|
|
}, srcFonts);
|
2017-08-04 16:28:16 +02:00
|
|
|
|
|
|
|
// Elaborazione dei fonts personalizzati
|
2020-06-30 13:24:55 +02:00
|
|
|
function srcFonts() {
|
|
|
|
return gulp.src([
|
|
|
|
config.development + '/' + config.paths.fonts + '/**/*.{otf,eot,svg,ttf,woff,woff2}',
|
|
|
|
])
|
2017-08-04 16:28:16 +02:00
|
|
|
.pipe(flatten())
|
|
|
|
.pipe(gulp.dest(config.production + '/' + config.paths.fonts));
|
2020-06-30 13:24:55 +02:00
|
|
|
}
|
2017-08-04 16:28:16 +02:00
|
|
|
|
2020-06-30 13:24:55 +02:00
|
|
|
function ckeditor() {
|
|
|
|
return gulp.src([
|
2020-08-06 10:17:56 +02:00
|
|
|
config.main.bowerDirectory + '/ckeditor4/{adapters,lang,skins,plugins}/**/*.{js,json,css,png}',
|
|
|
|
config.main.bowerDirectory + '/ckeditor4/*.{js,css}',
|
2020-06-30 13:24:55 +02:00
|
|
|
])
|
2017-09-22 14:37:18 +02:00
|
|
|
.pipe(gulp.dest(config.production + '/' + config.paths.js + '/ckeditor'));
|
2020-06-30 13:24:55 +02:00
|
|
|
}
|
2017-08-04 16:28:16 +02:00
|
|
|
|
2020-06-30 13:24:55 +02:00
|
|
|
function colorpicker() {
|
|
|
|
return gulp.src([
|
|
|
|
config.main.bowerDirectory + '/bootstrap-colorpicker/dist/**/*.{jpg,png,jpeg}',
|
|
|
|
])
|
2017-08-04 16:28:16 +02:00
|
|
|
.pipe(flatten())
|
|
|
|
.pipe(gulp.dest(config.production + '/' + config.paths.images + '/bootstrap-colorpicker'));
|
2020-06-30 13:24:55 +02:00
|
|
|
}
|
2017-08-04 16:28:16 +02:00
|
|
|
|
2020-06-30 13:24:55 +02:00
|
|
|
function password_strength(){
|
|
|
|
return gulp.src([
|
2019-07-18 18:33:56 +02:00
|
|
|
config.main.bowerDirectory + '/pwstrength-bootstrap/dist/*.js',
|
|
|
|
])
|
|
|
|
.pipe(concat('password.min.js'))
|
|
|
|
.pipe(minifyJS())
|
|
|
|
.pipe(gulp.dest(config.production + '/password-strength'));
|
2020-06-30 13:24:55 +02:00
|
|
|
}
|
2019-07-18 18:33:56 +02:00
|
|
|
|
2020-06-30 13:24:55 +02:00
|
|
|
function hotkeys() {
|
|
|
|
return gulp.src([
|
2020-02-20 02:02:01 +01:00
|
|
|
config.main.bowerDirectory + '/hotkeys-js/dist/hotkeys.min.js',
|
|
|
|
])
|
|
|
|
.pipe(flatten())
|
|
|
|
.pipe(gulp.dest(config.production + '/' + config.paths.js + '/hotkeys-js'));
|
2020-06-30 13:24:55 +02:00
|
|
|
}
|
2020-02-20 02:02:01 +01:00
|
|
|
|
2020-06-30 13:24:55 +02:00
|
|
|
function chartjs() {
|
|
|
|
return gulp.src([
|
|
|
|
config.main.bowerDirectory + '/chart.js/dist/Chart.min.js',
|
|
|
|
])
|
2017-09-18 15:45:47 +02:00
|
|
|
.pipe(flatten())
|
|
|
|
.pipe(gulp.dest(config.production + '/' + config.paths.js + '/chartjs'));
|
2020-06-30 13:24:55 +02:00
|
|
|
}
|
2017-09-18 15:45:47 +02:00
|
|
|
|
2020-06-30 13:24:55 +02:00
|
|
|
function csrf() {
|
|
|
|
return gulp.src([
|
|
|
|
'./vendor/owasp/csrf-protector-php/js/csrfprotector.js',
|
|
|
|
])
|
2018-07-08 18:25:36 +02:00
|
|
|
.pipe(flatten())
|
|
|
|
.pipe(gulp.dest(config.production + '/' + config.paths.js + '/csrf'));
|
2020-06-30 13:24:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function pdfjs() {
|
2020-08-06 10:17:56 +02:00
|
|
|
const web = gulp.src([
|
2020-08-06 14:42:59 +02:00
|
|
|
config.main.bowerDirectory + '/pdf.js/web/**/*',
|
|
|
|
'!' + config.main.bowerDirectory + '/pdf.js/web/cmaps/*',
|
|
|
|
'!' + config.main.bowerDirectory + '/pdf.js/web/*.map',
|
|
|
|
'!' + config.main.bowerDirectory + '/pdf.js/web/*.pdf',
|
2020-06-30 13:24:55 +02:00
|
|
|
])
|
2017-12-30 14:13:11 +01:00
|
|
|
.pipe(gulp.dest(config.production + '/pdfjs/web'));
|
|
|
|
|
2020-08-06 10:17:56 +02:00
|
|
|
const build = gulp.src([
|
2020-08-06 14:42:59 +02:00
|
|
|
config.main.bowerDirectory + '/pdf.js/build/*',
|
|
|
|
'!' + config.main.bowerDirectory + '/pdf.js/build/*.map',
|
2020-06-30 13:24:55 +02:00
|
|
|
])
|
2017-12-30 14:13:11 +01:00
|
|
|
.pipe(gulp.dest(config.production + '/pdfjs/build'));
|
2020-06-30 13:24:55 +02:00
|
|
|
|
|
|
|
return merge(web, build);
|
|
|
|
}
|
2017-12-20 14:05:14 +01:00
|
|
|
|
2017-08-04 16:28:16 +02:00
|
|
|
// Elaborazione e minificazione delle informazioni sull'internazionalizzazione
|
2020-06-30 13:24:55 +02:00
|
|
|
function i18n() {
|
|
|
|
return gulp.src([
|
|
|
|
config.main.bowerDirectory + '/**/{i18n,lang,locale,locales}/*.{js,json}',
|
|
|
|
config.development + '/' + config.paths.js + '/i18n/**/*.{js,json}',
|
|
|
|
'!' + config.main.bowerDirectory + '/**/{src,plugins}/**',
|
2020-08-06 10:17:56 +02:00
|
|
|
'!' + config.main.bowerDirectory + '/ckeditor4/**',
|
2020-06-30 13:24:55 +02:00
|
|
|
'!' + config.main.bowerDirectory + '/summernote/**',
|
|
|
|
'!' + config.main.bowerDirectory + '/jquery-ui/**',
|
|
|
|
])
|
|
|
|
//.pipe(gulpIf('*.js', minifyJS(), gulpIf('*.json', minifyJSON())))
|
2017-08-04 16:28:16 +02:00
|
|
|
.pipe(gulpIf('!*.min.*', rename({
|
|
|
|
suffix: '.min'
|
|
|
|
})))
|
|
|
|
.pipe(flatten({
|
|
|
|
includeParents: 1
|
|
|
|
}))
|
|
|
|
.pipe(gulp.dest(config.production + '/' + config.paths.js + '/i18n'));
|
2020-06-30 13:24:55 +02:00
|
|
|
}
|
2017-08-04 16:28:16 +02:00
|
|
|
|
|
|
|
// PHP DebugBar assets
|
2020-06-30 13:24:55 +02:00
|
|
|
function phpDebugBar() {
|
|
|
|
return gulp.src([
|
|
|
|
'./vendor/maximebf/debugbar/src/DebugBar/Resources/**/*',
|
|
|
|
'!./vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/**/*',
|
|
|
|
])
|
2017-08-04 16:28:16 +02:00
|
|
|
.pipe(gulpIf('*.css', minifyCSS(), gulpIf('*.js', minifyJS())))
|
|
|
|
.pipe(gulp.dest(config.production + '/php-debugbar'));
|
2020-06-30 13:24:55 +02:00
|
|
|
}
|
2017-08-04 16:28:16 +02:00
|
|
|
|
|
|
|
// Operazioni per la release
|
2020-06-30 13:50:41 +02:00
|
|
|
function release(done) {
|
2017-12-30 12:05:09 +01:00
|
|
|
// Impostazione dello zip
|
2020-08-03 15:29:19 +02:00
|
|
|
let output = fs.createWriteStream('./release.zip', {flags: 'w'});
|
|
|
|
let archive = archiver('zip');
|
2017-08-04 16:28:16 +02:00
|
|
|
|
2017-09-08 13:24:48 +02:00
|
|
|
output.on('close', function () {
|
2017-08-07 13:07:18 +02:00
|
|
|
console.log('ZIP completato!');
|
2017-08-04 16:28:16 +02:00
|
|
|
});
|
|
|
|
|
2017-09-08 13:24:48 +02:00
|
|
|
archive.on('error', function (err) {
|
2017-08-04 16:28:16 +02:00
|
|
|
throw err;
|
|
|
|
});
|
|
|
|
|
|
|
|
archive.pipe(output);
|
|
|
|
|
2020-08-03 15:29:19 +02:00
|
|
|
// Individuazione dei file da aggiungere
|
|
|
|
glob([
|
|
|
|
'**/*',
|
|
|
|
'!checksum.json',
|
|
|
|
'!.idea/**',
|
|
|
|
'!.git/**',
|
|
|
|
'!node_modules/**',
|
|
|
|
'!backup/**',
|
|
|
|
'!files/**',
|
|
|
|
'!logs/**',
|
|
|
|
'!config.inc.php',
|
|
|
|
'!**/*.(lock|phar|log|zip|bak|jar|txt)',
|
|
|
|
'!**/~*',
|
|
|
|
'!vendor/tecnickcom/tcpdf/examples/*',
|
|
|
|
'!vendor/tecnickcom/tcpdf/fonts/*',
|
|
|
|
'vendor/tecnickcom/tcpdf/fonts/*helvetica*',
|
|
|
|
'!vendor/mpdf/mpdf/tmp/*',
|
|
|
|
'!vendor/mpdf/mpdf/ttfonts/*',
|
|
|
|
'vendor/mpdf/mpdf/ttfonts/DejaVuinfo.txt',
|
|
|
|
'vendor/mpdf/mpdf/ttfonts/DejaVu*Condensed*',
|
|
|
|
'!vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/*',
|
|
|
|
'!vendor/respect/validation/tests/*',
|
|
|
|
], {
|
2017-08-04 16:28:16 +02:00
|
|
|
dot: true,
|
2020-08-03 15:29:19 +02:00
|
|
|
}).then(function (files){
|
|
|
|
// Aggiunta dei file con i relativi checksum
|
|
|
|
let checksum = {};
|
|
|
|
for (const file of files) {
|
|
|
|
if (fs.lstatSync(file).isDirectory()) {
|
|
|
|
archive.directory(file, file);
|
|
|
|
} else {
|
|
|
|
archive.file(file);
|
|
|
|
|
|
|
|
if (!file.startsWith('vendor')) {
|
|
|
|
checksum[file] = md5File.sync(file);
|
|
|
|
}
|
|
|
|
}
|
2017-12-30 12:05:09 +01:00
|
|
|
}
|
|
|
|
|
2020-08-03 15:29:19 +02:00
|
|
|
// Eccezioni
|
|
|
|
archive.file('backup/.htaccess', {});
|
|
|
|
archive.file('files/.htaccess', {});
|
|
|
|
archive.file('files/my_impianti/componente.ini', {});
|
|
|
|
archive.file('logs/.htaccess', {});
|
|
|
|
|
|
|
|
// Aggiunta del file dei checksum
|
|
|
|
let checksumFile = fs.createWriteStream('./checksum.json', {flags: 'w'});
|
|
|
|
checksumFile.write(JSON.stringify(checksum));
|
|
|
|
checksumFile.close();
|
|
|
|
archive.file('checksum.json', {});
|
|
|
|
|
|
|
|
// Aggiunta del commit corrente nel file REVISION
|
|
|
|
archive.append(shell.exec('git rev-parse --short HEAD', {
|
|
|
|
silent: true
|
|
|
|
}).stdout, {
|
|
|
|
name: 'REVISION'
|
2017-12-30 12:10:06 +01:00
|
|
|
});
|
|
|
|
|
2020-08-03 15:29:19 +02:00
|
|
|
// Opzioni sulla release
|
|
|
|
inquirer.prompt([{
|
|
|
|
type: 'input',
|
|
|
|
name: 'version',
|
|
|
|
message: 'Numero di versione:',
|
|
|
|
}, {
|
|
|
|
type: 'confirm',
|
|
|
|
name: 'beta',
|
|
|
|
message: 'Versione beta?',
|
|
|
|
default: false,
|
|
|
|
}]).then(function (result) {
|
|
|
|
let version = result.version;
|
|
|
|
|
|
|
|
if (result.beta) {
|
|
|
|
version += 'beta';
|
|
|
|
}
|
|
|
|
|
|
|
|
archive.append(version, {
|
|
|
|
name: 'VERSION'
|
|
|
|
});
|
|
|
|
|
|
|
|
// Completamento dello zip
|
|
|
|
archive.finalize();
|
|
|
|
|
|
|
|
done();
|
|
|
|
});
|
2018-09-20 12:05:22 +02:00
|
|
|
});
|
2020-06-30 13:24:55 +02:00
|
|
|
}
|
2017-08-04 16:28:16 +02:00
|
|
|
|
|
|
|
// Pulizia
|
2020-06-30 13:24:55 +02:00
|
|
|
function clean() {
|
2017-08-04 16:28:16 +02:00
|
|
|
return del([config.production]);
|
2020-06-30 13:24:55 +02:00
|
|
|
}
|
2017-08-04 16:28:16 +02:00
|
|
|
|
|
|
|
// Operazioni di default per la generazione degli assets
|
2020-06-30 13:24:55 +02:00
|
|
|
const bower = gulp.series(clean, gulp.parallel(JS, CSS, images, fonts, phpDebugBar, ckeditor, colorpicker, i18n, pdfjs, hotkeys, chartjs, password_strength, csrf));
|
2017-08-04 16:28:16 +02:00
|
|
|
|
2020-07-08 21:12:16 +02:00
|
|
|
// Debug su CSS e JS
|
|
|
|
exports.srcJS = srcJS;
|
|
|
|
exports.srcCSS = srcCSS;
|
|
|
|
|
2020-06-30 13:24:55 +02:00
|
|
|
exports.bower = bower;
|
|
|
|
exports.release = release;
|
|
|
|
exports.default = bower;
|