leiningen

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProjectFileDependencies

func ProjectFileDependencies(dir, file string) (graph.Deps, *errors.Error)

ProjectFileDependencies returns the dependencies listed in a clojure project file.

func ValidBinary

func ValidBinary(dir string) (string, error)

ValidBinary attempts to execute a list of `lein` commands and returns the most preferred.

Types

type Dependency

type Dependency struct {
	GroupID    string `xml:"groupId"`
	ArtifactID string `xml:"artifactId"`
	Version    string `xml:"version"`
}

Dependency models a leiningen dependency.

func ReadDependencyTree

func ReadDependencyTree(lines []string, parser LineParser) ([]Dependency, map[Dependency][]Dependency, error)

type LineParser

type LineParser func(line string) (level int, node Dependency, err error)

level is 1-indexed

type Output

type Output interface {
	DependencyGraph(string) (graph.Deps, *errors.Error)
}

Output is intended to supply a dependency graph from lein output.

func ShellOutput

func ShellOutput(binary, dir string) Output

ShellOutput creates a Shell which shells out to the supplied binary to generate values to return.

type Shell

type Shell struct {
	Cmd func(...string) (string, *errors.Error)
}

Shell implements Output and uses Cmd to generate the DependencyGraph.

func (Shell) DependencyGraph

func (s Shell) DependencyGraph(target string) (graph.Deps, *errors.Error)

DependencyGraph uses a Shell's Cmd to generate leiningen formatted output which is converted to a dependency graph.

Jump to

Keyboard shortcuts

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