go4rake 1.3 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 926c729186dfe44a389cf97c4f2758bcb2804f77
4
- data.tar.gz: 6cd2ca2a1104937fe52a006a71cc3889887dc365
3
+ metadata.gz: 09d9ef39c7e2f86072ab28b403461225bd8e9c2b
4
+ data.tar.gz: db49b5d6d159d2710d5b4b0c8a52f92b8237f0fb
5
5
  SHA512:
6
- metadata.gz: 8fc3b58632cd5ec4aceb9c8b87f74277b539532815534fc3cea76dc15b1462a6b8c01f27e8a8581e9333484104765f5ebc94a319e7c6f366f1b46ef05e0d3e31
7
- data.tar.gz: 01563a5f1f53d6e43821c244cd88de4a3802035a064da5411cd31fc2c4bd69c912adc7da5c0303a4d0c8fe7c274b21e43983fa21852cf1c58371691cd45db047
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 created ZIP files
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 --cross-compile-common`
20
- or `brew install go --cross-compile-all` for this, on other Unix and Windows you should
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
@@ -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
@@ -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 test`, `rake zip` and `rake clean`.
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 `zip` depend on config, `test` doesn't.
25
+ # `build`, `zip` and `clean` depend on config, `test` doesn't.
26
26
  task_test
27
27
  end
28
28
 
29
- # Initialize `build` and `zip` tasks.
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 :zip => [:build, :test] do
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.exists?('NOTICE')
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
- if File.exists?(zip_file)
142
- puts("Removing #{zip_file}")
143
- File.delete(zip_file)
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: '1.3'
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-01-10 00:00:00.000000000 Z
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`, `test`, `zip` and `clean` tasks for cross-compilation of Go
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: '0'
65
+ version: '1.9'
66
66
  required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - ">="