Documentation ¶
Index ¶
- Constants
- func FindModRootFrom(startPath string) (string, *reporter.KpmEvent)
- func GetKclVersion() string
- type Compiler
- type Entry
- func (e *Entry) AddEntryFile(entrySource string)
- func (e *Entry) EntryFiles() []string
- func (e *Entry) IsEmpty() bool
- func (e *Entry) IsGit() bool
- func (e *Entry) IsLocalFile() bool
- func (e *Entry) IsLocalFileWithKclMod() bool
- func (e *Entry) IsRef() bool
- func (e *Entry) IsTar() bool
- func (e *Entry) IsUrl() bool
- func (e *Entry) Kind() EntryKind
- func (e *Entry) PackageSource() string
- func (e *Entry) SetKind(kind EntryKind)
- func (e *Entry) SetPackageSource(packageSource string)
- type EntryKind
Constants ¶
const EXTERNAL_PKGS_ARG_PATTERN = "%s=%s"
The pattern of the external package argument.
Variables ¶
This section is empty.
Functions ¶
func FindModRootFrom ¶ added in v0.3.6
FindModRootFrom will find the kcl.mod path from the start path.
func GetKclVersion ¶ added in v0.8.0
func GetKclVersion() string
GetKclVersion fetches the kcl version
Types ¶
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
Compiler is a wrapper of kcl compiler.
func DefaultCompiler ¶
func DefaultCompiler() *Compiler
DefaultCompiler will create a default compiler.
func NewCompilerWithOpts ¶ added in v0.3.4
func NewCompilerWithOpts(opts *opt.CompileOptions) *Compiler
func (*Compiler) AddDepPath ¶
AddDep will add a file path to the dependency list.
func (*Compiler) AddKclOption ¶
AddKclOption will add a kcl option to the compiler.
type Entry ¶ added in v0.3.6
type Entry struct {
// contains filtered or unexported fields
}
Entry is the entry of 'kpm run'.
func FindRunEntryFrom ¶ added in v0.3.6
FindRunEntryFrom will find the entry of the compilation from the entry sources.
func (*Entry) AddEntryFile ¶ added in v0.3.6
AddEntryFile will add a entry file to the entry.
func (*Entry) EntryFiles ¶ added in v0.3.6
EntryFiles will return the entry files of the entry.
func (*Entry) IsLocalFile ¶ added in v0.3.6
IsLocalFile will return true if the entry is a local file.
func (*Entry) IsLocalFileWithKclMod ¶ added in v0.3.6
IsLocalFileWithKclMod will return true if the entry is a local file with 'kcl.mod'.
func (*Entry) PackageSource ¶ added in v0.3.6
PackageSource will return the package source of the entry.
func (*Entry) SetPackageSource ¶ added in v0.3.6
SetPackageSource will set the package source of the entry.
type EntryKind ¶ added in v0.3.6
type EntryKind string
EntryKind is the kind of the entry. Including: 1. WithKclMod: local file which can find 'kcl.mod' in the parent dir of the file. 2. WithoutKclMod: local file which can find 'kcl.mod' in the parent dir of the file. 3. TarEntry: kcl package tar file. 4. UrlEntry: kcl package url. 5. RefEntry: kcl package ref.
func GetSourceKindFrom ¶ added in v0.3.6
GetSourceKindFrom will return the kind of the source.