xcelerate

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultXcodePath = "/usr/bin/xcodebuild"
	DefaultXcrunPath = "/usr/bin/xcrun"

	ErrFmtCreateConfigFile = `failed to create xcelerate config file: %w`
	ErrFmtEncodeConfigFile = `failed to encode xcelerate config file: %w`
	ErrFmtCreateFolder     = `failed to create .xcelerate folder (%s): %w`
	ErrNoAuthConfig        = "read auth config: %w"
)
View Source
const (
	BinDir              = "bin"
	ErrFmtDetermineHome = `could not determine home: %w`
)

Variables

This section is empty.

Functions

func ApplyBenchmarkPhase added in v1.5.0

func ApplyBenchmarkPhase(
	params *Params,
	logger log.Logger,
	benchmarkProvider common.BenchmarkPhaseProvider,
	metadata common.CacheConfigMetadata,
	exporter EnvExporter,
)

ApplyBenchmarkPhase queries the benchmark phase and overrides xcode params accordingly. Baseline phase disables cache. Warmup phase logs a warning. The phase is exported as BITRISE_BUILD_CACHE_BENCHMARK_PHASE env var and written to ~/.local/state/xcelerate/benchmark/benchmark-phase.json as fallback.

func DirPath

func DirPath(osProxy utils.OsProxy) string

func PathFor

func PathFor(osProxy utils.OsProxy, subpath string) string

Types

type Config

type Config struct {
	ProxyVersion           string                 `json:"proxyVersion"`
	ProxySocketPath        string                 `json:"proxySocketPath"`
	CLIVersion             string                 `json:"cliVersion"`
	WrapperVersion         string                 `json:"wrapperVersion"`
	OriginalXcodebuildPath string                 `json:"originalXcodebuildPath"`
	OriginalXcrunPath      string                 `json:"originalXcrunPath"`
	BuildCacheEnabled      bool                   `json:"buildCacheEnabled"`
	BuildCacheSkipFlags    bool                   `json:"buildCacheSkipFlags"`
	BuildCacheEndpoint     string                 `json:"buildCacheEndpoint"`
	PushEnabled            bool                   `json:"pushEnabled"`
	DebugLogging           bool                   `json:"debugLogging,omitempty"`
	Silent                 bool                   `json:"silent,omitempty"`
	XcodebuildTimestamps   bool                   `json:"xcodebuildTimestamps,omitempty"`
	AuthConfig             common.CacheAuthConfig `json:"authConfig,omitempty"`
	ExternalAppID          string                 `json:"externalAppId,omitempty"`
	ExternalBuildID        string                 `json:"externalBuildId,omitempty"`
	ExternalWorkflowName   string                 `json:"externalWorkflowName,omitempty"`
}

Config is the xcelerate config saved to ~/.bitrise-xcelerate/config.json. Note: the benchmark phase is NOT stored here — matching gradle, it is exported as the BITRISE_BUILD_CACHE_BENCHMARK_PHASE env var and written to ~/.local/state/xcelerate/benchmark/benchmark-phase.json during activation.

func DefaultConfig

func DefaultConfig() Config

func NewConfig

func NewConfig(ctx context.Context,
	logger log.Logger,
	params Params,
	envs map[string]string,
	osProxy utils.OsProxy,
	cmdFunc utils.CommandFunc,
	exporter EnvExporter,
	benchmarkProvider common.BenchmarkPhaseProvider,
) (Config, error)

func ReadConfig

func ReadConfig(osProxy utils.OsProxy, decoderFactory utils.DecoderFactory) (Config, error)

func (Config) Save

func (config Config) Save(logger log.Logger, os utils.OsProxy, encoderFactory utils.EncoderFactory) error

type EnvExporter added in v1.5.0

type EnvExporter interface {
	Export(key, value string)
	ExportToShellRC(blockName, content string)
}

EnvExporter abstracts environment variable export for testability.

type Params

type Params struct {
	BuildCacheEnabled           bool
	BuildCacheEndpoint          string
	BuildCacheSkipFlags         bool
	DebugLogging                bool
	Silent                      bool
	XcodePathOverride           string
	XcrunPathOverride           string
	ProxySocketPathOverride     string
	PushEnabled                 bool
	XcodebuildTimestampsEnabled bool
}

func DefaultParams

func DefaultParams() Params

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL