From 5cefb8499dfe0251b4148bf11179050bc5c0a913 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Tue, 12 Nov 2024 17:26:29 +0000 Subject: [PATCH] Allow unnamed flavors to override the default build Use this to always use the modified build flags for bisonw systray flavor by default for its Windows build. --- main.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index dc8070a..be48462 100644 --- a/main.go +++ b/main.go @@ -148,7 +148,7 @@ var dists = []dist{{ relver: bisonwalletRelver, tools: []buildtool{ {"decred.org/dcrdex/client/cmd/bisonw", "./dcrdex", []flavor{ - {"tray", "windows", func(tags, ldflags string) (string, string) { + {"", "windows", func(tags, ldflags string) (string, string) { tags += ",systray" ldflags += " -H=windowsgui" return tags, ldflags @@ -233,14 +233,20 @@ func (d *dist) release() { if *nobuild { break } - build(tool.tool, tool.builddir, target.os, target.arch, d.ldflags, nil) + var flavorOverridesDefault bool for _, f := range tool.flavors { if f.os != "" && f.os != target.os { continue } + if f.flavor == "" { + flavorOverridesDefault = true + } build(tool.tool, tool.builddir, target.os, target.arch, d.ldflags, &f) } + if len(tool.flavors) == 0 || !flavorOverridesDefault { + build(tool.tool, tool.builddir, target.os, target.arch, d.ldflags, nil) + } } if *noarchive { continue