提交 4e7306f9 编写于 作者: J Jingwen Owen Ou

Split multiple steps for linux cross-compile task

上级 0e93c1a3
......@@ -59,6 +59,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "linux" do |linux|
linux.vm.box = "precise64"
linux.vm.box_url = "http://files.vagrantup.com/precise64.box"
linux.vm.synced_folder "#{src_path}/src/github.com/jingweno/gh/target", "/home/vagrant/target"
linux.vm.provision :shell, :inline => bootstrap("linux")
end
......
......@@ -31,9 +31,24 @@ func TaskCrossCompileAll(t *tasking.T) {
// for linux
t.Log("Compiling for linux...")
err = t.Exec("vagrant ssh -c 'rm -rf ~/gocode && go get github.com/jingweno/gh && cd ~/gocode/src/github.com/jingweno/gh && ./script/bootstrap && gotask cross-compile'")
t.Log("Downloading gh...")
err = t.Exec("vagrant ssh -c 'rm -rf ~/gocode && go get github.com/jingweno/gh'")
if err != nil {
t.Errorf("Can't compile on linux: %s\n", err)
t.Errorf("Can't download gh on linux: %s\n", err)
return
}
t.Log("Cross-compiling gh...")
err = t.Exec("vagrant ssh -c 'cd ~/gocode/src/github.com/jingweno/gh && ./script/bootstrap && GOPATH=`godep path`:$GOPATH gotask cross-compile'")
if err != nil {
t.Errorf("Can't cross-compile gh on linux: %s\n", err)
return
}
t.Log("Moving build artifacts...")
err = t.Exec("vagrant ssh -c 'cp -R ~/gocode/src/github.com/jingweno/gh/target/* ~/target/'")
if err != nil {
t.Errorf("Can't cross-compile gh on linux: %s\n", err)
return
}
}
......@@ -51,16 +66,6 @@ func TaskCrossCompile(t *tasking.T) {
return
}
// TODO: use a dependency manager that has versioning
//if runtime.GOOS != "windows" {
//t.Log("Updating dependencies...")
//err = t.Exec("go get -u ./...")
//if err != nil {
//t.Errorf("Can't update goxc: %s\n", err)
//return
//}
//}
t.Logf("Cross-compiling gh for %s...\n", runtime.GOOS)
err = t.Exec("goxc", "-wd=.", "-os="+runtime.GOOS, "-c="+runtime.GOOS)
if err != nil {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册