-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from josephspurrier/windows-ci
Fix issue with icon not closing handle
- Loading branch information
Showing
29 changed files
with
257 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# IDE Settings | ||
.vscode/ | ||
|
||
# Folders | ||
vendor/ | ||
|
||
# Files | ||
cmd/goversioninfo/goversioninfo | ||
*.exe | ||
*.syso | ||
|
||
# OS Files | ||
.DS_Store | ||
thumbs.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,31 @@ | ||
os: windows | ||
sudo: false | ||
language: go | ||
|
||
go: | ||
#- 1.0 | ||
#- 1.1 | ||
#- 1.2 | ||
#- 1.3 | ||
- 1.4 | ||
- 1.5 | ||
- 1.6 | ||
- tip | ||
|
||
# - '1.0' | ||
# - '1.1' | ||
# - '1.2' | ||
# - '1.3' | ||
# - '1.4' | ||
- '1.5' | ||
- '1.6' | ||
- '1.7' | ||
- '1.8' | ||
- '1.9' | ||
- '1.10' | ||
- '1.11' | ||
before_install: | ||
- go get github.com/axw/gocov/gocov | ||
- go get github.com/mattn/goveralls | ||
- go get golang.org/x/tools/cmd/cover | ||
- go get github.com/akavel/rsrc/binutil | ||
- go get github.com/akavel/rsrc/coff | ||
- go get github.com/akavel/rsrc/ico | ||
|
||
script: | ||
- $HOME/gopath/bin/goveralls -repotoken lNZXr7UDQai10RBP6KAOqA6fRcs5NlKEe | ||
# Install binary. | ||
- go install github.com/$TRAVIS_REPO_SLUG/cmd/goversioninfo | ||
# Test building 32 and 64 on Windows. | ||
- bash $TRAVIS_BUILD_DIR/testdata/bash/build.sh | ||
# Run tests and send coverage info. | ||
- cd $TRAVIS_BUILD_DIR | ||
- $GOPATH/bin/goveralls -service=travis-ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,9 @@ | ||
package goversioninfo | ||
//go:generate goversioninfo -icon=testdata/resource/icon.ico -manifest=testdata/resource/goversioninfo.exe.manifest -64 | ||
|
||
import ( | ||
"io/ioutil" | ||
"log" | ||
"os" | ||
) | ||
package goversioninfo_test | ||
|
||
// Example | ||
func Example() { | ||
logic() | ||
} | ||
|
||
// Create the syso file | ||
func logic() { | ||
// Read the config file | ||
jsonBytes, err := ioutil.ReadFile("versioninfo.json") | ||
if err != nil { | ||
log.Printf("Error reading versioninfo.json: %v", err) | ||
os.Exit(1) | ||
} | ||
|
||
// Create a new container | ||
vi := &VersionInfo{} | ||
|
||
// Parse the config | ||
if err := vi.ParseJSON(jsonBytes); err != nil { | ||
log.Printf("Could not parse the .json file: %v", err) | ||
os.Exit(2) | ||
} | ||
import "fmt" | ||
|
||
// Fill the structures with config data | ||
vi.Build() | ||
|
||
// Write the data to a buffer | ||
vi.Walk() | ||
|
||
// Optionally, embed an icon by path | ||
// If the icon has multiple sizes, all of the sizes will be embedded | ||
vi.IconPath = "icon.ico" | ||
|
||
// Create the file | ||
if err := vi.WriteSyso("resource.syso", "386"); err != nil { | ||
log.Printf("Error writing syso: %v", err) | ||
os.Exit(3) | ||
} | ||
func Example() { | ||
fmt.Println("Hello world") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.