Add dependencies to a 4D project by updating the appropriate configuration files.
Run the script to add a dependency:
python3 scripts/add_dependency.py <repo> [options]
repo: GitHub repo (owner/repo), GitHub URL, or local path--name NAME: Override dependency name (default: derived from repo)--tag TAG: Exact version tag (e.g., 1.0.0)--version VERSION: Semantic version (e.g., latest, 1.1.0)--project PATH: Path to 4D project root# GitHub dependency with tag
python3 scripts/add_dependency.py mesopelagique/JSONRPC --tag 1.0.0
# GitHub URL (no version)
python3 scripts/add_dependency.py https://github.com/mesopelagique/SemVer
# GitHub release URL (tag extracted automatically)
python3 scripts/add_dependency.py https://github.com/mesopelagique/SemVer/releases/tag/0.2.0
# Local sibling folder
python3 scripts/add_dependency.py ../MyComponent
# Local folder with custom name
python3 scripts/add_dependency.py /path/to/component --name MyComponent
Located at Project/Sources/dependencies.json:
{
"version": 2130,
"dependencies": {
"LocalComponent": {},
"GitHubComponent": {
"github": "owner/repo",
"tag": "1.0.0"
}
}
}
Required for non-sibling local dependencies. Found by walking up from project root, or created in parent directory:
{
"dependencies": {
"ComponentName": "file:///path/to/component.4dbase"
}
}
github field and optional tag/version
/releases/tag/x.x.x) automatically extract the tag{} to dependencies.json onlyfile:// path to environment4d.json