Skip to content

Target Kinds

Once ships target kinds for supported languages and platforms. Each target kind defines its accepted attributes and dependencies, the providers it emits, and the capabilities it exposes. Its reference page also lists known limitations and a copyable declaration when one is available.

Use once query schema to inspect the same contract from the command line. See Ecosystems for help choosing between typed target kinds and scripted automation.

Apple target kinds

Android target kinds

  • android_resource: Android resources and assets compiled into a static resource package
  • android_library: Android Java library packaged as a Java archive and Android library archive
  • android_local_test: Android Java and Kotlin local tests run on the host Java virtual machine
  • android_instrumentation_test: Android instrumentation tests run on a device or emulator
  • android_binary: Android application package built from Java sources, resources, native libraries, Android resource dependencies, and Android library dependencies

Swift target kinds

  • swift_android_library: Swift shared library compiled for Android and packaged through Android native-library providers

Kotlin target kinds

Elixir target kinds

  • elixir_library: Elixir code compiled into cacheable bytecode with a target-level compiler action
  • elixir_test: ExUnit tests run against an already compiled Elixir application

Rust target kinds

  • cargo_dependencies: cacheable Cargo dependency set consumed by Rust targets
  • rust_library: Rust library artifact consumed by downstream Rust targets, or native static or shared libraries consumed by Apple and Android targets
  • rust_mobile_library: Rust native library materialized by Apple and Android consumers under one target label
  • rust_binary: Rust executable built from a main crate and Rust deps, with build and run capabilities
  • rust_test: Rust test crate compiled with rustc --test and run through Once's test capability
  • rust_crate: resolved third-party Cargo package lowered into a Rust library target
  • rust_proc_macro: Rust procedural macro compiled for Rust targets

C target kinds

  • c_library: C and C++ static library provider consumed by native target kinds

Zig target kinds

  • zig_library: Zig module provider compiled at the use site by downstream Zig targets
  • zig_c_library: Zig module generated from C provider headers
  • zig_binary: Zig executable built from a root module, Zig module dependencies, and C provider dependencies
  • zig_static_library: Zig static library exposed to native linkers
  • zig_shared_library: Zig shared library exposed to native linkers and Android packaging
  • zig_test: Zig test target compiled and run through Once's test capability
  • zig_configure: configured Zig library target using Once-native target attributes
  • zig_configure_binary: configured Zig executable target using Once-native target attributes
  • zig_configure_test: configured Zig test target using Once-native target attributes

Released under an open-source license.