Enum Class BunSystem
- All Implemented Interfaces:
Serializable,Comparable<BunSystem>,Constable
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 thebun { system = ... } configuration.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionmacOS (Darwin) ARM64 / Apple Silicon build.macOS (Darwin) x64 / Intel build.Linux ARM64 build targeting glibc.Linux ARM64 build targeting musl.Linux x64 build targeting glibc.Linux x64 baseline build targeting glibc.Linux x64 build targeting musl (e.g.Linux x64 baseline build targeting musl.Windows x64 build using the standard runtime.Windows x64 baseline build (more compatible, potentially slower). -
Method Summary
Modifier and TypeMethodDescriptionstatic BunSystemdetect()Detects the current operating system and CPU architecture and selects the most appropriateBunSystem.exeName()Returns the expected name of the Bun executable for this system.static BunSystemReturns the enum constant of this class with the specified name.static BunSystem[]values()Returns an array containing the constants of this enum class, in the order they are declared.zipName()Returns the name of the Bun zip asset associated with this system.
-
Enum Constant Details
-
WINDOWS_X64
Windows x64 build using the standard runtime. -
WINDOWS_X64_BASELINE
Windows x64 baseline build (more compatible, potentially slower). -
DARWIN_AARCH64
macOS (Darwin) ARM64 / Apple Silicon build. -
DARWIN_X64
macOS (Darwin) x64 / Intel build. -
LINUX_X64
Linux x64 build targeting glibc. -
LINUX_X64_BASELINE
Linux x64 baseline build targeting glibc. -
LINUX_AARCH64
Linux ARM64 build targeting glibc. -
LINUX_X64_MUSL
Linux x64 build targeting musl (e.g. Alpine Linux). -
LINUX_X64_MUSL_BASELINE
Linux x64 baseline build targeting musl. -
LINUX_AARCH64_MUSL
Linux ARM64 build targeting musl.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
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
Returns the expected name of the Bun executable for this system.- Returns:
- the executable file name (e.g.
bunorbun.exe)
-
detect
Detects the current operating system and CPU architecture and selects the most appropriateBunSystem.Detection is based on the standard JVM system properties:
os.nameos.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
-