Skip to content

Commit

Permalink
updated build functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
kawshar committed Dec 13, 2021
1 parent 148c3dc commit 0aaa6f1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ web.config.txt
/cli
/components
/images
/dist
/includes
/layouts
/libraries
Expand Down
31 changes: 20 additions & 11 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,49 @@ const clean = require("gulp-clean");

// Create a build
function cleanBuild() {
return src("./build", { read: false, allowEmpty: true }).pipe(clean());
return src("./dist/build", { read: false, allowEmpty: true }).pipe(clean());
}

function cleanZip() {
return src("./helix3_template.zip", { read: false, allowEmpty: true }).pipe(clean());
return src("./dist/**.zip", { read: false, allowEmpty: true }).pipe(clean());
}

function copy_template() {
return src(["./templates/shaper_helix3/**/*.*"]).pipe(dest("build/template"));
return src(["./templates/shaper_helix3/**/*.*"]).pipe(dest("dist/build/template"));
}

function copy_template_lang() {
return src("./language/en-GB/en-GB.tpl_shaper_helix3.ini").pipe(dest("build/template"));
return src("./language/en-GB/en-GB.tpl_shaper_helix3.ini").pipe(dest("dist/build/template"));
}

function copy_system_plugin() {
return src(["./plugins/system/helix3/**/*.*"]).pipe(dest("build/plugins/system"));
return src(["./plugins/system/helix3/**/*.*"]).pipe(dest("dist/build/plugins/system"));
}

function copy_system_plugin_lang() {
return src("./administrator/language/en-GB/en-GB.plg_system_helix3.ini").pipe(
dest("build/plugins/system/language")
dest("dist/build/plugins/system/language")
);
}

function copy_ajax_plugin() {
return src(["./plugins/ajax/helix3/**/*.*"]).pipe(dest("build/plugins/ajax"));
return src(["./plugins/ajax/helix3/**/*.*"]).pipe(dest("dist/build/plugins/ajax"));
}

function copy_installer() {
return src(["installer.script.php", "installer.xml"]).pipe(dest("build"));
return src(["installer.script.php", "installer.xml"]).pipe(dest("dist/build"));
}

function makeZip() {
return src("./build/**/*.*").pipe(zip("helix3_template.zip")).pipe(dest("./"));
function makeTemplateZip() {
return src("./dist/build/**/*.*").pipe(zip("helix3_template.zip")).pipe(dest("./dist/"));
}

function makeSystemPluginZip() {
return src("./dist/build/plugins/system/**/*.*").pipe(zip("plg_system_helix.zip")).pipe(dest("./dist/"));
}

function makeAjaxPluginZip() {
return src("./dist/build/plugins/ajax/**/*.*").pipe(zip("plg_ajax_helix.zip")).pipe(dest("./dist/"));
}

exports.copy = series(
Expand All @@ -51,4 +59,5 @@ exports.copy = series(
copy_ajax_plugin,
copy_installer
);
exports.default = series(exports.copy, makeZip, cleanBuild);

exports.default = series(exports.copy, makeSystemPluginZip, makeAjaxPluginZip, makeTemplateZip, cleanBuild);

0 comments on commit 0aaa6f1

Please sign in to comment.