Documentation ¶
Overview ¶
Copyright 2019 The Chromium OS Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Copyright 2019 The Chromium OS Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Index ¶
- Variables
- func GetRepoToRemoteBranchToSourceRootFromManifestFile(file string) (map[string]map[string]string, error)
- func GetRepoToRemoteBranchToSourceRootFromManifests(authedClient *http.Client, ctx context.Context, gc *bbproto.GitilesCommit) (map[string]map[string]string, error)
- func GetRepoToSourceRoot(chromiumosCheckout, repoToolPath string) (map[string]string, error)
- func LoadManifestFromFileRaw(file string) ([]byte, error)
- func LoadManifestTree(file string) (map[string]*Manifest, error)
- type Annotation
- type BranchMode
- type CopyFile
- type Default
- type Include
- type Manifest
- func (m *Manifest) GetMultiCheckoutProjects() []*Project
- func (m *Manifest) GetPinnedProjects() []*Project
- func (m *Manifest) GetProjectByName(name string) (*Project, error)
- func (m *Manifest) GetProjectByPath(path string) (*Project, error)
- func (m *Manifest) GetRemoteByName(name string) *Remote
- func (m *Manifest) GetSingleCheckoutProjects() []*Project
- func (m *Manifest) GetTotProjects() []*Project
- func (m *Manifest) GetUniqueProject(name string) (Project, error)
- func (m *Manifest) ProjectBranchMode(project Project) BranchMode
- func (m *Manifest) ResolveImplicitLinks() *Manifest
- func (m *Manifest) Write(path string) error
- type Project
- type Remote
- type RepoHooks
Constants ¶
This section is empty.
Variables ¶
var ( GOB_HOST = "%s.googlesource.com" EXTERNAL_GOB_INSTANCE = "chromium" EXTERNAL_GOB_HOST = fmt.Sprintf(GOB_HOST, EXTERNAL_GOB_INSTANCE) EXTERNAL_GOB_URL = fmt.Sprintf("https://%s", EXTERNAL_GOB_HOST) INTERNAL_GOB_INSTANCE = "chrome-internal" INTERNAL_GOB_HOST = fmt.Sprintf(GOB_HOST, INTERNAL_GOB_INSTANCE) INTERNAL_GOB_URL = fmt.Sprintf("https://%s", INTERNAL_GOB_HOST) AOSP_GOB_INSTANCE = "android" AOSP_GOB_HOST = fmt.Sprintf(GOB_HOST, AOSP_GOB_INSTANCE) AOSP_GOB_URL = fmt.Sprintf("https://%s", AOSP_GOB_HOST) WEAVE_GOB_INSTANCE = "weave" WEAVE_GOB_HOST = fmt.Sprintf(GOB_HOST, WEAVE_GOB_INSTANCE) WEAVE_GOB_URL = fmt.Sprintf("https://%s", WEAVE_GOB_HOST) CROS_REMOTES = map[string]string{ "aosp": AOSP_GOB_URL, "weave": WEAVE_GOB_URL, // contains filtered or unexported fields } // Mapping 'remote name' -> regexp that matches names of repositories on // that remote that can be branched when creating CrOS branch. // Branching script will actually create a new git ref when branching // these projects. It won't attempt to create a git ref for other projects // that may be mentioned in a manifest. If a remote is missing from this // dictionary, all projects on that remote are considered to not be // branchable. BRANCHABLE_PROJECTS = map[string]*regexp.Regexp{ // contains filtered or unexported fields } MANIFEST_ATTR_BRANCHING_CREATE = "create" MANIFEST_ATTR_BRANCHING_PIN = "pin" MANIFEST_ATTR_BRANCHING_TOT = "tot" )
Functions ¶
func GetRepoToRemoteBranchToSourceRootFromManifests ¶
func GetRepoToRemoteBranchToSourceRootFromManifests(authedClient *http.Client, ctx context.Context, gc *bbproto.GitilesCommit) (map[string]map[string]string, error)
GetRepoToSourceRootFromManifests constructs a Gerrit project to path mapping by fetching manifest XML files from Gitiles.
func GetRepoToSourceRoot ¶
GetRepoToSourceRoot gets the mapping of Gerrit project to Chromium OS source tree path.
func LoadManifestFromFileRaw ¶
LoadManifestFromFileRaw loads the manifest at the given file and returns the file contents as a byte array.
Types ¶
type Annotation ¶
type Annotation struct { Name string `xml:"name,attr,omitempty"` Value string `xml:"value,attr,omitempty"` }
Annotation is an element of a manifest annotating the parent element.
type BranchMode ¶
type BranchMode string
const ( UnspecifiedMode BranchMode = "unspecified" Pinned BranchMode = "pinned" Tot BranchMode = "tot" Create BranchMode = "create" )
type Default ¶
type Default struct { RemoteName string `xml:"remote,attr,omitempty"` Revision string `xml:"revision,attr,omitempty"` SyncJ string `xml:"sync-j,attr,omitempty"` }
Default is a manifest element that lists the default.
type Include ¶
type Include struct {
Name string `xml:"name,attr,omitempty"`
}
Include is a manifest element that imports another manifest file.
type Manifest ¶
type Manifest struct { XMLName xml.Name `xml:"manifest"` Includes []Include `xml:"include"` Remotes []Remote `xml:"remote"` Default Default `xml:"default"` Notice string `xml:"notice,omitempty"` RepoHooks []RepoHooks `xml:"repo-hooks"` Projects []Project `xml:"project"` }
Manifest is a top-level Repo definition file.
func LoadManifestFromFile ¶
LoadManifestFromFile loads the manifest at the given file into a Manifest struct.
func LoadManifestFromFileWithIncludes ¶
LoadManifestFromFileWithIncludes loads the manifest at the given files but also calls MergeManifests to resolve includes.
func MergeManifests ¶
MergeManifests will merge the given manifests based on includes, taking manifests[path] to be the top-level manifest. manifests maps manifest filenames to the Manifest structs themselves. This basically re-implements `repo manifest` but is necessary because we can't run `repo manifest` on a singular git repository.
func (*Manifest) GetMultiCheckoutProjects ¶
GetMultiCheckoutProjects returns all projects in the manifest that have a multiple checkouts and are not pinned/tot.
func (*Manifest) GetPinnedProjects ¶
GetPinnedProjects returns all projects in the manifest that are pinned.
func (*Manifest) GetProjectByName ¶
GetProjectByName returns a pointer to the remote with the given path in the given manifest.
func (*Manifest) GetProjectByPath ¶
GetProjectByPath returns a pointer to the remote with the given path in the given manifest.
func (*Manifest) GetRemoteByName ¶
GetRemoteByName returns a pointer to the remote with the given name/alias in the given manifest.
func (*Manifest) GetSingleCheckoutProjects ¶
GetSingleCheckoutProjects returns all projects in the manifest that have a single checkout and are not pinned/tot.
func (*Manifest) GetTotProjects ¶
GetTotProjects returns all projects in the manifest that are tot.
func (*Manifest) GetUniqueProject ¶
GetUnique Project returns the unique project with the given name (nil if the project DNE). It returns an error if multiple projects with the given name exist.
func (*Manifest) ProjectBranchMode ¶
func (m *Manifest) ProjectBranchMode(project Project) BranchMode
ProjectBranchMode returns the branch mode (create, pinned, tot) of a project.
func (*Manifest) ResolveImplicitLinks ¶
ResolveImplicitLinks explicitly sets remote/revision information for each project in the manifest.
type Project ¶
type Project struct { Path string `xml:"path,attr,omitempty"` Name string `xml:"name,attr,omitempty"` Revision string `xml:"revision,attr,omitempty"` Upstream string `xml:"upstream,attr,omitempty"` RemoteName string `xml:"remote,attr,omitempty"` Annotations []Annotation `xml:"annotation"` Groups string `xml:"groups,attr,omitempty"` SyncC string `xml:"sync-c,attr,omitempty"` CopyFiles []CopyFile `xml:"copyfile"` }
Project is an element of a manifest containing a Gerrit project to source path definition.