Skip to content

Commit

Permalink
Make fyne build package match go build package?
Browse files Browse the repository at this point in the history
  • Loading branch information
Cedric BAIL committed Mar 9, 2022
1 parent 629b767 commit b3f12ba
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cmd/fyne/internal/commands/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
// Builder generate the executables.
type Builder struct {
os, srcdir, target string
goPackage string
release bool
tags []string
tagsToParse string
Expand Down Expand Up @@ -64,10 +65,7 @@ func Build() *cli.Command {
if argCount != 1 {
return fmt.Errorf("incorrect amount of path provided")
}
if b.srcdir != "" {
return fmt.Errorf("the directory to package is already specified")
}
b.srcdir = ctx.Args().First()
b.goPackage = ctx.Args().First()
}

return b.Build()
Expand Down Expand Up @@ -181,6 +179,10 @@ func (b *Builder) build() error {
args = append(args, strings.Join(tags, ","))
}

if b.goPackage != "" {
args = append(args, b.goPackage)
}

if goos != "ios" && goos != "android" && !isWeb(goos) {
env = append(env, "GOOS="+goos)
} else if goos == "wasm" {
Expand Down

0 comments on commit b3f12ba

Please sign in to comment.