From b62966ca35f5041b59ce962ce24a2c73ca874e22 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Mon, 4 Nov 2019 17:20:00 +0100 Subject: [PATCH] Consume CompilerBackend in Compiler --- pkg/compiler/compiler.go | 8 ++++++++ pkg/compiler/interface.go | 3 +++ 2 files changed, 11 insertions(+) diff --git a/pkg/compiler/compiler.go b/pkg/compiler/compiler.go index 6bb5e740..88c621ad 100644 --- a/pkg/compiler/compiler.go +++ b/pkg/compiler/compiler.go @@ -56,3 +56,11 @@ func (cs *LuetCompiler) FromPackage(p pkg.Package) (CompilationSpec, error) { } return NewLuetCompilationSpec(dat) } + +func (cs *LuetCompiler) GetBackend() CompilerBackend { + return cs.Backend +} + +func (cs *LuetCompiler) SetBackend(b CompilerBackend) { + cs.Backend = b +} diff --git a/pkg/compiler/interface.go b/pkg/compiler/interface.go index 48c2adda..ceda1c07 100644 --- a/pkg/compiler/interface.go +++ b/pkg/compiler/interface.go @@ -20,6 +20,9 @@ import pkg "github.com/mudler/luet/pkg/package" type Compiler interface { Compile(CompilationSpec) (*Artifact, error) FromPackage(pkg.Package) (CompilationSpec, error) + + SetBackend(CompilerBackend) + GetBackend() CompilerBackend } type CompilerBackend interface {