diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..cbb891b --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,30 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +# Use Dockerfile to get Dependabot version bumps after new image is released +FROM ghcr.io/eclipse-score/devcontainer:v1.8.0 + +ARG USERNAME=vscode + +# Rename 'vscode' to the host username for QNX-related user expectations. +# In environments using a license server, the QNX license might be bound to a username. +RUN if [ "$USERNAME" != "vscode" ]; then \ + usermod -l ${USERNAME} vscode \ + && groupmod -n ${USERNAME} vscode \ + && usermod -d /home/${USERNAME} -m ${USERNAME} \ + && ln -s /home/${USERNAME} /home/vscode \ + && echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USERNAME} \ + && chmod 0440 /etc/sudoers.d/${USERNAME}; \ + fi + +USER ${USERNAME} diff --git a/.devcontainer/devcontainer-lock.json b/.devcontainer/devcontainer-lock.json new file mode 100644 index 0000000..e3f1791 --- /dev/null +++ b/.devcontainer/devcontainer-lock.json @@ -0,0 +1,9 @@ +{ + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:4.0.0": { + "version": "4.0.0", + "resolved": "ghcr.io/devcontainers/features/docker-in-docker@sha256:4fa87399214366e320d489991769c4f3f461e1ffe461f54eea78a41b34945bb5", + "integrity": "sha256:4fa87399214366e320d489991769c4f3f461e1ffe461f54eea78a41b34945bb5" + } + } +} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..ba343ff --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,32 @@ +{ + "name": "eclipse-s-core", + "build": { + "dockerfile": "Dockerfile", + "args": { + "USERNAME": "${localEnv:USER}" + } + }, + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:4.0.0": {} + }, + "runArgs": [ + "--privileged" + ], + "remoteUser": "${localEnv:USER}", + "mounts": [ + { + "source": "${localEnv:HOME}/.qnx/license/licenses", + "target": "/opt/score_qnx/license/licenses", + "type": "bind" + }, + { + "source": "${localEnv:HOME}/.netrc", + "target": "/home/${localEnv:USER}/.netrc", + "type": "bind" + } + ], + "initializeCommand": { + "Make sure QNX license exists": "mkdir -p ~/.qnx/license && touch -a ~/.qnx/license/licenses", + "Make sure .netrc exists": "touch -a ~/.netrc" + } +} diff --git a/.gitignore b/.gitignore index 085f857..7566960 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,8 @@ styles/ .venv __pycache__/ /.coverage + +# Compilation databases for code completion in IDEs +.cache/* +compile_commands.json +rust-project.json diff --git a/BUILD b/BUILD index cfb9030..6593122 100644 --- a/BUILD +++ b/BUILD @@ -30,6 +30,7 @@ docs( copyright_checker( name = "copyright", srcs = [ + ".devcontainer", ".github", "docs", "examples", diff --git a/README.md b/README.md index 1e8af75..ec92c98 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,20 @@ It provides a **standardized project structure**, ensuring best practices for: ## 🚀 Getting Started +### 0️⃣ Set up development environment + +Use devcontainer as default path. It includes Bazel tooling and dependencies. + +1. Install Docker. +2. Open repository in a devcontainer-capable editor (for example VS Code with Dev Containers extension). +3. Reopen workspace in container. + +Official setup guide: +https://eclipse-score.github.io/score/main/contribute/development/development_environment.html + +If devcontainer not available, follow manual setup steps in same guide. + + ### 1️⃣ Clone the Repository ```sh