nuget

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 13 Imported by: 0

README

Nuget resolution logic

There are two supported files for resolution of nuget lock files:

packages.config

We need to convert a packages.config file to a .csproj file. This is to enable the use of the dotnet restore command that enables Debricked to parse out transitive dependencies. This may add some additional framework dependencies that will not show up if we only scan the packages.config file. This is done in a few steps:

  1. Parse packages.config file
  2. Run dotnet --version to get dotnet version
  3. Collect unique target frameworks and packages from the file
  4. Create .nuget.debricked.csproj.temp file with the collected data

With this done we can move on to the next section

.csproj
  1. Run dotnet restore <file> --use-lock-file --lock-file-path <lock_file> in order to restore the dependencies and tools of a project (lock file name can be different depend on which manifest file is being resolved)
  2. Cleanup temporary csproj file after lock file is created (for packages.config case)

Documentation

Index

Constants

View Source
const CsprojRegex = `\.csproj$`
View Source
const Name = "nuget"
View Source
const PackagesConfigRegex = `packages\.config$`

Variables

This section is empty.

Functions

This section is empty.

Types

type CmdFactory

type CmdFactory struct {
	// contains filtered or unexported fields
}

func NewCmdFactory added in v1.2.1

func NewCmdFactory(execPath IExecPath) *CmdFactory

func (*CmdFactory) GetTempoCsproj added in v1.2.1

func (cmdf *CmdFactory) GetTempoCsproj() string

func (*CmdFactory) MakeInstallCmd

func (cmdf *CmdFactory) MakeInstallCmd(command string, file string) (*exec.Cmd, error)

type ExecPath

type ExecPath struct {
}

func (ExecPath) LookPath

func (ExecPath) LookPath(file string) (string, error)

type ICmdFactory

type ICmdFactory interface {
	MakeInstallCmd(command string, file string) (*exec.Cmd, error)
	GetTempoCsproj() string
}

type IExecPath

type IExecPath interface {
	LookPath(file string) (string, error)
}

type Job

type Job struct {
	job.BaseJob
	// contains filtered or unexported fields
}

func NewJob

func NewJob(
	file string,
	install bool,
	cmdFactory ICmdFactory,
) *Job

func (*Job) Install

func (j *Job) Install() bool

func (*Job) Run

func (j *Job) Run()

type Package added in v1.2.1

type Package struct {
	ID              string `xml:"id,attr"`
	Version         string `xml:"version,attr"`
	TargetFramework string `xml:"targetFramework,attr"`
}

type Packages added in v1.2.1

type Packages struct {
	Packages []Package `xml:"package"`
}

type Pm

type Pm struct {
	// contains filtered or unexported fields
}

func NewPm

func NewPm() Pm

func (Pm) Manifests

func (Pm) Manifests() []string

func (Pm) Name

func (pm Pm) Name() string

type Strategy

type Strategy struct {
	// contains filtered or unexported fields
}

func NewStrategy

func NewStrategy(files []string) Strategy

func (Strategy) Invoke

func (s Strategy) Invoke() ([]job.IJob, error)

Jump to

Keyboard shortcuts

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