Project

go4rake

0.0
No commit activity in last 3 years
No release in over 3 years
`build`, `zip, `test`` and `clean` tasks for cross-compilation of Go programs
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 10, < 14
~> 2.0
 Project Readme

go4rake: Rake tasks for cross-compiling Go programs Gem Version

This gem provides the following tasks:

  • rake build for cross-compiling for the specified architectures
  • rake zip command for making ZIP files that contain binary builds
  • rake test for running tests for the native architecture
  • rake clean for deleting the ZIP files

zip depends on build and test (in that order).

build uses go install, test uses go test.

The reason only the native runtime is supported in test is that go test for a different operating system does not work. That's a pity.

Installation and usage

  • Install Go and Ruby.
  • Install go4rake: gem install go4rake.
  • Enable go4rake in Rakefile: include require 'go4rake' in it (create the file, if missing).
    (Unix users can do: echo "require 'go4rake'" >> Rakefile.)
  • Specify your platforms in go4rake.yml. See below for configuration.
  • Run rake build or rake zip.

Configuration

zip, build and clean tasks expect a YAML config, go4rake.yml. Say, we have this config.

This way, you run rake zip and you get the following ZIP files containing the static binary builds in your ~/Downloads directory:

  • win32.zip
  • win64.zip
  • linux_amd64.zip
  • linux_386.zip
  • mac.zip

For each platform:

  • name is OS name
  • arch is arch
  • zip is ZIP file name (optional)

These files will be also included into the ZIP files:

  • README.md
  • NOTICE

Please note that:

  • If out is specified, ZIP files will appear in the specified directory; if not, they will be in ~/Downloads.
    Prior to 1.5.2 the default value was .
  • Also please note that current files with the same names as your targets are overwritten.
  • If files are not specified, a NOTICE file will be included in ZIP files, if it's found in the project directory
  • arch is appended to the file name if arch is a list