Skip to content

Commit 83df254

Browse files
switch to BEF-JDT LS monorep (#10)
* Switch to bazel-eclipe repo * Build with bazel-eclipse github repository * switch to bazel-eclipe master branch * correct ignorable folders and files in vsce
1 parent dfbc417 commit 83df254

File tree

6 files changed

+6272
-30
lines changed

6 files changed

+6272
-30
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
node_modules
2-
bazel-ls-eclipse
2+
bazel-eclipse
33
out
44
dist
55
.vscode-test/

.vscode/launch.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@
2929
"${workspaceFolder}/out/test/**/*.js"
3030
],
3131
"preLaunchTask": "${defaultBuildTask}"
32-
}
33-
]
32+
},
33+
{
34+
"name": "GulpTester",
35+
"type": "node",
36+
"request": "launch",
37+
"program": "${workspaceRoot}/node_modules/gulp/bin/gulp.js",
38+
"stopOnEntry": false,
39+
"args": [],
40+
"cwd": "${workspaceRoot}",
41+
"runtimeArgs": [
42+
"--nolazy"
43+
],
44+
"console": "internalConsole",
45+
} ]
3446
}

.vscodeignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ out/test/**
44
src/**
55
test/**
66
.gitignore
7+
.github/**
8+
.git/**
79
**/jsconfig.json
810
**/*.map
911
**/.eslintrc.json
@@ -15,6 +17,7 @@ vsc-extension-quickstart.md
1517
**/*.ts
1618
gulpfile.js
1719
node_modules
18-
bazel-ls-eclipse/**
19-
!bazel-ls-eclipse/com.salesforce.b2eclipse.jdt.ls/target/com.salesforce.b2eclipse.jdt.ls-*.jar
20+
bazel-eclipse/**
21+
!bazel-eclipse/bundles/com.salesforce.b2eclipse.jdt.ls/target/com.salesforce.b2eclipse.jdt.ls-*SNAPSHOT.jar
22+
!bazel-eclipse/bundles/com.salesforce.bazel-java-sdk/target/com.salesforce.bazel-java-sdk-*SNAPSHOT.jar
2023
README.md

gulpfile.js

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ const gulp = require('gulp');
55
const cp = require('child_process');
66
const path = require('path');
77
const fs = require('fs');
8-
const serverDir = path.join(__dirname, 'bazel-ls-eclipse');
9-
const mvnCmd = path.join(serverDir, mvnw());
8+
const bazelEclipseDir = path.join(__dirname, 'bazel-eclipse');
109

1110
gulp.task('build-plugin', (done) => {
12-
13-
if( fs.existsSync(mvnCmd) ){
14-
cp.execSync('git fetch origin', {cwd: serverDir, stdio: [0, 1, 2] });
15-
cp.execSync('git pull origin --force', {cwd: serverDir, stdio: [0, 1, 2] });
16-
}else{
17-
cp.execSync('git clone https://github.com/salesforce/bazel-ls-eclipse.git', { cwd: __dirname, stdio: [0, 1, 2] });
18-
}
19-
20-
cp.execSync(`mvn clean package`, { cwd: serverDir, stdio: [0, 1, 2] });
21-
done();
11+
fs.readdirSync(__dirname).forEach((file, index) => {
12+
if (file.match('.*bazel-ls-vscode-.*\\.vsix')) {
13+
fs.unlinkSync(file);
14+
}
15+
});
16+
17+
removeFolder(bazelEclipseDir);
18+
19+
cp.execSync('git clone https://github.com/salesforce/bazel-eclipse.git', { cwd: __dirname, stdio: [0, 1, 2] });
20+
cp.execSync(`mvn clean package`, { cwd: bazelEclipseDir, stdio: [0, 1, 2] });
21+
done();
2222
});
2323

2424
function isWin() {
@@ -28,3 +28,17 @@ function isWin() {
2828
function mvnw() {
2929
return isWin() ? 'mvnw.cmd' : './mvnw';
3030
}
31+
32+
function removeFolder(folder) {
33+
if (fs.existsSync(folder)) {
34+
fs.readdirSync(folder).forEach((file, index) => {
35+
var child = path.join(folder, file);
36+
if (fs.statSync(child).isDirectory()) {
37+
removeFolder(child);
38+
} else {
39+
fs.unlinkSync(child);
40+
}
41+
});
42+
fs.rmdirSync(folder);
43+
}
44+
}

0 commit comments

Comments
 (0)