Skip to content
Open
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
9 changes: 9 additions & 0 deletions .github/workflows/e2e-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ jobs:
with:
enable-cache: true

- name: Rewrite plugin URLs to local
run: bash scripts/dev/rewrite-plugin-urls.sh --to-local examples/

- name: Run Android E2E test
working-directory: examples/android
env:
Expand Down Expand Up @@ -131,6 +134,9 @@ jobs:
with:
enable-cache: true

- name: Rewrite plugin URLs to local
run: bash scripts/dev/rewrite-plugin-urls.sh --to-local examples/

- name: Run iOS E2E test
working-directory: examples/ios
env:
Expand Down Expand Up @@ -245,6 +251,9 @@ jobs:
with:
enable-cache: true

- name: Rewrite plugin URLs to local
run: bash scripts/dev/rewrite-plugin-urls.sh --to-local examples/

- name: Run React Native E2E test
working-directory: examples/react-native
run: |
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ jobs:
with:
enable-cache: true

- name: Rewrite plugin URLs to local
run: bash scripts/dev/rewrite-plugin-urls.sh --to-local examples/

- name: Run Android E2E test
working-directory: examples/android
env:
Expand Down Expand Up @@ -139,6 +142,9 @@ jobs:
with:
enable-cache: true

- name: Rewrite plugin URLs to local
run: bash scripts/dev/rewrite-plugin-urls.sh --to-local examples/

- name: Run iOS E2E test
working-directory: examples/ios
env:
Expand Down Expand Up @@ -253,6 +259,9 @@ jobs:
with:
enable-cache: true

- name: Rewrite plugin URLs to local
run: bash scripts/dev/rewrite-plugin-urls.sh --to-local examples/

- name: Run React Native E2E test
working-directory: examples/react-native
run: |
Expand Down
8 changes: 8 additions & 0 deletions devbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
"sync": [
"echo 'Syncing example projects with latest plugins...'",
"echo ''",
"echo 'Rewriting plugin URLs to local paths...'",
"bash scripts/dev/rewrite-plugin-urls.sh --to-local examples/",
"echo ''",
"echo '1/3 Android...'",
"(cd examples/android && rm -rf .devbox devbox.d devbox.lock && devbox install)",
"echo ' Generating device lock file...'",
Expand Down Expand Up @@ -194,6 +197,11 @@
"bump": [
"bash scripts/bump.sh \"${@}\""
],
"restore-plugin-urls": [
"echo 'Restoring plugin URLs to GitHub format...'",
"bash scripts/dev/rewrite-plugin-urls.sh --to-github examples/",
"echo '✓ Plugin URLs restored to GitHub format'"
],
"test:fast": [
"echo 'Running fast tests (lint + unit + integration in parallel)...'",
"devbox run lint",
Expand Down
49 changes: 49 additions & 0 deletions devbox.lock
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,55 @@
}
}
},
"rustup@latest": {
"last_modified": "2026-04-01T01:09:41Z",
"plugin_version": "0.0.1",
"resolved": "github:NixOS/nixpkgs/62e3050a29278c985725a86704faa1e99236b51a#rustup",
"source": "devbox-search",
"version": "1.29.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/vf4ymfv40jsq1r2bapps3ll8xxqng794-rustup-1.29.0",
"default": true
}
],
"store_path": "/nix/store/vf4ymfv40jsq1r2bapps3ll8xxqng794-rustup-1.29.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/q335jx3dgagxcj79bgxaxa027bq3vf7a-rustup-1.29.0",
"default": true
}
],
"store_path": "/nix/store/q335jx3dgagxcj79bgxaxa027bq3vf7a-rustup-1.29.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/psqiilmbpc0d5c12qpswamkhdgzq5dcv-rustup-1.29.0",
"default": true
}
],
"store_path": "/nix/store/psqiilmbpc0d5c12qpswamkhdgzq5dcv-rustup-1.29.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/3jmhpvfwqag9jcxi21l2lrv79ha7h4p5-rustup-1.29.0",
"default": true
}
],
"store_path": "/nix/store/3jmhpvfwqag9jcxi21l2lrv79ha7h4p5-rustup-1.29.0"
}
}
},
"shellcheck@latest": {
"last_modified": "2026-01-23T17:20:52Z",
"resolved": "github:NixOS/nixpkgs/a1bab9e494f5f4939442a57a58d0449a109593fe#shellcheck",
Expand Down
14 changes: 14 additions & 0 deletions examples/android/devbox.d/android/android.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"ANDROID_BUILD_TOOLS_VERSION": "36.1.0",
"ANDROID_CMDLINE_TOOLS_VERSION": "19.0",
"ANDROID_COMPILE_SDK": 36,
"ANDROID_TARGET_SDK": 36,
"ANDROID_SYSTEM_IMAGE_TAG": "google_apis",
"ANDROID_INCLUDE_NDK": false,
"ANDROID_NDK_VERSION": "27.0.12077973",
"ANDROID_INCLUDE_CMAKE": false,
"ANDROID_CMAKE_VERSION": "3.22.1",
"hash_overrides": {
"https://dl.google.com/android/repository/platform-tools_r37.0.0-darwin.zip": "8c4c926d0ca192376b2a04b0318484724319e67c"
}
}
27 changes: 27 additions & 0 deletions examples/android/devbox.d/android/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

