mirror of
https://gitee.com/openharmony/third_party_spirv-tools
synced 2024-11-27 01:21:25 +00:00
utils/vscode: Add install.bat (#3071)
Installs the language server on windows. Also add info to / correct `README.md`.
This commit is contained in:
parent
03957e8a9f
commit
f31f26f739
@ -1,7 +1,17 @@
|
||||
# Visual Studio Code extension for SPIR-V disassembly files
|
||||
|
||||
This directory holds a Visual Studio Code extension adding syntax highlighting for SPIR-V disassembly files (.spirv)
|
||||
This directory holds a Visual Studio Code extension adding syntax highlighting for SPIR-V assembly files (`.spvasm`)
|
||||
|
||||
## Dependencies
|
||||
|
||||
In order to build and install the Visual Studio Code language server extension, you will need to install and have on your `PATH` the following dependencies:
|
||||
* [`npm`](https://www.npmjs.com/)
|
||||
* [`golang`](https://golang.org/)
|
||||
|
||||
## Installing (macOS / Linux)
|
||||
|
||||
Simply run `install.sh`
|
||||
Run `install.sh`
|
||||
|
||||
## Installing (Windows)
|
||||
|
||||
Run `install.bat`
|
||||
|
30
utils/vscode/install.bat
Normal file
30
utils/vscode/install.bat
Normal file
@ -0,0 +1,30 @@
|
||||
@REM Copyright (c) 2019 Google Inc.
|
||||
@REM
|
||||
@REM Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@REM you may not use this file except in compliance with the License.
|
||||
@REM You may obtain a copy of the License at
|
||||
@REM
|
||||
@REM http://www.apache.org/licenses/LICENSE-2.0
|
||||
@REM
|
||||
@REM Unless required by applicable law or agreed to in writing, software
|
||||
@REM distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@REM See the License for the specific language governing permissions and
|
||||
@REM limitations under the License.
|
||||
|
||||
@set EXT_PATH=%userprofile%\.vscode\extensions\google.spirvls-0.0.1
|
||||
@set ROOT_PATH=%~dp0
|
||||
|
||||
go run %ROOT_PATH%\src\tools\gen-grammar.go --cache %ROOT_PATH%\cache --template %ROOT_PATH%\spirv.json.tmpl --out %ROOT_PATH%\spirv.json
|
||||
go run %ROOT_PATH%\src\tools\gen-grammar.go --cache %ROOT_PATH%\cache --template %ROOT_PATH%\src\schema\schema.go.tmpl --out %ROOT_PATH%\src\schema\schema.go
|
||||
|
||||
if not exist %EXT_PATH% mkdir -p %EXT_PATH%
|
||||
copy %ROOT_PATH%\extension.js %EXT_PATH%
|
||||
copy %ROOT_PATH%\package.json %EXT_PATH%
|
||||
copy %ROOT_PATH%\spirv.json %EXT_PATH%
|
||||
|
||||
go build -o %EXT_PATH%\langsvr %ROOT_PATH%\src\langsvr.go
|
||||
|
||||
@pushd %EXT_PATH%
|
||||
call npm install
|
||||
@popd
|
@ -77,9 +77,12 @@ func run() error {
|
||||
}
|
||||
return rel
|
||||
}
|
||||
escape := func(str string) string {
|
||||
return strings.ReplaceAll(str, `\`, `/`)
|
||||
}
|
||||
args := []string{
|
||||
"--template=" + relPath(*templatePath),
|
||||
"--out=" + relPath(*outputPath),
|
||||
"--template=" + escape(relPath(*templatePath)),
|
||||
"--out=" + escape(relPath(*outputPath)),
|
||||
}
|
||||
return "gen-grammar.go " + strings.Join(args, " ")
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user