Skip to content

Commit

Permalink
[GUI] - Include version and avoid windows to open cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
Girbons committed May 22, 2019
1 parent f3c6ef0 commit fec1fd7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 16 deletions.
37 changes: 23 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
#get latest git tag
# get latest git tag
TAG = $$(git describe --abbrev=0 --tags)
#get current date and time
# get current date and time
NOW = $$(date +'%Y-%m-%d_%T')
#use the linker to inject the informations
LDFLAGS = -ldflags="-X main.release=${TAG} -X main.buildTime=${NOW}"
# use the linker to inject the informations
LDFLAGS = "-X main.release=${TAG} -X main.buildTime=${NOW}"
LDFLAGSWINDOWS = "-H windowsgui -X main.release=${TAG} -X main.buildTime=${NOW}"

help: # this command
# [generating help from tasks header]
@egrep '^[A-Za-z0-9_-]+:' Makefile

osx-build: # Create the executable for OSX
@GOOS=darwin GOARCH=amd64 go build ${LDFLAGS} -o build/comics-downloader-osx ./cmd/downloader
osx-build: # Creates OSX executable
@GOOS=darwin GOARCH=amd64 go build -ldflags=${LDFLAGS} -o build/comics-downloader-osx ./cmd/downloader

windows-build: # Create the executable for WINDOWS
@GOOS=windows GOARCH=amd64 go build ${LDFLAGS} -o build/comics-downloader.exe ./cmd/downloader
windows-build: # Creates Windows executable
@GOOS=windows GOARCH=amd64 go build -ldflags=${LDFLAGS} -o build/comics-downloader.exe ./cmd/downloader

linux-build: # Create the executable for LINUX
@GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o build/comics-downloader ./cmd/downloader
linux-build: # Creates Linux executable
@GOOS=linux GOARCH=amd64 go build -ldflags=${LDFLAGS} -o build/comics-downloader ./cmd/downloader

gui-builds: # Creates GUI executables for LINUX OSX WINDOWS
fyne-cross --output comics-downloader-gui --targets=linux/amd64,windows/amd64,darwin/amd64 ./cmd/gui
osx-gui-build: # Creates OSX Gui executable
@GOOS=darwin GOARCH=amd64 go build -ldflags=${LDFLAGS} -o build/comics-downloader-gui-osx ./cmd/gui

builds: # Create the executables for OSX/Windows/Linux
windows-gui-build: # Creates Window GUI executable
@CGO_ENABLED=1 GOOS=windows CC=x86_64-w64-mingw32-gcc go build -ldflags=${LDFLAGSWINDOWS} -o build/comics-downloader-gui-windows ./cmd/gui

linux-gui-build: # Creates LINUX executable
@fyne-cross --ldflags=${LDFLAGS} --output=comics-downloader-gui --targets=linux/amd64 ./cmd/gui

builds: # Creates executables for OSX/Windows/Linux
@make osx-build
@make windows-build
@make linux-build
@make gui-builds
@make windows-gui-build
@make osx-gui-build
@make linux-gui-build

remove-builds: # Remove executables
@rm -rf build/
1 change: 0 additions & 1 deletion cmd/downloader/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ var (
)

func main() {

url := flag.String("url", "", "Comic URL or Comic URLS by separating each site with a comma without the use of spaces")
format := flag.String("format", "pdf", "Comic format output, supported formats are pdf,epub,cbr,cbz")
country := flag.String("country", "", "Set the country to retrieve a manga, Used by MangaRock")
Expand Down
6 changes: 5 additions & 1 deletion cmd/gui/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package main

import (
"fmt"

"fyne.io/fyne"
"fyne.io/fyne/app"
"fyne.io/fyne/layout"
Expand All @@ -15,11 +17,13 @@ func watchLogs(logSection *widget.ScrollContainer, box *widget.Box) {
}
}

var release string // sha1 revision used to build the program

func main() {
options := []string{"pdf", "epub", "cbr", "cbz"}

app := app.New()
w := app.NewWindow("Comics Downloader")
w := app.NewWindow(fmt.Sprintf("Comics Downloader %s", release))

urlEntry := widget.NewEntry()
urlEntry.SetPlaceHolder("Comic URL or URLs separated by a comma")
Expand Down

0 comments on commit fec1fd7

Please sign in to comment.