From fec687e73ef7629a855adab19a56b481db648853 Mon Sep 17 00:00:00 2001 From: Matthew Rothenberg Date: Mon, 16 Mar 2015 22:41:33 -0400 Subject: [PATCH] use goxc for cross compile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit probably will need to tune this a bit more when we work towards an actual release, but seems to be functioning well for now. piggybacks on the version script to set binary version, if goxc is run outside of rake task will just make a “snapshot” build which is fine for now. --- .goxc.json | 9 +++++++++ Rakefile | 15 +++------------ script/bootstrap | 4 ++++ 3 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 .goxc.json diff --git a/.goxc.json b/.goxc.json new file mode 100644 index 0000000..287f055 --- /dev/null +++ b/.goxc.json @@ -0,0 +1,9 @@ +{ + "ArtifactsDest": "builds", + "TasksExclude": [ + "deb", + "deb-dev" + ], + "BuildConstraints": "linux darwin windows", + "ConfigVersion": "0.9" +} diff --git a/Rakefile b/Rakefile index 7cda07d..7b988ee 100644 --- a/Rakefile +++ b/Rakefile @@ -46,19 +46,10 @@ task "features:wip" => :build do sh "cucumber -s --tags=@wip" end -# quick and dirty package script, will have to replace with something much more -# robust and also cross platform down the line, but for sending to friends this -# can work for now... desc "package for distribution" -task :package => [:build] do - DEST = "builds/scmpuff-osx" - tagged_version = `git describe --tags`.chomp() - mkdir_p DEST - cp "bin/scmpuff", DEST - cp "README.md", DEST - cp "CHANGELOG.md", DEST - cp "INSTALL.txt", DEST - sh "tar -C builds -cz -f builds/scmpuff_osx_amd64_#{tagged_version}.tgz scmpuff-osx" +task :package do + tagged_version = `script/version`.chomp() + sh "goxc -pv='#{tagged_version}'" end CLOBBER.include "builds" diff --git a/script/bootstrap b/script/bootstrap index 213f880..cf29f4b 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -10,3 +10,7 @@ fi if [ ! -x $GOPATH/bin/go-bindata ]; then go get github.com/jteeuwen/go-bindata/... fi + +if [ ! -x $GOPATH/bin/goxc ]; then + go get github.com/laher/goxc +fi