Skip to content

Commit

Permalink
Initial GitHub Codespaces (AKA Dev Container) configuration (see #2481)…
Browse files Browse the repository at this point in the history
… (#2482)

Intentionally does not install Gradle VSC extension after all (because it doesn't seem to work well).

Installs Java 17 instead of 11 in GitHub Codespace Dev Container so that the Gradle build works on CLI in Codespaces.

Uses akhildevelops instead of nordcominc to install Android SDK because that seems to work better.

Note that you'll need the akhildevelops/devcontainer-features#7 workaround.

Includes initial documentation describing Dev Containers for GitHub Codespaces support.
  • Loading branch information
vorburger committed Apr 17, 2024
1 parent ae5a2ec commit 6ff0643
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// https://aka.ms/devcontainer.json
{
"name": "Android FHIR, by Google",

// https://github.com/devcontainers/templates/tree/main/src/java
"image": "mcr.microsoft.com/devcontainers/java:1-17-bookworm",

"features": {
// https://github.com/akhildevelops/devcontainer-features/issues/7
"ghcr.io/akhildevelops/devcontainer-features/android-cli:0": {}

// https://github.com/CASL0/devcontainer-features/issues/4
// "ghcr.io/casl0/devcontainer-features/android-sdk:1": {}

// https://github.com/NordcomInc/devcontainer-features/issues/20
// "ghcr.io/nordcominc/devcontainer-features/android-sdk:1": {
// "platform": "33",
// "build_tools": "33.0.1"
// }
}

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "java -version",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
7 changes: 7 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@ updates:
interval: weekly
day: monday
time: "04:00"

- package-ecosystem: "devcontainers"
directory: /
schedule:
interval: monthly
day: monday
time: "04:00"
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["davidanson.vscode-markdownlint"]
}
18 changes: 18 additions & 0 deletions docs/contrib/codespaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Dev Containers for GitHub Codespaces

This project includes (initial) support for
[GitHub Codespaces](https://docs.github.com/en/codespaces/overview), based on
[Development Containers](https://containers.dev) technology.

**Status:** This is currently primarily used as a ready-made environment
for documentation writing for this project. The Gradle build also works.
However support for Kotlin development for Android is TBD.
Your contributions to make this better are very welcome.

## Usage

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/google/android-fhir?quickstart=1)

If you are missing your fancy custom Shell configuration that you have built over the last 100 years,
you should [set up your dotfiles for Codespaces](https://docs.github.com/en/codespaces/setting-your-user-preferences/personalizing-github-codespaces-for-your-account#dotfiles)
such as [e.g. this dude did in his dotfiles](https://github.com/vorburger/vorburger-dotfiles-bin-etc#github-codespaces).

0 comments on commit 6ff0643

Please sign in to comment.