Precompiled.Env (precompiled v0.2.0)

Copy Markdown View Source

What the two places the client runs answer differently: a Mix project at build time (Precompiled.Env.MixProject) and the project Mix.install/2 keeps on a device (Precompiled.Env.MixInstall). Everything else in the client is shared.

Summary

Functions

The locked Hex entries among apps, in the order given. envs names each app's own compile env (Mix compiles a dep as :prod unless the project overrides it, e.g. {:foo, "~> 1.0", env: :dev}); an app missing from it gets "prod".

Types

candidate()

@type candidate() :: %{
  name: atom(),
  version: String.t(),
  lock_entry: tuple(),
  dep_env: String.t()
}

t()

@type t() :: %Precompiled.Env{
  build_lib: Path.t(),
  candidates: [candidate()],
  deps_path: Path.t(),
  installed: [atom()],
  installed_envs: %{optional(atom()) => String.t()},
  lock: map(),
  mix_target: String.t(),
  system: {String.t(), String.t()} | nil,
  tooling: [atom()] | nil
}

Functions

hex_candidates(lock, apps, envs \\ %{})

@spec hex_candidates(map(), [atom()], %{optional(atom()) => String.t()}) :: [
  candidate()
]

The locked Hex entries among apps, in the order given. envs names each app's own compile env (Mix compiles a dep as :prod unless the project overrides it, e.g. {:foo, "~> 1.0", env: :dev}); an app missing from it gets "prod".