-
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
128 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Ignore all files by default. | ||
**/* | ||
|
||
!README.md | ||
!LICENSE | ||
!package.json | ||
!dist/**/*.js | ||
!icons/**/*.+(svg|license) | ||
!media/**/* | ||
!syntaxes/**/*.+(json|yaml|license) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
const esbuild = require("esbuild"); | ||
|
||
const production = process.argv.includes("--production"); | ||
const watch = process.argv.includes("--watch"); | ||
|
||
/** | ||
* @type {import('esbuild').Plugin} | ||
*/ | ||
const esbuildProblemMatcherPlugin = { | ||
name: "esbuild-problem-matcher", | ||
|
||
setup(build) { | ||
build.onStart(() => { | ||
console.log("[watch] build started"); | ||
}); | ||
build.onEnd((result) => { | ||
result.errors.forEach(({ text, location }) => { | ||
console.error(`✘ [ERROR] ${text}`); | ||
console.error( | ||
` ${location.file}:${location.line}:${location.column}:`, | ||
); | ||
}); | ||
console.log("[watch] build finished"); | ||
}); | ||
}, | ||
}; | ||
|
||
async function main() { | ||
const ctx = await esbuild.context({ | ||
entryPoints: ["src/debug-adapter/client.ts"], | ||
bundle: true, | ||
format: "cjs", | ||
minify: production, | ||
sourcemap: !production, | ||
sourcesContent: false, | ||
platform: "node", | ||
outfile: "dist/debug-adapter-client.js", | ||
external: ["vscode"], | ||
logLevel: "silent", | ||
plugins: [ | ||
/* add to the end of plugins array */ | ||
esbuildProblemMatcherPlugin, | ||
], | ||
}); | ||
if (watch) { | ||
await ctx.watch(); | ||
} else { | ||
await ctx.rebuild(); | ||
await ctx.dispose(); | ||
} | ||
} | ||
|
||
main().catch((e) => { | ||
console.error(e); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2024 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -eu | ||
|
||
# Move into the top-level directory of the project. | ||
cd "$(dirname "${BASH_SOURCE[0]}")/.." > /dev/null | ||
|
||
# Only regenerate the .js and .t.ds file if the protos have changed (i.e., | ||
# it's a fresh checkout or update_protos.sh has been executed again and | ||
# deleted the old generated files). This shaves several seconds off the | ||
# extension's build time. | ||
if [[ ! -f src/protos/protos.js ]] ; then | ||
sed -e "s#^#src/protos/#" src/protos/protos_list.txt | \ | ||
xargs pbjs -t static-module -o src/protos/protos.js | ||
fi | ||
if [[ ! -f src/protos/protos.d.ts ]] ; then | ||
pbts -o src/protos/protos.d.ts src/protos/protos.js | ||
fi | ||
|
||
# Convert yaml language definition to json form requred by vscode. | ||
js-yaml syntaxes/bazelrc.tmLanguage.yaml > syntaxes/bazelrc.tmLanguage.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters