Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

recipes

Philippe Lafoucrière edited this page Jul 4, 2014 · 7 revisions

Recipes

You need to have installed Go from source before running goxc ...

Install goxc and build & package your project (having installed Go from source)

go get github.com/laher/goxc
cd my-project
goxc

Just cross-compile

goxc xc

Get help. Then, find out about available tasks, and then about an individual task

goxc -h
goxc -h tasks
goxc -h xc

Run goxc only for a particular platform (OS/architecture combination).

goxc -bc="windows,386"

(the -bc syntax is based on Go 'Build Constraints')

OR to restrict by platform (keeping the restriction in config for future invocations):

goxc -bc="windows,386" -wc
goxc

Write a config file, then bump the version number from 'unknown' to '0.0.1'

goxc -wc
goxc bump

Then, increase version to 0.0.2 and then 0.1.0 (being the number after the first dot)

goxc bump
goxc bump -dot=1

Use goxc to upload items to bintray.com

This generates a bintray version (if necessary), uploads artifacts, and generates a 'downloads' page (default is a 'markdown' page).

  • Create an account on bintray.com. Also create a repository and a package
  • Edit your .goxc.json file:
	{
		...
		"TaskSettings" : {
			"bintray" : {
				"package" : "my-package",
				"subject": "my-username",
				"repository": "my-repo",
				"downloadspage": "bintray.md"
			}
		}
	}
  • Create a .goxc.local.json file containing your api key:
	{
		"ConfigVersion": "0.9",
		"TaskSettings" : {
			"bintray" : {
				"apikey": "12d312314235afe56090932ea13234"
			}
		}
	}
  • Run the bintray task:
	goxc bintray
  • Use a different version of go for this build:

    goxc -goroot=/path/to/go/root xc

  • Use various go build args:

    goxc -build-gcflags="xxx" -build-processors=3 -build-ldflags='x=1' xc