-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
42 lines (36 loc) · 1.17 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const pluginData = {
name: 'Better Recent Comments',
libNamespace: 'Barn2\\BRC_Lib',
libIncludes: ['Registerable.php', 'Service.php', 'Util.php', 'Plugin/Plugin.php', 'Plugin/Simple_Plugin.php', 'Plugin/Admin/Admin_Links.php']
};
const { src, dest, watch, series, parallel } = require( 'gulp' );
const fs = require( 'fs' ),
barn2build = getBarn2Build();
function getBarn2Build() {
var build;
if ( fs.existsSync( '../barn2-lib/build' ) ) {
build = require( '../barn2-lib/build/gulpfile-common' );
} else if ( process.env.BARN2_LIB ) {
build = require( process.env.BARN2_LIB + '/build/gulpfile-common' );
} else {
throw new Error( "Error: please set the BARN2_LIB environment variable to path of Barn2 Library project" );
}
build.setupBuild( pluginData );
return build;
}
function test( cb ) {
console.log( 'All looks good.' );
cb();
}
module.exports = {
default: test,
build: barn2build.buildPlugin,
assets: barn2build.buildAssets,
library: barn2build.updateLibrary,
zip: barn2build.createZipFile,
release: barn2build.releaseFreePlugin,
pluginTesting: barn2build.updatePluginTesting,
watch: () => {
watch( 'assets/scss/**/*.scss', barn2build.compileSass );
}
};