Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window resource flle need to be placed into the package root to be linked #79

Merged
merged 3 commits into from
Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog - Fyne.io fyne-cross

## Unreleased

### Fixed

- Building for windows fails to add icon #66

## 1.1.2 - 05 Oct 2021

### Fixed
Expand Down
15 changes: 8 additions & 7 deletions internal/command/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"
"os/user"
"path/filepath"
"runtime"
"strings"

Expand Down Expand Up @@ -330,8 +331,6 @@ func fyneRelease(ctx Context) error {
// that will be automatically linked by compliler during the build
func WindowsResource(ctx Context) (string, error) {

windres := ctx.Name + ".syso"

args := []string{
gowindresBin,
"-arch", ctx.Architecture.String(),
Expand All @@ -346,17 +345,19 @@ func WindowsResource(ctx Context) (string, error) {

err := Run(ctx.DockerImage, ctx.Volume, runOpts, args)
if err != nil {
return windres, fmt.Errorf("could not package the Fyne app: %v", err)
return "", fmt.Errorf("could not package the Fyne app: %v", err)
}

// copy the windows resource under the project root
// copy the windows resource under the package root
// it will be automatically linked by compiler during build
err = volume.Copy(volume.JoinPathHost(ctx.TmpDirHost(), ctx.ID, windres), volume.JoinPathHost(ctx.WorkDirHost(), windres))
windres := ctx.Name + ".syso"
out := filepath.Join(ctx.Package, windres)
err = volume.Copy(volume.JoinPathHost(ctx.TmpDirHost(), ctx.ID, windres), volume.JoinPathHost(ctx.WorkDirHost(), out))
if err != nil {
return windres, fmt.Errorf("could not copy windows resource under the project root: %v", err)
return "", fmt.Errorf("could not copy windows resource under the package root: %v", err)
}

return windres, nil
return out, nil
}

// pullImage attempts to pull a newer version of the docker image
Expand Down