go4rake 1.3 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -4
- data/examples/go4rake.yml +9 -0
- data/lib/go4rake/new.rb +9 -10
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09d9ef39c7e2f86072ab28b403461225bd8e9c2b
|
4
|
+
data.tar.gz: db49b5d6d159d2710d5b4b0c8a52f92b8237f0fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64afc399abfb670e57ccc122b18c81e051a9d5fdb1eddf232df5a130578f0c0eeffa994de6636d8a4286e53e4697894e2220f0c05a6ea3d6749c6eae149aaa39
|
7
|
+
data.tar.gz: f2b4f3bca76733211de6e86633fbe08c46399d05354bd85ad1827e3ae0a8607717c5d4d8d053779d473c7c715dc8a133ff32615038200be8854bf5f36144dae2
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@ This gem provides the following tasks:
|
|
5
5
|
* `rake build` for cross-compiling for the specified architectures
|
6
6
|
* `rake zip` command for making ZIP files that contain binary builds
|
7
7
|
* `rake test` for running tests for the native architecture
|
8
|
-
* `rake clean` for deleting the
|
8
|
+
* `rake clean` for deleting the ZIP files
|
9
9
|
|
10
10
|
`zip` depends on `build` and `test` (in that order).
|
11
11
|
|
@@ -16,10 +16,10 @@ The reason only the native runtime is supported in `test` is that `go test` for
|
|
16
16
|
### To install and use go4rake you need:
|
17
17
|
|
18
18
|
* Go cross-compilation toolchain for all the platforms, you need.
|
19
|
-
(Mac and [Homebrew](http://brew.sh/) users can run `brew install go --
|
20
|
-
or `brew install go --
|
19
|
+
(Mac and [Homebrew](http://brew.sh/) users can run `brew install go --with-cc-common`
|
20
|
+
or `brew install go --with-cc-all` for this, on other Unix and Windows you should
|
21
21
|
[build Go from source](http://dave.cheney.net/2013/07/09/an-introduction-to-cross-compilation-with-go-1-1).)
|
22
|
-
* Install [Ruby](https://www.ruby-lang.org). `gem` utility comes with it.
|
22
|
+
* Install [Ruby](https://www.ruby-lang.org/en/documentation/installation/). `gem` utility comes with it.
|
23
23
|
* Install go4rake: `gem install go4rake`.
|
24
24
|
* Enable go4rake in `Rakefile`: include `require 'go4rake'` in it (create the file, if missing).
|
25
25
|
(Unix users can do: `echo "require 'go4rake'" >> Rakefile`.)
|
@@ -57,6 +57,8 @@ Please note that:
|
|
57
57
|
directory; if not, they will be in current directory
|
58
58
|
* if `files` is not specified, a `NOTICE` file will be included in ZIP
|
59
59
|
files, if it's found in the project directory
|
60
|
+
* if you remove `NOTICE` or change `files` not to include some file,
|
61
|
+
you have to re-generate ZIP files: `rake clean zip`
|
60
62
|
* ZIP file permissions default to `0600`, this is due to
|
61
63
|
[bug in rubyzip](https://github.com/rubyzip/rubyzip/issues/204)
|
62
64
|
* `arch` is appended to the file name if `arch` is a list
|
data/examples/go4rake.yml
CHANGED
@@ -1,22 +1,31 @@
|
|
1
1
|
# go4rake config
|
2
2
|
# Public domain
|
3
3
|
|
4
|
+
# ZIP file directory. If absent, the current directory is used.
|
4
5
|
out: ~/Downloads
|
5
6
|
|
7
|
+
# Additional files to include in ZIP file. Optional.
|
6
8
|
files:
|
7
9
|
- README.md
|
8
10
|
- NOTICE
|
9
11
|
|
10
12
|
platforms:
|
13
|
+
# win32.zip
|
11
14
|
- name: windows
|
12
15
|
arch: 386
|
13
16
|
zip: win32
|
17
|
+
|
18
|
+
# win64.zip
|
14
19
|
- name: windows
|
15
20
|
arch: amd64
|
16
21
|
zip: win64
|
22
|
+
|
23
|
+
# mac.zip
|
17
24
|
- name: darwin
|
18
25
|
arch: amd64
|
19
26
|
zip: mac
|
27
|
+
|
28
|
+
# linux_386.zip and linux_amd64.zip
|
20
29
|
- name: linux
|
21
30
|
arch:
|
22
31
|
- 386
|
data/lib/go4rake/new.rb
CHANGED
@@ -4,7 +4,7 @@ require 'zip'
|
|
4
4
|
require 'zip/filesystem'
|
5
5
|
|
6
6
|
# Rake tasks to cross-compile Go project and ZIP the binaries:
|
7
|
-
# `rake build`, `rake
|
7
|
+
# `rake build`, `rake zip`, `rake test` and `rake clean`.
|
8
8
|
#
|
9
9
|
# Usage: `require 'go4rake'` in `Rakefile`. Settings are specified in a YAML file: `go4rake.yml`.
|
10
10
|
#
|
@@ -22,11 +22,11 @@ class Go4Rake < ::Rake::TaskLib
|
|
22
22
|
rescue => e
|
23
23
|
$stderr.puts("WARNING: Skipping `build` and `zip` tasks: #{e}")
|
24
24
|
end
|
25
|
-
# `build` and `
|
25
|
+
# `build`, `zip` and `clean` depend on config, `test` doesn't.
|
26
26
|
task_test
|
27
27
|
end
|
28
28
|
|
29
|
-
# Initialize `build` and `
|
29
|
+
# Initialize `build`, `zip` and `clean` tasks.
|
30
30
|
def tasks(cfg, yml)
|
31
31
|
desc "Build this project for the platforms in #{yml}"
|
32
32
|
task :build do
|
@@ -42,7 +42,7 @@ class Go4Rake < ::Rake::TaskLib
|
|
42
42
|
end
|
43
43
|
|
44
44
|
desc 'ZIP this project binaries'
|
45
|
-
task :
|
45
|
+
task zip: [:build, :test] do
|
46
46
|
cfg['out'] ||= '.' # Default to the current directory, if 'out' is not specified.
|
47
47
|
|
48
48
|
cfg['platforms'].each { |os|
|
@@ -72,7 +72,6 @@ class Go4Rake < ::Rake::TaskLib
|
|
72
72
|
end
|
73
73
|
}
|
74
74
|
end
|
75
|
-
|
76
75
|
end
|
77
76
|
|
78
77
|
# Initialize `test` task.
|
@@ -112,7 +111,7 @@ class Go4Rake < ::Rake::TaskLib
|
|
112
111
|
unless files
|
113
112
|
files = []
|
114
113
|
# `NOTICE` file is required by Apache license.
|
115
|
-
files.push('NOTICE') if File.
|
114
|
+
files.push('NOTICE') if File.exist?('NOTICE')
|
116
115
|
end
|
117
116
|
|
118
117
|
Zip::File.open(zip_file, Zip::File::CREATE) do |zip|
|
@@ -136,11 +135,11 @@ class Go4Rake < ::Rake::TaskLib
|
|
136
135
|
puts("Wrote #{zip_file}")
|
137
136
|
end
|
138
137
|
|
138
|
+
# Remove the ZIP file (specify path and basename).
|
139
139
|
def clean(dir, file)
|
140
140
|
zip_file = File.expand_path(dir) + '/' + file + '.zip'
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
end
|
141
|
+
return unless File.exist?(zip_file)
|
142
|
+
puts("Removing #{zip_file}")
|
143
|
+
File.delete(zip_file)
|
145
144
|
end
|
146
145
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: go4rake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vasily Korytov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.1'
|
41
|
-
description: "`build`, `
|
41
|
+
description: "`build`, `zip, `test`` and `clean` tasks for cross-compilation of Go
|
42
42
|
programs"
|
43
43
|
email: vasily.korytov@yahoo.com
|
44
44
|
executables: []
|
@@ -62,7 +62,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
62
62
|
requirements:
|
63
63
|
- - ">="
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version: '
|
65
|
+
version: '1.9'
|
66
66
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
68
|
- - ">="
|