git-grunt-gobuild v0.2.2
Compile Go files
Getting Started
This plugin requires Grunt ~0.4.0
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install git-grunt-gobuild --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('git-grunt-gobuild');
This plugin was designed to work with Grunt 0.4.x. If you're still using grunt v0.3.x it's strongly recommended that you upgrade, but in case you can't please use v0.3.2.
Related projects
Also check out gorun and gostop for other go/grunt modules.
Gobuild task
Run this task with the grunt gobuild
command.
Compile Go programs inline as a Grunt task.
Testing
Please note that some tests require you to have bootstrapped the amd64 and i386 architectures. If you have not done so already, do the following:
cd $GOROOT/src
GOARCH=386 ./make.bash
GOARCH=amd64 ./make.bash
GOOS=darwin ./make.bash
GOOS=windows ./make.bash
Options
src
Set to your go file with func main().
dest
The destination binary (with binary name included).
goarch and goos
The architecture / OS to build for. See the chart here for reference. Leave undefined for the default architecture / OS on your system.
Usage Examples
Basic compilation
gobuild: {
first: {
src: "main.go",
dest: "binary_one"
},
second: {
src: "some/location/other.go",
dest: "/tmp/binary_two"
}
}
Compile with goarch and goos
gobuild: {
first: {
src: "main.go",
dest: "my_executable.exe",
goarch: 386,
goos: windows
}
}
Release History
- 2014-10-13 v0.2.2 Updated readme with related projects.
- 2014-10-13 v0.2.1 Simplified gobuild process with the -o flag.
- 2014-10-13 v0.2.0 Formally changed the project to gobuild, and split out gorun to separate project.
- 2014-10-13 v0.1.0 Initial commit with basic functionality - Go Build.
Task submitted by Jean de Klerk
This file was generated on Tue Dec 02 2014 14:20:15.