Skip to content

Commit

Permalink
feat: expose the CopyDependentModules method (#1111)
Browse files Browse the repository at this point in the history
  • Loading branch information
SparkYuan committed May 10, 2024
1 parent f9c000c commit 113ffdf
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pkg/engine/api/generate/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
// Generator is an interface for things that can generate versioned Spec from
// configuration code under current working directory with given input parameters.
type Generator interface {
// Generate creates versioned Intent given working directory and set of parameters
// Generate creates versioned Intent given working directory and a set of parameters
Generate(workDir string, params map[string]string) (*v1.Spec, error)
}

Expand All @@ -46,8 +46,7 @@ type DefaultGenerator struct {
Project *v1.Project
Stack *v1.Stack
Workspace *v1.Workspace

Runner run.CodeRunner
Runner run.CodeRunner
}

// Generate versioned Spec with target code runner.
Expand All @@ -62,7 +61,7 @@ func (g *DefaultGenerator) Generate(workDir string, params map[string]string) (*
}

// Copy dependent modules before call builder
err = copyDependentModules(workDir)
err = CopyDependentModules(workDir)
if err != nil {
return nil, err
}
Expand All @@ -87,8 +86,8 @@ func (g *DefaultGenerator) Generate(workDir string, params map[string]string) (*
return builder.Build(kclPkg, g.Project, g.Stack)
}

// copyDependentModules copies dependent Kusion modules' generators to destination.
func copyDependentModules(workDir string) error {
// CopyDependentModules copies dependent Kusion modules' generators to destination.
func CopyDependentModules(workDir string) error {
modFile := &pkg.ModFile{}
err := modFile.LoadModFile(filepath.Join(workDir, pkg.MOD_FILE))
if err != nil {
Expand Down

0 comments on commit 113ffdf

Please sign in to comment.