1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-16 03:52:12 +02:00

Make build ignore fields additive. Fixes #293.

This commit is contained in:
Jorin Vogel 2017-07-10 13:44:07 +02:00
parent d115d4bd6c
commit 77f366ba57
No known key found for this signature in database
GPG Key ID: 647AFD30D56CE8CC
2 changed files with 15 additions and 3 deletions

View File

@ -40,10 +40,16 @@ func allBuildTargets(build config.Build) (targets []Target) {
func ignored(build config.Build, target Target) bool { func ignored(build config.Build, target Target) bool {
for _, ig := range build.Ignore { for _, ig := range build.Ignore {
var ignored = New(ig.Goos, ig.Goarch, ig.Goarm) if ig.Goos != "" && ig.Goos != target.OS {
if ignored == target { continue
return true
} }
if ig.Goarch != "" && ig.Goarch != target.Arch {
continue
}
if ig.Goarm != "" && ig.Goarm != target.Arm {
continue
}
return true
} }
return false return false
} }

View File

@ -15,6 +15,7 @@ func TestAllBuildTargets(t *testing.T) {
"linux", "linux",
"darwin", "darwin",
"freebsd", "freebsd",
"openbsd",
}, },
Goarch: []string{ Goarch: []string{
"386", "386",
@ -34,6 +35,9 @@ func TestAllBuildTargets(t *testing.T) {
Goos: "linux", Goos: "linux",
Goarch: "arm", Goarch: "arm",
Goarm: "7", Goarm: "7",
}, {
Goos: "openbsd",
Goarch: "arm",
}, },
}, },
} }
@ -47,6 +51,8 @@ func TestAllBuildTargets(t *testing.T) {
New("freebsd", "amd64", ""), New("freebsd", "amd64", ""),
New("freebsd", "arm", "6"), New("freebsd", "arm", "6"),
New("freebsd", "arm", "7"), New("freebsd", "arm", "7"),
New("openbsd", "386", ""),
New("openbsd", "amd64", ""),
}, All(build)) }, All(build))
} }