Skip to content

Commit ddd2b1e

Browse files
committed
Add VSCode Tasks and documentation
1 parent 9cb77a2 commit ddd2b1e

File tree

3 files changed

+80
-1
lines changed

3 files changed

+80
-1
lines changed

.devcontainer/prepare_workspace.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ GITA_PROJECT_HOME=$(pwd)/.gita
1717
mkdir -p "$GITA_PROJECT_HOME"
1818
export GITA_PROJECT_HOME
1919

20-
# Generate a few workspace metadata files from known_good.json:
20+
# Generate workspace metadata files from known_good.json:
2121
# - .gita-workspace.csv
2222
python3 tools/known_good_to_workspace_metadata.py --known-good known_good.json --gita-workspace .gita-workspace.csv

.vscode/tasks.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Update workspace metadata from known good",
6+
"type": "shell",
7+
"command": "python3",
8+
"args": [
9+
"tools/known_good_to_workspace_metadata.py"
10+
],
11+
"problemMatcher": []
12+
},
13+
{
14+
"label": "Switch Bazel modules to local_path_overrides",
15+
"type": "shell",
16+
"command": "python3",
17+
"args": [
18+
"tools/update_module_from_known_good.py",
19+
"--override-type",
20+
"local_path"
21+
],
22+
"problemMatcher": []
23+
},
24+
{
25+
"label": "Switch Bazel modules to git_overrides",
26+
"type": "shell",
27+
"command": "python3",
28+
"args": [
29+
"tools/update_module_from_known_good.py",
30+
"--override-type",
31+
"git"
32+
]
33+
},
34+
{
35+
"label": "Gita: Generate workspace",
36+
"type": "shell",
37+
"command": "gita",
38+
"args": [
39+
"clone",
40+
"--preserve-path",
41+
"--from-file",
42+
".gita-workspace.csv"
43+
],
44+
"problemMatcher": []
45+
}
46+
]
47+
}

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,38 @@ Execute `bazel query //feature_showcase/...` to obtain list of targets that You
5757
bazel build --config bl-x86_64-linux @score_orchestrator//src/... --verbose_failures
5858
```
5959

60+
## Workspace support
61+
62+
You can obtain a complete S-CORE workspace, i.e. a git checkout of all modules from `known_good.json`, on the specific branches / commits, integrated into one Bazel build.
63+
This helps with cross-module development, debugging, and generally "trying out things".
64+
The startup of the supplied devcontainer already generates the required metadata.
65+
66+
The supported workspace managers are:
67+
68+
| Name | Description |
69+
|------|-------------|
70+
| [Gita](https://github.com/nosarthur/gita) | "a command-line tool to manage multiple git repos" |
71+
72+
A description of how to use these workspace managers, together with their advantages and drawbacks, is beyond the scope of this document.
73+
In case of doubt, choose the first.
74+
75+
### Initialization of the workspace
76+
77+
> [!WARNING]
78+
> This will change the file `score_modules.MODULE.bazel`.
79+
> Do **not** commit these changes!
80+
81+
1. Switch to local path overrides, using the VSCode Task (`Terminal`->`Run Task...`) "Switch Bazel modules to `local_path_overrides`".
82+
Note that you can switch back to `git_overrides` (the default) using the task "Switch Bazel modules to `git_overrides`"
83+
84+
2. Run VSCode Task "<Name>: Generate workspace", e.g. "Gita: Generate workspace".
85+
This will clone all modules using the chosen workspace manager.
86+
The modules will be in sub-directories starting with `score_`.
87+
Note that the usage of different workspace managers is mutually exclusive.
88+
89+
When you now run Bazel, it will use the local working copies of all modules and not download them from git remotes.
90+
You can make local changes to each module, which will be directly reflected in the next Bazel run.
91+
6092
## Known Issues ⚠️
6193

6294
### Orchestrator

0 commit comments

Comments
 (0)