Enum Class BunSystem

java.lang.Object
java.lang.Enum<BunSystem>
io.github.m_segreti.BunSystem
All Implemented Interfaces:
Serializable, Comparable<BunSystem>, Constable

public enum BunSystem extends Enum<BunSystem>
Enumeration of supported Bun platform/system combinations.

Each enum constant represents a specific operating system and CPU architecture pairing and defines:

  • The name of the Bun release zip asset to download.
  • The expected name of the Bun executable within the extracted distribution.

This enum is used by the Bun Gradle plugin to:

  • Select the correct Bun release asset for the current build environment.
  • Locate the executable after extraction.
  • Allow users to explicitly override platform detection if necessary.

Platform Variants

Some platforms provide multiple builds (e.g. baseline vs non-baseline, glibc vs musl). Only a subset is automatically detected; others may be selected explicitly by users via the bun { system = ... } configuration.
  • Enum Constant Details

    • WINDOWS_X64

      public static final BunSystem WINDOWS_X64
      Windows x64 build using the standard runtime.
    • WINDOWS_X64_BASELINE

      public static final BunSystem WINDOWS_X64_BASELINE
      Windows x64 baseline build (more compatible, potentially slower).
    • DARWIN_AARCH64

      public static final BunSystem DARWIN_AARCH64
      macOS (Darwin) ARM64 / Apple Silicon build.
    • DARWIN_X64

      public static final BunSystem DARWIN_X64
      macOS (Darwin) x64 / Intel build.
    • LINUX_X64

      public static final BunSystem LINUX_X64
      Linux x64 build targeting glibc.
    • LINUX_X64_BASELINE

      public static final BunSystem LINUX_X64_BASELINE
      Linux x64 baseline build targeting glibc.
    • LINUX_AARCH64

      public static final BunSystem LINUX_AARCH64
      Linux ARM64 build targeting glibc.
    • LINUX_X64_MUSL

      public static final BunSystem LINUX_X64_MUSL
      Linux x64 build targeting musl (e.g. Alpine Linux).
    • LINUX_X64_MUSL_BASELINE

      public static final BunSystem LINUX_X64_MUSL_BASELINE
      Linux x64 baseline build targeting musl.
    • LINUX_AARCH64_MUSL

      public static final BunSystem LINUX_AARCH64_MUSL
      Linux ARM64 build targeting musl.
  • Method Details

    • values

      public static BunSystem[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static BunSystem valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • zipName

      public String zipName()
      Returns the name of the Bun zip asset associated with this system.
      Returns:
      the Bun zip file name (as published on GitHub releases)
    • exeName

      public String exeName()
      Returns the expected name of the Bun executable for this system.
      Returns:
      the executable file name (e.g. bun or bun.exe)
    • detect

      public static BunSystem detect()
      Detects the current operating system and CPU architecture and selects the most appropriate BunSystem.

      Detection is based on the standard JVM system properties:

      • os.name
      • os.arch

      Only the most common system combinations are auto-detected. More specialized variants (such as musl or baseline builds) must be selected explicitly by configuring the plugin.

      Returns:
      the detected BunSystem
      Throws:
      IllegalStateException - if the current OS/architecture combination is not supported by this plugin