feat: Makefile and bundled resources

This commit is contained in:
José Carlos Cuevas 2023-12-05 14:36:45 +01:00
parent f5bec00a1b
commit 24a7e1b4ed
4 changed files with 44 additions and 8 deletions

2
.gitignore vendored
View file

@ -21,3 +21,5 @@
# Go workspace file
go.work
radiospiral
radiospiral.log

20
Makefile Normal file
View file

@ -0,0 +1,20 @@
# Makefile for the RadioSpiral project
#
GO=go build
GO_OPTIONS=-buildmode=default
all: radiospiral
radiospiral: main.go bundle.go
$(GO) -o radiospiral $(GO_OPTIONS) main.go bundle.go
# It's a phony so we can always call it and regenerate the file
.PHONY: generate
generate:
go generate main.go
.PHONY: clean
clean:
rm radiospiral

17
bundle.go Normal file

File diff suppressed because one or more lines are too long

13
main.go
View file

@ -1,3 +1,6 @@
//go:generate fyne bundle -o bundle.go res/icon.png
//go:generate fyne bundle -o bundle.go -append res/header.png
package main
/*
@ -199,13 +202,7 @@ func main() {
window := app.NewWindow("RadioSpiral Player")
window.Resize(fyne.NewSize(400, 600))
icon, err := fyne.LoadResourceFromPath("./res/icon.png")
if err != nil {
log.Println("[ERROR] Couldn't load the app icon!")
log.Println(err)
} else {
window.SetIcon(icon)
}
window.SetIcon(resourceIconPng)
// Keep the status of the player
playStatus := false
@ -214,7 +211,7 @@ func main() {
radioSpiralAvatar := loadImageURL("https://radiospiral.net/wp-content/uploads/2018/03/Radio-Spiral-Logo-1.png")
// Header section
radioSpiralImage := canvas.NewImageFromFile("./res/header.png")
radioSpiralImage := canvas.NewImageFromResource(resourceHeaderPng)
header := container.NewCenter(radioSpiralImage)
// Next show section