Skip to content

Commit

Permalink
Consolidate BJLS and BEF (#12)
Browse files Browse the repository at this point in the history
* Consolidate BJLS and BEF

* Versionless plugins in extension
  • Loading branch information
AlexeiShmidman authored Oct 16, 2021
1 parent 26e38b4 commit 3215f97
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 6,288 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- uses: actions/cache@v2
with:
path: |
./bazel-vscode-0.0.2.vsix
./bazel-vscode-0.0.3.vsix
key: ${{ env.cache-name }}-${{ github.run_id }}
publish:
needs: [build]
Expand All @@ -41,7 +41,7 @@ jobs:
steps:
- uses: actions/cache@v2
with:
path: ./bazel-vscode-0.0.2.vsix
path: ./bazel-vscode-0.0.3.vsix
key: ${{ env.cache-name }}-${{ github.run_id }}
- name: Create tag
if: contains(github.ref, 'master')
Expand All @@ -67,8 +67,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bazel-vscode-0.0.2.vsix
asset_name: bazel-vscode-0.0.2.vsix
asset_path: ./bazel-vscode-0.0.3.vsix
asset_name: bazel-vscode-0.0.3.vsix
asset_content_type: application/octet-stream
- name: Publish Release
if: contains(github.ref, 'master')
Expand Down
29 changes: 15 additions & 14 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
{
"version": "0.2.0",
"configurations": [
{
"args": [
"build-plugin"
],
"name": "Gulp Build Plugin",
"program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node"
},
{
"name": "Run Extension",
"type": "extensionHost",
Expand All @@ -29,18 +41,7 @@
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "GulpTester",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/gulp/bin/gulp.js",
"stopOnEntry": false,
"args": [],
"cwd": "${workspaceRoot}",
"runtimeArgs": [
"--nolazy"
],
"console": "internalConsole",
} ]
}

]
}
5 changes: 3 additions & 2 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ vsc-extension-quickstart.md
gulpfile.js
node_modules
bazel-eclipse/**
!bazel-eclipse/bundles/com.salesforce.b2eclipse.jdt.ls/target/com.salesforce.b2eclipse.jdt.ls-*SNAPSHOT.jar
!bazel-eclipse/bundles/com.salesforce.bazel-java-sdk/target/com.salesforce.bazel-java-sdk-*SNAPSHOT.jar
!bazel-eclipse/bundles/com.salesforce.bazel.eclipse.common/target/com.salesforce.bazel.eclipse.common.jar
!bazel-eclipse/bundles/com.salesforce.b2eclipse.jdt.ls/target/com.salesforce.b2eclipse.jdt.ls.jar
!bazel-eclipse/bundles/com.salesforce.bazel-java-sdk/target/com.salesforce.bazel-java-sdk.jar
README.md
33 changes: 17 additions & 16 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ gulp.task('build-plugin', (done) => {
}
});

removeFolder(bazelEclipseDir);
// del.sync(bazelEclipseDir + '/**', { force: true });
fs.rmdirSync(bazelEclipseDir, {recursive: true});

cp.execSync('git clone https://github.com/salesforce/bazel-eclipse.git', { cwd: __dirname, stdio: [0, 1, 2] });
cp.execSync(`mvn clean package`, { cwd: bazelEclipseDir, stdio: [0, 1, 2] });
done();
cp.execSync('git clone https://github.com/salesforce/bazel-eclipse.git', { cwd: __dirname, stdio: [0, 1, 2] });
cp.execSync(`mvn clean package`, { cwd: bazelEclipseDir, stdio: [0, 1, 2] });
renameTarget('com.salesforce.b2eclipse.jdt.ls');
renameTarget('com.salesforce.bazel.eclipse.common');
renameTarget('com.salesforce.bazel-java-sdk');
done();
});

function isWin() {
Expand All @@ -29,16 +33,13 @@ function mvnw() {
return isWin() ? 'mvnw.cmd' : './mvnw';
}

function removeFolder(folder) {
if (fs.existsSync(folder)) {
fs.readdirSync(folder).forEach((file, index) => {
var child = path.join(folder, file);
if (fs.statSync(child).isDirectory()) {
removeFolder(child);
} else {
fs.unlinkSync(child);
}
});
fs.rmdirSync(folder);
}
function renameTarget(plugin) {
bundlesPath = path.join(bazelEclipseDir, 'bundles');
pluginPath = path.join(bundlesPath, plugin);
targetPath = path.join(pluginPath, 'target');
sourceFileName = fs.readdirSync(targetPath).find(file => file.match(plugin + '-.*-SNAPSHOT\\.jar'));
sourceFile = path.join(targetPath, sourceFileName);
targetFile = path.join(targetPath, plugin + '.jar');
fs.renameSync(sourceFile, targetFile);
}

Loading

0 comments on commit 3215f97

Please sign in to comment.