diff --git a/gulpfile.js b/gulpfile.mjs similarity index 58% rename from gulpfile.js rename to gulpfile.mjs index c510230..e564892 100644 --- a/gulpfile.js +++ b/gulpfile.mjs @@ -11,10 +11,10 @@ * limitations under the License. */ -const gulp = require('gulp'); -const rename = require('gulp-rename'); -const cp = require('child_process'); -const fse = require('fs-extra'); +import { task, src, dest, series } from 'gulp'; +import rename from 'gulp-rename'; +import { execSync } from 'child_process'; +import { readFileSync, writeFileSync } from 'fs'; const microprofileServerName = 'org.eclipse.lsp4mp.ls-uber.jar'; const microprofileServerDir = '../lsp4mp/microprofile.ls/org.eclipse.lsp4mp.ls'; @@ -23,39 +23,39 @@ const microprofileExtensionDir = '../lsp4mp/microprofile.jdt'; const microprofileExtension = 'org.eclipse.lsp4mp.jdt.core'; const microprofileSite = 'org.eclipse.lsp4mp.jdt.site'; -gulp.task('buildServer', (done) => { - cp.execSync(mvnw() + ' clean install -B -DskipTests', { cwd: microprofileServerDir , stdio: 'inherit' }); - gulp.src(microprofileServerDir + '/target/' + microprofileServerName, { encoding: false }) - .pipe(gulp.dest('./server')); +task('buildServer', (done) => { + execSync(mvnw() + ' clean install -B -DskipTests', { cwd: microprofileServerDir , stdio: 'inherit' }); + src(microprofileServerDir + '/target/' + microprofileServerName, { encoding: false }) + .pipe(dest('./server')); done(); }); -gulp.task('buildExtension', (done) => { - cp.execSync(mvnw() + ' clean verify -B -DskipTests', { cwd: microprofileExtensionDir, stdio: 'inherit' }); - gulp.src(microprofileExtensionDir + '/' + microprofileExtension + '/target/' + microprofileExtension + '-!(*sources).jar', { encoding: false }) +task('buildExtension', (done) => { + execSync(mvnw() + ' clean verify -B -DskipTests', { cwd: microprofileExtensionDir, stdio: 'inherit' }); + src(microprofileExtensionDir + '/' + microprofileExtension + '/target/' + microprofileExtension + '-!(*sources).jar', { encoding: false }) .pipe(rename(microprofileExtension + '.jar')) - .pipe(gulp.dest('./jars')); - gulp.src(microprofileExtensionDir + '/' + microprofileSite + '/target/repository/plugins/wrapped*.jar', { encoding: false }) - .pipe(rename(function (path, _file) { + .pipe(dest('./jars')); + src(microprofileExtensionDir + '/' + microprofileSite + '/target/repository/plugins/wrapped*.jar', { encoding: false }) + .pipe(rename(function (path) { const patt = /wrapped\.([^_]+).*/; const result = path.basename.match(patt); path.basename = result[1]; })) - .pipe(gulp.dest('./jars')); - gulp.src(microprofileExtensionDir + '/' + microprofileSite + '/target/repository/plugins/org.jboss.logging*.jar', { encoding: false }) - .pipe(rename(function (path, _file) { + .pipe(dest('./jars')); + src(microprofileExtensionDir + '/' + microprofileSite + '/target/repository/plugins/org.jboss.logging*.jar', { encoding: false }) + .pipe(rename(function (path) { const patt = /([^_]+).*/; const result = path.basename.match(patt); path.basename = result[1]; })) - .pipe(gulp.dest('./jars')); + .pipe(dest('./jars')); done(); }); -gulp.task('build', gulp.series('buildServer', 'buildExtension')); +task('build', series('buildServer', 'buildExtension')); -gulp.task('prepare_pre_release', function (done) { - const json = JSON.parse(fse.readFileSync("./package.json").toString()); +task('prepare_pre_release', function (done) { + const json = JSON.parse(readFileSync("./package.json").toString()); const stableVersion = json.version.match(/(\d+)\.(\d+)\.(\d+)/); const major = stableVersion[1]; const minor = stableVersion[2]; @@ -67,7 +67,7 @@ gulp.task('prepare_pre_release', function (done) { const insiderPackageJson = Object.assign(json, { version: `${major}.${minor}.${patch}`, }); - fse.writeFileSync("./package.json", JSON.stringify(insiderPackageJson, null, 2)); + writeFileSync("./package.json", JSON.stringify(insiderPackageJson, null, 2)); done(); }); diff --git a/package-lock.json b/package-lock.json index 25ac63f..d5f8c25 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,6 @@ "@vscode/test-electron": "^3.1.0", "eslint": "^10.8.1", "eslint-webpack-plugin": "^6.0.0", - "fs-extra": "^11.3.4", "gulp": "^5.0.1", "gulp-rename": "^2.1.0", "mocha": "^11.8.0", @@ -2307,21 +2306,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/fs-extra": { - "version": "11.4.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.4.0.tgz", - "integrity": "sha512-EQsFzMUJkCKGr1ePqlYADkIUmHW1s3ZXr5Yqy6wbGrfUCphpl2maM/kyOIRA2HpP3AaFQTZXD4ldjek+nccddA==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, "node_modules/fs-mkdirp-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-2.0.1.tgz", @@ -3099,19 +3083,6 @@ "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true }, - "node_modules/jsonfile": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", - "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, "node_modules/jszip": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", @@ -5110,16 +5081,6 @@ "dev": true, "license": "MIT" }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/update-browserslist-db": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", diff --git a/package.json b/package.json index 85726b2..22ea31f 100644 --- a/package.json +++ b/package.json @@ -303,7 +303,6 @@ "@vscode/test-electron": "^3.1.0", "eslint": "^10.8.1", "eslint-webpack-plugin": "^6.0.0", - "fs-extra": "^11.3.4", "gulp": "^5.0.1", "gulp-rename": "^2.1.0", "mocha": "^11.8.0",