manifest

package
v0.0.0-...-59c1163 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package manifest manipulates Manifest files as described at https://gerrit.googlesource.com/git-repo/+/master/docs/manifest-format.txt.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Copyfile

type Copyfile struct {
	Src  string `xml:"src,attr"`
	Dest string `xml:"dest,attr"`
}

Copyfile indicates that a file should be copied in a checkout

type Default

type Default struct {
	Revision   string `xml:"revision,attr"`
	Remote     string `xml:"remote,attr"`
	DestBranch string `xml:"dest-branch,attr"`
	SyncJ      string `xml:"sync-j,attr"`
	SyncC      string `xml:"sync-c,attr"`
	SyncS      string `xml:"sync-s,attr"`
}

Default holds default Project settings.

type Linkfile

type Linkfile struct {
	Src  string `xml:"src,attr"`
	Dest string `xml:"dest,attr"`
}

Linkfile indicates that a file should be symlinked in a checkout

type Manifest

type Manifest struct {
	Default Default   `xml:"default"`
	Remote  []Remote  `xml:"remote"`
	Project []Project `xml:"project"`
}

Manifest holds the entire manifest, describing a set of git projects to be stitched together

func Parse

func Parse(contents []byte) (*Manifest, error)

Parse parses the given XML data.

func ParseFile

func ParseFile(name string) (*Manifest, error)

ParseFile reads and parses an XML file

func (*Manifest) Filter

func (mf *Manifest) Filter()

Filter removes all notdefault projects from a manifest.

func (*Manifest) MarshalXML

func (m *Manifest) MarshalXML() ([]byte, error)

MarshalXML serializes the receiver to XML.

func (*Manifest) ProjectRevision

func (mf *Manifest) ProjectRevision(p *Project) string

type Project

type Project struct {
	Path         *string         `xml:"path,attr"`
	Name         string          `xml:"name,attr"`
	Remote       string          `xml:"remote,attr,omitempty"`
	Copyfile     []Copyfile      `xml:"copyfile,omitempty"`
	Linkfile     []Linkfile      `xml:"linkfile,omitempty"`
	GroupsString string          `xml:"groups,attr,omitempty"`
	Groups       map[string]bool `xml:"-"`

	Revision   string `xml:"revision,attr,omitempty"`
	DestBranch string `xml:"dest-branch,attr,omitempty"`
	SyncJ      string `xml:"sync-j,attr,omitempty"`
	SyncC      string `xml:"sync-c,attr,omitempty"`
	SyncS      string `xml:"sync-s,attr,omitempty"`

	Upstream   string `xml:"upstream,attr,omitempty"`
	CloneDepth string `xml:"clone-depth,attr,omitempty"`
	ForcePath  string `xml:"force-path,attr,omitempty"`

	// This is not part of the Manifest spec.
	CloneURL string `xml:"clone-url,attr,omitempty"`
}

Project represents a single git repository that should be stitched into the checkout.

func (*Project) GetPath

func (p *Project) GetPath() string

GetPath provides the path where to place the repository.

type Remote

type Remote struct {
	Alias    string `xml:"alias,attr"`
	Name     string `xml:"name,attr"`
	Fetch    string `xml:"fetch,attr"`
	Review   string `xml:"review,attr"`
	Revision string `xml:"revision,attr"`
}

Remote describes a host where a set of projects is hosted.

Jump to

Keyboard shortcuts

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