Documentation ¶
Overview ¶
Package jiri provides utilities used by the jiri tool and related tools.
Index ¶
- Constants
- Variables
- func FindRoot() string
- func RunnerFunc(run func(*X, []string) error) cmdline.Runner
- func Update(force bool) error
- func UpdateAndExecute(force bool) error
- type Config
- 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) 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 ...interface{}) error
Constants ¶
const ( JiriRepository = "https://github.com/btwiuse/jiri" JiriCIPDEndPoint = "https://chrome-infra-packages.appspot.com/dl/fuchsia/tools/jiri" )
const ( RootMetaDir = ".jiri_root" ProjectMetaDir = ".git/jiri" OldProjectMetaDir = ".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 FindRoot ¶
func FindRoot() string
FindRoot returns the root directory of the jiri environment. All state managed by jiri resides under this root.
If the rootFlag variable is non-empty, we always attempt to use it. It must point to an absolute path, after symlinks are evaluated.
Returns an empty string if the root directory cannot be determined, or if any errors are encountered.
FindRoot should be rarely used; typically you should use NewX to create a new execution environment, and handle errors. An example of a valid usage is to initialize default flag values in an init func before main.
func RunnerFunc ¶
RunnerFunc is an adapter that turns regular functions into cmdline.Runner. This is similar to cmdline.RunnerFunc, but the first function argument is jiri.X, rather than cmdline.Env.
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"` 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"` // version user has opted-in to AnalyticsVersion string `xml:"analytics>version,omitempty"` KeepGitHooks bool `xml:"keepGitHooks,omitempty"` XMLName struct{} `xml:"config"` }
Config represents jiri global config
func ConfigFromFile ¶
type X ¶
type X struct { *tool.Context Root string Usage func(format string, args ...interface{}) error Cache string CipdParanoidMode bool CipdMaxThreads int Jobs uint KeepGitHooks bool RewriteSsoToHttps bool LockfileEnabled bool LockfileName string SsoCookiePath string Partial bool 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 // 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 ¶
NewX returns a new execution environment, given a cmdline env. It also prepends .jiri_root/bin to the PATH.
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) UpdateHistoryDir ¶
UpdateHistoryDir returns the path to the update history directory.
func (*X) UpdateHistoryLatestLink ¶
UpdateHistoryLatestLink returns the path to a symlink 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 symlink 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.
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 cmdline implements a data-driven mechanism for writing command-line programs with built-in support for help.
|
Package cmdline implements a data-driven mechanism for writing command-line programs with built-in support for help. |
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 lookpath implements utilities to find executables.
|
Package lookpath implements utilities to find executables. |
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. |