Website: http://x-as-code.useblocks.com/
- Docker installed
- Visual Studio Code
Or use GitHub Codespaces and just run the devcontainer
Make sure the ubCode environment variables are available as specified here:
- ubcode
- graphviz
- CMake
Demonstrating Codelinks & Test-Reports
The project includes several build scripts to help you build different components:
| Script | Purpose | Description |
|---|---|---|
./scripts/build.sh |
Full build | Builds documentation, C++ executable, and runs unit tests |
./scripts/build_app.sh |
C++ only | Builds the C++ project and runs tests |
./scripts/build_doc.sh |
Docs only | Builds the Sphinx + Sphinx-Needs documentation |
./scripts/test_with_coverage.sh |
Tests with coverage | Builds C++ project, runs tests, and generates code coverage report |
./scripts/clean.sh |
Clean | Removes all build artifacts |
./scripts/run_http_server.sh |
Server generated HTML files | Opens a http server and servers the generated html files. With this method you can view the generated html files also when developing in Codespaces |
For first-time setup or complete rebuild:
./scripts/build.shBuild only the C++ application and tests:
./scripts/build_app.shBuild only the documentation:
./scripts/build_doc.shRun tests with code coverage:
./scripts/test_with_coverage.shThis will generate a coverage report in src/build/coverage_html/index.html.
Clean all build artifacts:
./scripts/clean.sh💡 Tip: Use
./scripts/build.shfor your first build, then use targeted scripts for faster incremental builds during development.
./scripts/run_http_server.shGitHub Codespaces provides a cloud-based development environment that comes pre-configured with all the tools needed for this project.
Before using Codespaces, you need to configure the required environment variables as Codespace secrets:
- Navigate to your GitHub user settings
- Go to Settings → Code, planning, and automation → Codespaces
- Add the following Codespace user secrets and assign them to the correct repository:
UBCODE_LICENSE_KEY: Your ubCode license keyUBCODE_LICENSE_USER: Your registered email address
This is also described here in more detail: https://docs.github.com/en/codespaces/managing-your-codespaces/managing-your-account-specific-secrets-for-github-codespaces
⚠️ Important: These secrets are required for the ubCode extension to function properly. Without them, the extension is not working.
-
Open in Codespaces
- Navigate to the GitHub repository
- Click the green Code button
- Select the Codespaces tab
- Click Create codespace on main (or any other branch you prefer)
-
Automatic Setup
- The devcontainer will automatically install:
- Python environment with uv package manager
- Java (for PlantUML diagrams)
- Graphviz (for diagram generation)
- CMake (for C++ project builds)
- ubCode VS Code extension
- Python VS Code extension
- The devcontainer will automatically install:
-
First Build Once the codespace is ready, run the full build:
./scripts/build.sh
The devcontainer includes:
- Base Image: Ubuntu 24.04.2 LTS
- Tools: Git, curl, wget, and other essential CLI tools
- Development Environment: Pre-configured VS Code with extensions
- Build Tools: CMake, Graphviz, Java, uv for the complete toolchain
After the codespace starts:
-
Build the documentation:
./scripts/build_doc.sh
-
Build the C++ project:
./scripts/build_app.sh
-
View the documentation:
- Open the generated HTML files using:
"$BROWSER" docs/_build/html/index.html -
Clean build artifacts:
./scripts/clean.sh
The following environment variables need to be available for the Codespace:
UBCODE_LICENSE_KEY: Your ubCode license key (from secrets)UBCODE_LICENSE_USER: Your registered email (from secrets)
Please checkout this page on how to add account specific secrets
With settings these variables the ubcode.toml file is not necessary anymore for the ubCode extension functionality.
If you prefer to set environment variables manually in the CLI (for testing or local development):
export UBCODE_LICENSE_KEY="your-license-key"
export UBCODE_LICENSE_USER="your-email@example.com"The devcontainer configuration is defined in .devcontainer/devcontainer.json. You can modify:
- Additional tools: Edit
scripts/postCreateCommand.shto install more packages - VS Code extensions: Add extensions to the
customizations.vscode.extensionsarray - Environment variables: Control installations by setting variables in the post-create script
- ✅ Instant Setup: No local dependencies required
- ✅ Consistent Environment: Same setup across all team members
- ✅ Pre-configured Tools: All necessary tools installed automatically
- ✅ Cloud Resources: Use GitHub's cloud infrastructure for builds
- ✅ Persistent Storage: Your work is automatically saved
- ✅ Secure Secrets: License keys managed through GitHub secrets
If you encounter issues:
-
Check environment variables: Verify that
UBCODE_LICENSE_KEYandUBCODE_LICENSE_USERare set:echo $UBCODE_LICENSE_KEY echo $UBCODE_LICENSE_USER
-
Verify secrets: Ensure the repository secrets are properly configured in GitHub
-
Restart the codespace: Sometimes a fresh start resolves configuration issues
-
Check the post-create logs: View the terminal output during setup
-
Rebuild container: Use Command Palette → "Codespaces: Rebuild Container"
💡 Tip: Codespaces is perfect for quick contributions, testing, or when you don't want to set up the development environment locally. The automated secret management ensures a seamless experience.