Documentation ¶
Overview ¶
Package jiri provides utilities used by the jiri tool and related tools.
Index ¶
- Constants
- Variables
- func FindRoot(flags TopLevelFlags, timer *timing.Timer) (string, error)
- func GitGetConfig(key string) (string, error)
- func Update(force bool) error
- func UpdateAndExecute(force bool) error
- type Config
- type TopLevelFlags
- type X
- func (jirix *X) AddCleanupFunc(cleanup func())
- func (x *X) BinDir() string
- func (x *X) CIPDPath() string
- func (x *X) Clone(opts tool.ContextOpts) *X
- func (jirix *X) Failures() uint32
- func (jirix *X) IncrementFailures()
- func (x *X) JiriManifestFile() string
- func (x *X) RootMetaDir() string
- func (jirix *X) RunCleanup()
- func (x *X) ScriptsDir() string
- func (x *X) SwapDir() string
- func (x *X) UpdateHistoryDir() string
- func (x *X) UpdateHistoryLatestLink() string
- func (x *X) UpdateHistoryLogDir() string
- func (x *X) UpdateHistoryLogLatestLink() string
- func (x *X) UpdateHistoryLogSecondLatestLink() string
- func (x *X) UpdateHistorySecondLatestLink() string
- func (x *X) UsageErrorf(format string, args ...any) error
- func (jirix *X) UsePartialClone(remote string) bool
Constants ¶
const ( JiriRepository = "https://fuchsia.googlesource.com/jiri" JiriCIPDEndPoint = "https://chrome-infra-packages.appspot.com/dl/fuchsia/tools/jiri" )
const ( AttrsJSON = "attributes.json" RootMetaDir = ".jiri_root" ProjectMetaDir = "jiri" ConfigFile = "config" DefaultCacheSubdir = "cache" ProjectMetaFile = "metadata.v2" ProjectConfigFile = "config" JiriManifestFile = ".jiri_manifest" // PreservePathEnv is the name of the environment variable that, when set to a // non-empty value, causes jiri tools to use the existing PATH variable, // rather than mutating it. PreservePathEnv = "JIRI_PRESERVE_PATH" )
Variables ¶
var DefaultJobs = uint(runtime.NumCPU() * 2)
Functions ¶
func GitGetConfig ¶
func Update ¶
Update checks whether a new version of Jiri is available and if so, it will download it and replace the current version with the new one.
func UpdateAndExecute ¶
Types ¶
type Config ¶
type Config struct { CachePath string `xml:"cache>path,omitempty"` CipdParanoidMode string `xml:"cipd_paranoid_mode,omitempty"` CipdMaxThreads int `xml:"cipd_max_threads,omitempty"` Dissociate bool `xml:"cache>dissociate,omitempty"` RewriteSsoToHttps bool `xml:"rewriteSsoToHttps,omitempty"` SsoCookiePath string `xml:"SsoCookiePath,omitempty"` LockfileEnabled string `xml:"lockfile>enabled,omitempty"` LockfileName string `xml:"lockfile>name,omitempty"` PrebuiltJSON string `xml:"prebuilt>JSON,omitempty"` FetchingAttrs string `xml:"fetchingAttrs,omitempty"` AnalyticsOptIn string `xml:"analytics>optin,omitempty"` AnalyticsUserId string `xml:"analytics>userId,omitempty"` Partial bool `xml:"partial,omitempty"` PartialSkip []string `xml:"partialSkip,omitempty"` OffloadPackfiles bool `xml:"offloadPackfiles,omitempty"` // version user has opted-in to AnalyticsVersion string `xml:"analytics>version,omitempty"` KeepGitHooks bool `xml:"keepGitHooks,omitempty"` EnableSubmodules string `xml:"enableSubmodules,omitempty"` ForceDisableSubmodulesInfraOnly string `xml:"forceDisableSubmodulesInfraOnly,omitempty"` ExcludeDirs []string `xml:"excludeDirs,omitempty"` XMLName struct{} `xml:"config"` }
Config represents jiri global config
func ConfigFromFile ¶
type TopLevelFlags ¶
type TopLevelFlags struct { Root string Jobs uint Color string QuietVerbose bool DebugVerbose bool TraceVerbose bool ShowProgress bool ProgressWindowSize uint TimeLogThreshold time.Duration DumpTiming bool TimeFile string }
func (*TopLevelFlags) SetFlags ¶
func (t *TopLevelFlags) SetFlags(f *flag.FlagSet)
type X ¶
type X struct { *tool.Context Root string Cwd string Usage func(format string, args ...any) error Cache string CipdParanoidMode bool CipdMaxThreads int Dissociate bool Jobs uint KeepGitHooks bool RewriteSsoToHttps bool LockfileEnabled bool LockfileName string OffloadPackfiles bool SsoCookiePath string Partial bool PartialSkip []string PrebuiltJSON string FetchingAttrs string UsingSnapshot bool UsingImportOverride bool OverrideOptional bool IgnoreLockConflicts bool Color color.Color Logger *log.Logger Attempts uint AnalyticsSession *analytics_util.AnalyticsSession OverrideWarned bool EnableSubmodules bool ForceDisableSubmodulesInfraOnly bool ExcludeDirs []string // contains filtered or unexported fields }
X holds the execution environment for the jiri tool and related tools. This includes the jiri filesystem root directory.
TODO(toddw): Other jiri state should be transitioned to this struct, including the manifest and related operations.
func NewX ¶
func NewX(env *cmdline.Env, flags TopLevelFlags) (*X, error)
NewX returns a new execution environment, given a cmdline env. It also prepends .jiri_root/bin to the PATH.
func NewXFromContext ¶
func NewXFromContext(ctx context.Context, topLevelFlags TopLevelFlags) (*X, error)
func (*X) Clone ¶
func (x *X) Clone(opts tool.ContextOpts) *X
Clone returns a clone of the environment.
func (*X) IncrementFailures ¶
func (jirix *X) IncrementFailures()
func (*X) JiriManifestFile ¶
JiriManifestFile returns the path to the .jiri_manifest file.
func (*X) RootMetaDir ¶
RootMetaDir returns the path to the root metadata directory.
func (*X) ScriptsDir ¶
ScriptsDir returns the path to the scripts directory.
func (*X) SwapDir ¶
SwapDir returns the path to the swap directory. This is used to stage moves of direcories that may be moving into subdirectories of themselves or to handle unnesting of repositories.
We use a directory in `.jiri_root` to prevent the complexities of an arbitrary $TMPDIR which can cross mountpoints/filesystems.
func (*X) UpdateHistoryDir ¶
UpdateHistoryDir returns the path to the update history directory.
func (*X) UpdateHistoryLatestLink ¶
UpdateHistoryLatestLink returns the path to a hard link that points to the latest update in the update history directory.
func (*X) UpdateHistoryLogDir ¶
UpdateHistoryLogDir returns the path to the update history directory.
func (*X) UpdateHistoryLogLatestLink ¶
UpdateHistoryLogLatestLink returns the path to a symlink that points to the latest update in the update history directory.
func (*X) UpdateHistoryLogSecondLatestLink ¶
UpdateHistoryLogSecondLatestLink returns the path to a symlink that points to the second latest update in the update history directory.
func (*X) UpdateHistorySecondLatestLink ¶
UpdateHistorySecondLatestLink returns the path to a hard link that points to the second latest update in the update history directory.
func (*X) UsageErrorf ¶
UsageErrorf prints the error message represented by the printf-style format and args, followed by the usage output. The implementation typically calls cmdline.Env.UsageErrorf.
func (*X) UsePartialClone ¶
Directories ¶
Path | Synopsis |
---|---|
Package analytics_util provides functions to send google analytics
|
Package analytics_util provides functions to send google analytics |
cmd
|
|
jiri
Command jiri is a multi-purpose tool for multi-repo development.
|
Command jiri is a multi-purpose tool for multi-repo development. |
Package envvar implements utilities for processing environment variables.
|
Package envvar implements utilities for processing environment variables. |
Package gerrit provides library functions for interacting with the gerrit code review system.
|
Package gerrit provides library functions for interacting with the gerrit code review system. |
Package gitutil provides Go wrappers for various Git commands.
|
Package gitutil provides Go wrappers for various Git commands. |
xtest
Package xtest provides utilities for testing jiri functionality.
|
Package xtest provides utilities for testing jiri functionality. |
Package metadata implements a mechanism for setting and retrieving metadata stored in program binaries.
|
Package metadata implements a mechanism for setting and retrieving metadata stored in program binaries. |
Package retry provides a facility for retrying function invocations.
|
Package retry provides a facility for retrying function invocations. |
Package simplemr provides a simple map reduce framework for use by commandline and other tools and consequently can only be used from within a single process.
|
Package simplemr provides a simple map reduce framework for use by commandline and other tools and consequently can only be used from within a single process. |
Package textutil implements utilities for handling human-readable text.
|
Package textutil implements utilities for handling human-readable text. |
Package timing implements utilities for tracking timing information.
|
Package timing implements utilities for tracking timing information. |
Package tool contains abstractions for working with developer tools.
|
Package tool contains abstractions for working with developer tools. |