braddschick / windows-buildr

Build Windows Resource for GO application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

windows-buildr

Simply build Windows Resources file for GO applications.

This will build a *.syso file for your GO application to build a windows resource file that will be utilized during the native go build process.

Build

make build

Command File

Once your build completes it will create a bin folder that will contain a VERSION/macos/ARCH folder and under that will be the windows-buildr file that can be executed.

Usage

Arguments

  • n
    • Name of the Software you're packaging
  • v
    • Version of the Software "v0.0.0"
  • i
    • File path to the Icon PNG to be displayed when viewing the application
  • d
    • Human readable description of the software
  • w
    • Working directory
  • o
    • File name for the ouput resource file with the -w prepended
    • DEFAULT rsrc_windows_amd64.syso
  • c
    • Company name of software
  • r
    • Copyright of Software

Example of Usage

Below is an example of how to use this command line app for an automated build process with make.

VERSION := v0.0.0
COMPANY := Your Company name
COPYRIGHT := Your Copyright Info Here

build: clean create-sys build-windows build-macos

create-sys:
	./cmd/windowsinfo -n "Software Name" -v "$(VERSION)" -c "$(COMPANY)" -r "$(COPYRIGHT)" -w "/Users/username/Developer/project-name" -d "description of software being packaged" -i "theme/icon.png" 

build-windows:
	mkdir -p dist/windows
	GOOS=windows GOARCH=amd64 go build -o dist/windows/XXXX_x64.exe

build-macos:
	mkdir -p dist/mac
	GOOS=darwin GOARCH=amd64 go build -ldflags "-w -X main.Version=$(VERSION) -X main.Company=$(COMPANY)" -o dist/mac/XXXX_x64
	GOOS=darwin GOARCH=arm64 go build -ldflags "-w -X main.Version=$(VERSION) -X main.Company=$(COMPANY)" -o dist/mac/XXXX_arm64

clean:
	rm -rf dist
	rm -f rsrc_windows_amd64.syso

Simply save your build file after changing the appropriate values and in the terminal just type make build and now your building process is much more automated.

Questions

Post any questions or comments to me

About

Build Windows Resource for GO application

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Go 90.8%Language:Makefile 9.2%