147 changes: 147 additions & 0 deletions examples/android/devbox.d/android/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
{
description = "Android SDK tools for Devbox (plugin local flake)";

inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

outputs =
{ self, nixpkgs }:
let
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];

# Read android.lock (generated by android.sh devices sync)
# On first initialization, android.lock may not exist yet, so provide defaults
androidLockExists = builtins.pathExists ./android.lock;
androidLockData = if androidLockExists
then builtins.fromJSON (builtins.readFile ./android.lock)
else {
# Default values for initial flake evaluation before sync runs
ANDROID_BUILD_TOOLS_VERSION = "36.1.0";
ANDROID_CMDLINE_TOOLS_VERSION = "19.0";
ANDROID_SYSTEM_IMAGE_TAG = "google_apis";
ANDROID_INCLUDE_NDK = false;
ANDROID_NDK_VERSION = "27.0.12077973";
ANDROID_INCLUDE_CMAKE = false;
ANDROID_CMAKE_VERSION = "3.22.1";
};
defaultsData = androidLockData;
getVar =
name:
if builtins.hasAttr name defaultsData then toString (builtins.getAttr name defaultsData)
else builtins.throw "Missing required value in android.json: ${name}";

unique =
list:
builtins.foldl' (
acc: item: if builtins.elem item acc then acc else acc ++ [ item ]
) [ ] list;

lockData =
if builtins.pathExists ./devices.lock
then builtins.fromJSON (builtins.readFile ./devices.lock)
else { devices = [ ]; };

# Extract API versions from lock file devices array, default to latest if empty
deviceApis =
if builtins.hasAttr "devices" lockData && (builtins.length lockData.devices) > 0
then map (device: device.api) lockData.devices
else [ 36 ]; # Default to latest stable API

# Include ANDROID_COMPILE_SDK in platform versions if set (for projects
# that compile against a different API than the emulator/device targets)
compileSdkApis =
if builtins.hasAttr "ANDROID_COMPILE_SDK" defaultsData
then [ (toString defaultsData.ANDROID_COMPILE_SDK) ]
else [];

androidSdkConfig = {
platformVersions = unique ((map toString deviceApis) ++ compileSdkApis);
buildToolsVersion = getVar "ANDROID_BUILD_TOOLS_VERSION";
cmdLineToolsVersion = getVar "ANDROID_CMDLINE_TOOLS_VERSION";
systemImageTypes = [ (getVar "ANDROID_SYSTEM_IMAGE_TAG") ];
includeNDK =
if builtins.hasAttr "ANDROID_INCLUDE_NDK" defaultsData then defaultsData.ANDROID_INCLUDE_NDK else false;
ndkVersion = getVar "ANDROID_NDK_VERSION";
includeCMake =
if builtins.hasAttr "ANDROID_INCLUDE_CMAKE" defaultsData then defaultsData.ANDROID_INCLUDE_CMAKE else false;
cmakeVersion = getVar "ANDROID_CMAKE_VERSION";
};

