project

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps interface {
	Load(importPath types.ImportPath) (*oyafile.Oyafile, bool, error)
	Find(importPath types.ImportPath) (pack.Pack, bool, error)
	ForEach(f func(pack.Pack) error) error
	Explode() error
}

type ErrInstallingPacks added in v0.0.9

type ErrInstallingPacks struct {
	Cause          error
	ProjectRootDir string
}

func (ErrInstallingPacks) Error added in v0.0.9

func (e ErrInstallingPacks) Error() string

type ErrNoOyafile

type ErrNoOyafile struct {
	Path string
}

func (ErrNoOyafile) Error

func (e ErrNoOyafile) Error() string

type ErrNoOyafiles

type ErrNoOyafiles struct {
	Path string
}

func (ErrNoOyafiles) Error

func (e ErrNoOyafiles) Error() string

type ErrNoProject

type ErrNoProject struct {
	Path string
}

func (ErrNoProject) Error

func (e ErrNoProject) Error() string

type ErrNoTask

type ErrNoTask struct {
	Task task.Name
}

func (ErrNoTask) Error

func (e ErrNoTask) Error() string

type Project

type Project struct {
	RootDir string
	// contains filtered or unexported fields
}

TODO: Duplicated in oyafile module.

func Detect

func Detect(workDir, installDir string) (*Project, error)

func (*Project) Changeset

func (p *Project) Changeset(workDir string) ([]*oyafile.Oyafile, error)

Changeset returns the list of Oyafiles for the changed directories, based on the Changeset: directives.

The algorithm:

- Add default Changeset task to root Oyafile if there isn’t one - For each project Oyafile:

  • If Changeset task defined:
  • Contribute to changeset

- Deduplicate changeset - Exclude changes outside work directory

func (*Project) Deps

func (p *Project) Deps() (Deps, error)

func (*Project) FindRequiredPack

func (p *Project) FindRequiredPack(importPath types.ImportPath) (pack.Pack, bool, error)

func (*Project) Install

func (p *Project) Install(pack pack.Pack) error

func (*Project) InstallPacks

func (p *Project) InstallPacks() error

InstallPacks installs packs used by the project. It works in two steps: 1. It goes through all Import: directives and updates the Require: section with missing packs in their latest versions. 2. It installs all packs that haven't been installed.

func (*Project) IsInstalled

func (p *Project) IsInstalled(pack pack.Pack) (bool, error)

func (*Project) List

func (p *Project) List(startDir string) ([]*oyafile.Oyafile, error)

func (*Project) ListTargets added in v0.0.9

func (p *Project) ListTargets(workDir string, recurse, useChangeset bool) ([]*oyafile.Oyafile, error)

func (*Project) Oyafile

func (p *Project) Oyafile(oyafilePath string) (*oyafile.Oyafile, bool, error)

func (*Project) Oyafiles

func (p *Project) Oyafiles() ([]*oyafile.Oyafile, error)

func (*Project) Require

func (p *Project) Require(pack pack.Pack) error

func (*Project) Run

func (p *Project) Run(workDir string, taskName task.Name, recurse, useChangeset bool,
	args []string, scope template.Scope, stdout, stderr io.Writer) error

Notes

Bugs

  • Uncached (but used only by Render).

  • Clean up this magic string & logic duplication everywhere.

  • We should probably make it more intuitive by supporting Ignore: directives in nested dirs as well as the root dir.

  • I don't particularly like it how tihs logic is split. Plus we may be masking some other errors this way

Jump to

Keyboard shortcuts

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