Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
mise list-all android-sdk
mise install android-sdk@13.0
mise exec android-sdk@13.0 -- sdkmanager --version
echo y | mise exec android-sdk@13.0 -- sdkmanager platform-tools
mise exec android-sdk@13.0 -- adb version

unit-test:
runs-on: ubuntu-latest
Expand Down
16 changes: 15 additions & 1 deletion hooks/env_keys.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function PLUGIN:EnvKeys(ctx)
-- Structure is: install_path/cmdline-tools/VERSION/bin
local bin_path = file.join_path(install_path, "cmdline-tools", version, "bin")

return {
local env_vars = {
{
key = "PATH",
value = bin_path,
Expand All @@ -25,4 +25,18 @@ function PLUGIN:EnvKeys(ctx)
value = install_path,
},
}

-- Add tools installed with sdkmanager to PATH, if they exist
local optional_bin_paths = { "platform-tools", "emulator" }
for _, relative_optional_bin_path in ipairs(optional_bin_paths) do
local optional_bin_path = file.join_path(install_path, relative_optional_bin_path)
if file.exists(optional_bin_path) then
table.insert(env_vars, {
key = "PATH",
value = optional_bin_path,
})
end
end

return env_vars
end
Loading