sdk

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package sdk wraps sdkmanager for high-level SDK management operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bootstrapper

type Bootstrapper struct{}

Bootstrapper installs Android SDK command-line tools from scratch. It has no dependency on android.SDKLocator and works without any pre-existing SDK.

func NewBootstrapper

func NewBootstrapper() *Bootstrapper

NewBootstrapper creates a Bootstrapper.

func (*Bootstrapper) Bootstrap

func (b *Bootstrapper) Bootstrap(ctx context.Context, targetDir string, force bool) (string, bool, error)

Bootstrap installs cmdline-tools into the resolved SDK root. targetDir overrides auto-detection when non-empty; otherwise the resolution order is $ANDROID_HOME → $ANDROID_SDK_ROOT → platform default. Returns (sdkRoot, alreadyInstalled, error).

type Package

type Package struct {
	Path        string
	Version     string
	Description string
	Location    string
	Installed   bool
}

Package represents an SDK package entry from sdkmanager --list.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service wraps sdkmanager operations.

func New

func New(loc *android.SDKLocator) *Service

New creates a new Service.

func (*Service) AcceptLicenses

func (s *Service) AcceptLicenses(ctx context.Context) (int, error)

AcceptLicenses pipes "y" to all license prompts.

func (*Service) Install

func (s *Service) Install(ctx context.Context, packages []string) error

Install installs one or more SDK packages by path.

func (*Service) List

func (s *Service) List(ctx context.Context, installed, available bool, channel string) ([]Package, error)

List returns installed and/or available SDK packages.

func (*Service) Uninstall

func (s *Service) Uninstall(ctx context.Context, packages []string) error

Uninstall uninstalls one or more SDK packages.

func (*Service) Update

func (s *Service) Update(ctx context.Context) error

Update updates all installed SDK packages.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL