Support user tags

This commit is contained in:
Lea Anthony
2021-04-04 13:42:48 +10:00
parent be43049fc6
commit 5d444cd6dd
3 changed files with 19 additions and 1 deletions

View File

@@ -190,10 +190,11 @@ func (b *BaseBuilder) CompileProject(options *Options) error {
var tags slicer.StringSlicer
tags.Add(options.OutputType)
tags.AddSlice(options.UserTags)
if options.Mode == Debug {
tags.Add("debug")
}
tags.Deduplicate()
// Add the output type build tag
commands.Add("-tags")

View File

@@ -29,6 +29,7 @@ var modeMap = []string{"Debug", "Production"}
// Options contains all the build options as well as the project data
type Options struct {
LDFlags string // Optional flags to pass to linker
UserTags []string // Tags to pass to the Go compiler
Logger *clilogger.CLILogger // All output to the logger
OutputType string // EG: desktop, server....
Mode Mode // release or debug