xref: /aosp_15_r20/external/robolectric/.devcontainer/README.md (revision e6ba16074e6af37d123cb567d575f496bf0a58ee)
1*e6ba1607SAndroid Build Coastguard Worker# GitHub's Codespaces Configuration
2*e6ba1607SAndroid Build Coastguard Worker
3*e6ba1607SAndroid Build Coastguard WorkerGitHub Codespaces is the vscode-based cloud development environment for GitHub
4*e6ba1607SAndroid Build Coastguard Workerprojects. We can use [devcontainer][devcontainer-introduction] to configure
5*e6ba1607SAndroid Build Coastguard Workercontainers for GitHub Codespaces when opening Robolectric project from it.
6*e6ba1607SAndroid Build Coastguard Worker
7*e6ba1607SAndroid Build Coastguard WorkerAs Robolectric there are special requirements for Android SDK and `ANDROID_SDK_HOME`
8*e6ba1607SAndroid Build Coastguard Workerenvironment variable for building, Robolectric selects
9*e6ba1607SAndroid Build Coastguard Worker[`Dockerfile`][devcontainer-introduction-docker] to configure necessary Android
10*e6ba1607SAndroid Build Coastguard Workerenvironment for itself.
11*e6ba1607SAndroid Build Coastguard Worker
12*e6ba1607SAndroid Build Coastguard WorkerAny contributor can update it based on the demand. When we update `Dockerfile`, we can run
13*e6ba1607SAndroid Build Coastguard Workerthe following command to build and test it locally:
14*e6ba1607SAndroid Build Coastguard Worker
15*e6ba1607SAndroid Build Coastguard Worker```shell
16*e6ba1607SAndroid Build Coastguard Workercd .devcontainer
17*e6ba1607SAndroid Build Coastguard Workerdocker buildx build .
18*e6ba1607SAndroid Build Coastguard Worker```
19*e6ba1607SAndroid Build Coastguard Worker
20*e6ba1607SAndroid Build Coastguard Worker> See [Docker's buildx repository][docker-buildx] to install buildx.
21*e6ba1607SAndroid Build Coastguard Worker
22*e6ba1607SAndroid Build Coastguard WorkerWhen local testing is passed, we can push it to remote custom branch, and checkout it
23*e6ba1607SAndroid Build Coastguard Workerwith latest change in GitHub's Codespaces page and then trigger "Rebuild Container" to
24*e6ba1607SAndroid Build Coastguard Workertest its configuration in GitHub's Codespaces environment.
25*e6ba1607SAndroid Build Coastguard Worker
26*e6ba1607SAndroid Build Coastguard WorkerIf everything goes well, sending the PR and wait the merging.
27*e6ba1607SAndroid Build Coastguard Worker
28*e6ba1607SAndroid Build Coastguard WorkerBecause devcontainer is brought by VSCode, this configuration can also be used
29*e6ba1607SAndroid Build Coastguard Workerfor VSCode.
30*e6ba1607SAndroid Build Coastguard Worker
31*e6ba1607SAndroid Build Coastguard Worker[devcontainer-introduction]: https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/introduction-to-dev-containers
32*e6ba1607SAndroid Build Coastguard Worker[devcontainer-introduction-docker]: https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/introduction-to-dev-containers#dockerfile
33*e6ba1607SAndroid Build Coastguard Worker[docker-buildx]: https://github.com/docker/buildx
34