# Hash overrides for when Google updates files on their servers
# These can be set in android.lock to work around nixpkgs hash mismatches
# By default this field is not set - only set via `android.sh hash update` when upstream is broken
hashOverrides = if builtins.hasAttr "hash_overrides" androidLockData
then androidLockData.hash_overrides
else {};

forAllSystems =
f:
builtins.listToAttrs (
map (system: {
name = system;
value = f system;
}) systems
);
in
{
packages = forAllSystems (
system:
let
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
android_sdk.accept_license = true;
};
};

abiVersions = if builtins.match "aarch64-.*" system != null then [ "arm64-v8a" ] else [ "x86_64" ];

# Apply hash overrides to nixpkgs if any are specified
# Android packages use SHA1 hashes, not SHA256
# We need to re-import nixpkgs with overlays when overrides are present
pkgsWithOverrides = if (builtins.length (builtins.attrNames hashOverrides)) > 0
then import nixpkgs {
inherit system;
config = {
allowUnfree = true;
android_sdk.accept_license = true;
};
overlays = [(final: prev: {
fetchurl = args:
if builtins.isAttrs args && builtins.hasAttr "url" args && builtins.hasAttr args.url hashOverrides
then prev.fetchurl (args // { sha1 = hashOverrides.${args.url}; })
else prev.fetchurl args;
})];
}
else pkgs;

androidPkgs =
config:
pkgsWithOverrides.androidenv.composeAndroidPackages {
platformVersions = config.platformVersions;
buildToolsVersions = [ config.buildToolsVersion ];
cmdLineToolsVersion = config.cmdLineToolsVersion;
includeEmulator = true;
includeSystemImages = true;
includeNDK = config.includeNDK;
ndkVersions = if config.includeNDK && config.ndkVersion != "" then [ config.ndkVersion ] else [ ];
includeCmake = config.includeCMake;
cmakeVersions = if config.includeCMake && config.cmakeVersion != "" then [ config.cmakeVersion ] else [ ];
abiVersions = abiVersions;
systemImageTypes = config.systemImageTypes;
};
in
{
android-sdk = (androidPkgs androidSdkConfig).androidsdk;
default = (androidPkgs androidSdkConfig).androidsdk;
}
);

androidSdkConfig = androidSdkConfig;
};
}
2 changes: 1 addition & 1 deletion examples/android/devbox.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"include": ["path:../../plugins/android/plugin.json"],
"include": ["github:segment-integrations/mobile-devtools?dir=plugins/android&ref=main"],
"packages": {
"jdk17": "latest",
"gradle": "latest"
Expand Down
2 changes: 1 addition & 1 deletion examples/ios/devbox.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"include": ["path:../../plugins/ios/plugin.json"],
"include": ["github:segment-integrations/mobile-devtools?dir=plugins/ios&ref=main"],
"packages": {
"process-compose": "latest"
},
Expand Down
14 changes: 14 additions & 0 deletions examples/react-native/devbox.d/android/android.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"ANDROID_BUILD_TOOLS_VERSION": "35.0.0",
"ANDROID_CMDLINE_TOOLS_VERSION": "19.0",
"ANDROID_COMPILE_SDK": 35,
"ANDROID_TARGET_SDK": 35,
"ANDROID_SYSTEM_IMAGE_TAG": "google_apis",
"ANDROID_INCLUDE_NDK": true,
"ANDROID_NDK_VERSION": "29.0.14206865",
"ANDROID_INCLUDE_CMAKE": true,
"ANDROID_CMAKE_VERSION": "4.1.2",
"hash_overrides": {
"https://dl.google.com/android/repository/platform-tools_r37.0.0-darwin.zip": "8c4c926d0ca192376b2a04b0318484724319e67c"
}
}
27 changes: 27 additions & 0 deletions examples/react-native/devbox.d/android/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading