DalaDev.OtpDownloader (dala_dev v0.0.3)

Copy Markdown View Source

Downloads and caches pre-built OTP releases from GitHub for Android and iOS simulator.

Artifacts are cached at ~/.dala/cache/ and reused across projects.

Cache Validation

A valid OTP directory must contain at least one erts-* subdirectory. iOS device tarballs have additional requirements (see ios_device_extras_present?/1).

Summary

Functions

Returns the cached Android OTP directory path (may not exist yet).

Ensures the Android OTP release is cached.

Ensures the iOS device OTP release is cached.

Ensures the iOS simulator OTP release is cached.

Returns the cached iOS device OTP directory path (may not exist yet).

Returns the cached iOS simulator OTP directory path (may not exist yet).

Functions

android_otp_dir(abi \\ "arm64-v8a")

@spec android_otp_dir(String.t()) :: String.t()

Returns the cached Android OTP directory path (may not exist yet).

ensure_android(abi \\ "arm64-v8a")

@spec ensure_android(String.t()) :: {:ok, String.t()} | {:error, term()}

Ensures the Android OTP release is cached.

Returns {:ok, path} on success, {:error, reason} on failure.

Parameters

  • abi: Android ABI (default: "arm64-v8a"). Use "armeabi-v7a" for 32-bit ARM.

ensure_ios_device()

@spec ensure_ios_device() :: {:ok, String.t()} | {:error, term()}

Ensures the iOS device OTP release is cached.

Returns {:ok, path} on success, {:error, reason} on failure.

ensure_ios_sim()

@spec ensure_ios_sim() :: {:ok, String.t()} | {:error, term()}

Ensures the iOS simulator OTP release is cached.

Returns {:ok, path} on success, {:error, reason} on failure.

ios_device_otp_dir()

@spec ios_device_otp_dir() :: String.t()

Returns the cached iOS device OTP directory path (may not exist yet).

ios_sim_otp_dir()

@spec ios_sim_otp_dir() :: String.t()

Returns the cached iOS simulator OTP directory path (may not exist yet).