Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Development Container for SQLite Query Analyzer

This directory contains configuration for a development container that provides a consistent environment for building and testing the SQLite Query Analyzer.

## Features

- Full C++ development environment with GCC/Clang
- Qt 6.9.0 for GUI development
- PowerShell for cross-platform scripting
- SSH server for remote development
- Docker-in-Docker for building Snap packages

## Building Snap Packages

The development container is configured with Docker-in-Docker support for building Snap packages. You can use the `snap-build` command to build Snap packages from within the container:

```bash
# Navigate to your project directory
cd /workspaces/sqlitequery

# Build snap package
snap-build
```

The `snap-build` command is a wrapper around the Snapcraft Docker container that ensures:

1. Snap packages can be built within the development container
2. No need to install snapd or snapcraft directly in the container
3. Consistent build environment across all development machines

## Additional Notes

- The build command mounts your current directory into the Snapcraft container
- You can pass additional arguments to snapcraft by adding them to the `snap-build` command
- If you need to customize the snap building process further, you can modify the `.devcontainer/snap-build.sh` script
5 changes: 3 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"image": "mcr.microsoft.com/devcontainers/cpp:ubuntu-24.04", // Base image
"features": {
"ghcr.io/devcontainers/features/powershell:1": {},
"ghcr.io/devcontainers/features/sshd:1.0.10": {}
"ghcr.io/devcontainers/features/sshd:1.0.10": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"forwardPorts": [22],
"postCreateCommand": "sudo apt-get update && sudo apt-get install -y python3 python3-pip && sudo apt install -y libglx-dev libgl1-mesa-dev libxkbcommon-x11-dev libfontconfig1 libdbus-1-dev && pip install aqtinstall --break-system-packages && aqt install-qt linux desktop 6.9.0",
"postCreateCommand": "sudo apt-get update && sudo apt-get install -y python3 python3-pip && sudo apt install -y libglx-dev libgl1-mesa-dev libxkbcommon-x11-dev libfontconfig1 libdbus-1-dev && pip install aqtinstall --break-system-packages && aqt install-qt linux desktop 6.9.0 && sudo cp /workspaces/sqlitequery/.devcontainer/snap-build.sh /usr/local/bin/snap-build && sudo chmod +x /usr/local/bin/snap-build",
"remoteUser": "vscode",
"remoteEnv": {
"QT_DIR": "/workspaces/sqlitequery/6.9.0/gcc_64",
Expand Down
15 changes: 15 additions & 0 deletions .devcontainer/snap-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
# This script provides an easy way to build snap packages in the development container

# Check if we're in the right directory
if [ ! -f "snapcraft.yaml" ] && [ ! -f "snap/snapcraft.yaml" ]; then
echo "Error: No snapcraft.yaml found in current directory or snap/ subdirectory"
echo "Please run this script from the project root directory"
exit 1
fi

echo "Building snap package using snapcraft Docker container..."
docker pull snapcore/snapcraft:stable
docker run --rm -v "$(pwd)":/build -w /build snapcore/snapcraft:stable snapcraft "$@"

echo "Snap package build complete!"