Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sammi/bazel-to-msbuild
Generate visual studio solution from a bazel workspace.
https://github.com/sammi/bazel-to-msbuild
bazel msbuild visualstudio
Last synced: 11 days ago
JSON representation
Generate visual studio solution from a bazel workspace.
- Host: GitHub
- URL: https://github.com/sammi/bazel-to-msbuild
- Owner: sammi
- License: mit
- Created: 2020-12-31T04:34:23.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-19T22:02:30.000Z (almost 3 years ago)
- Last Synced: 2024-07-31T07:15:47.871Z (3 months ago)
- Topics: bazel, msbuild, visualstudio
- Language: C++
- Homepage:
- Size: 1.15 MB
- Stars: 10
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-bazel - bazel-to-msbuild - Generate Visual Studio solution and projects from bazel workspace, command line tool build by Java. (Tooling / Project generators)
README
bazel-to-msbuild
----------------Generate msbuild project from bazel project
- [x] It is using ```bazel query ... output=proto``` to gather all cc_library, cc_binary, and cc_test packages;
- [x] It generates one msbuild project for one target;
- [x] It generates one solution for one bazel workspace;
- [x] It detects target dependencies and manage them as project references in msbuild project;
- [x] It detects Windows dll library and manage dll library as the application project reference;
- [ ] It detects midl file and manage it by Midl task in project;# Install and Usage
Unzip the tool and put it in your PATH
```
wget https://github.com/sammi/bazel-to-msbuild/releases/download/v0.2.11/b2m-0.2.11.zip
unzip b2m-0.2.11.zip
#On linux and/or Mac
cd b2m
chmod a+x b2m
```Run the command:
```
b2m {your_bazel_workspace_dir} {your_solution_file_name}
```Generate project with static library
```
cd bazel-to-msbuild\integration\src\test\resources\stage3
b2m . app
```
Then you should be able to find msbuild solution and project files under stage3 folder:
```
app.sln
lib\hello-time.vcxproj
lib\hello-time.filters
lib\hello-time.user
main\hello-greet.vcxproj
main\hello-greet.filters
main\hello-greet.user
main\hello-world.vcxproj
main\hello-world.filters
main\hello-world.user
```
Generate project with static library
```
cd bazel-to-msbuild\integration\src\test\resources\dll
b2m . app
```
Then you should be able to find msbuild solution and project files under dll folder:
```
app.sln
clib\clib.vcxproj
clib\clib.filters
clib\clib.user
main\main.vcxproj
main\main.filters
main\main.user
```Then Open app.sln by Visualstudio, set main as the startup project, you should be able to debug the application and its dll library clib.
# Sample bazel projects
We have sample projects in our integration test resources folder, which can be built by bazel, and be converted to msbuild solution and projects.https://github.com/sammi/bazel-to-msbuild/tree/main/integration/src/test/resources