releasy 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardopts +3 -1
- data/CHANGELOG.md +9 -0
- data/README.md +114 -41
- data/Rakefile +1 -1
- data/bin/7z_sfx_LICENSE.txt +56 -0
- data/bin/7za.exe +0 -0
- data/bin/7za_exe_LICENSE.txt +29 -0
- data/lib/releasy.rb +4 -1
- data/lib/releasy/builders/builder.rb +14 -6
- data/lib/releasy/builders/ocra_builder.rb +4 -2
- data/lib/releasy/builders/osx_app.rb +18 -6
- data/lib/releasy/builders/source.rb +9 -2
- data/lib/releasy/builders/windows_folder.rb +12 -3
- data/lib/releasy/builders/windows_installer.rb +2 -3
- data/lib/releasy/builders/windows_standalone.rb +13 -3
- data/lib/releasy/builders/windows_wrapped.rb +14 -4
- data/lib/releasy/cli/install_sfx.rb +1 -1
- data/lib/releasy/deployers.rb +1 -1
- data/lib/releasy/deployers/deployer.rb +22 -1
- data/lib/releasy/deployers/github.rb +31 -124
- data/lib/releasy/deployers/local.rb +55 -0
- data/lib/releasy/deployers/rsync.rb +59 -0
- data/lib/releasy/mixins/has_packagers.rb +1 -1
- data/lib/releasy/mixins/utilities.rb +34 -0
- data/lib/releasy/packagers/dmg.rb +17 -0
- data/lib/releasy/packagers/exe.rb +18 -1
- data/lib/releasy/packagers/packager.rb +22 -6
- data/lib/releasy/packagers/seven_zip.rb +17 -0
- data/lib/releasy/packagers/tar_bzip2.rb +19 -0
- data/lib/releasy/packagers/tar_gzip.rb +19 -0
- data/lib/releasy/packagers/tar_packager.rb +2 -1
- data/lib/releasy/packagers/zip.rb +17 -0
- data/lib/releasy/project.rb +45 -4
- data/lib/releasy/version.rb +1 -1
- data/releasy.gemspec +1 -1
- data/test/releasy/builders/data/Main.rb +3 -2
- data/test/releasy/builders/helpers/builder_helper.rb +35 -0
- data/test/releasy/builders/helpers/ocra_builder_helper.rb +31 -0
- data/test/releasy/builders/helpers/windows_builder_helper.rb +25 -0
- data/test/releasy/builders/osx_app_test.rb +6 -4
- data/test/releasy/builders/source_test.rb +7 -4
- data/test/releasy/builders/windows_folder_test.rb +3 -1
- data/test/releasy/builders/windows_installer_test.rb +6 -4
- data/test/releasy/builders/windows_standalone_test.rb +6 -4
- data/test/releasy/builders/windows_wrapped_test.rb +3 -1
- data/test/releasy/cli/install_sfx_test.rb +1 -1
- data/test/releasy/deployers/github_test.rb +30 -32
- data/test/releasy/deployers/local_test.rb +93 -0
- data/test/releasy/deployers/rsync_test.rb +55 -0
- data/test/releasy/integration/source_test.rb +6 -6
- data/test/releasy/mixins/utilities_test.rb +50 -0
- data/test/releasy/packagers/packager_test.rb +79 -0
- data/test/releasy/packagers_test.rb +12 -6
- data/test/releasy/project_test.rb +5 -5
- data/test/teststrap.rb +6 -0
- data/test/yard_test.rb +1 -1
- metadata +40 -28
- data/lib/releasy/mixins/exec.rb +0 -14
- data/test/releasy/builders/ocra_builder_test.rb +0 -37
- data/test/releasy/builders/windows_builder_test.rb +0 -26
data/.yardopts
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
Releasy Change Log
|
2
2
|
==================
|
3
3
|
|
4
|
+
v0.2.2
|
5
|
+
------
|
6
|
+
|
7
|
+
* Added new deployers: :rsync and :local
|
8
|
+
* Removed 7z installation dependency on Windows (included 7za.exe in gem).
|
9
|
+
* Fixes for Ruby 1.8.7
|
10
|
+
* :osx_app build - Change directory into application directory before running app.
|
11
|
+
* :osx_app build - Add BINARY to list of "fake" encodings.
|
12
|
+
|
4
13
|
v0.2.0
|
5
14
|
------
|
6
15
|
|
data/README.md
CHANGED
@@ -1,49 +1,32 @@
|
|
1
1
|
Releasy
|
2
2
|
=======
|
3
3
|
|
4
|
-
_Releasy_ automates the release of Ruby applications
|
5
|
-
By configuring a {Releasy::Project} in your application's
|
6
|
-
when there is a need to build, archive and/or deploy a new version of the application.
|
7
|
-
|
8
|
-
Releasy allows cross-platform releases, relying on OS X or Windows "wrappers" to act as templates.
|
4
|
+
_Releasy_ automates the release of Ruby applications for non-Ruby users, such as games or GUI applications.
|
5
|
+
By configuring a {Releasy::Project} in your application's Rakefile, Releasy can generate Rake tasks for use
|
6
|
+
when there is a need to build, package (archive) and/or deploy a new version of the application.
|
9
7
|
|
10
8
|
* Author: [Bil Bas (Spooner)](https://github.com/Spooner)
|
11
9
|
* Licence: [MIT](http://www.opensource.org/licenses/mit-license.php)
|
12
10
|
* [Github project](https://github.com/Spooner/releasy)
|
13
11
|
* [Reporting issues](https://github.com/Spooner/releasy/issues)
|
14
|
-
*
|
15
|
-
|
16
|
-
Build types supported
|
17
|
-
----------------------
|
18
|
-
|
19
|
-
The project can build one or more release folders:
|
12
|
+
* Releasy has been tested on Ruby 1.9.3 and 1.8.7 on Windows, Lubuntu and OS X. However, since this is an early version, please ensure that you double-check any releases created by Releasy before publishing them!
|
20
13
|
|
21
|
-
* `:source` - Plain source folder, which can be used by anyone with Ruby already installed.
|
22
|
-
* `:osx_app` - OS X application bundle (.app) build, requiring a pre-made Ruby OS X wrapper. Note that this only contains binary gems for Gosu, TexPlay and Chipmunk, but will work with applications using any other source gems.
|
23
|
-
* `:windows_folder` - A folder containing Ruby, application source files and an EXE to run them [creation on Windows only].
|
24
|
-
* `:windows_wrapped` - A folder containing Ruby, application source files and an EXE to run them, requiring a copy of a RubyInstaller archive [creation on OSX/Linux].
|
25
|
-
* `:windows_installer` - A regular Windows installer [creation on Windows only and requires InnoSetup to be installed].
|
26
|
-
* `:windows_standalone` - Standalone EXE file that self-extracts to a temporary directory - slower startup than the other Windows options [creation on Windows only].
|
27
14
|
|
28
|
-
|
29
|
-
|
15
|
+
Key features
|
16
|
+
------------
|
30
17
|
|
31
|
-
|
18
|
+
* Package up Ruby applications (Games, GUI applications, etc.) for non-ruby users.
|
19
|
+
* Build OSX application bundle (.app) on any platform.
|
20
|
+
* Build Windows executable (.exe) on any platform.
|
21
|
+
* Build Windows installer on Windows only.
|
22
|
+
* Build, package (compress) and deploy your executables for all platforms from a single rake command ('rake deploy').
|
32
23
|
|
33
|
-
* `:dmg` - OS X self-extractor (.dmg - requires `hdiutil` to be installed, so only available on OS X).
|
34
|
-
* `:exe` - Windows self-extractor (.exe - Includes a 7z decompression module, so not efficient for small releases).
|
35
|
-
* `:"7z"` - 7Zip format (.7z - Best compression).
|
36
|
-
* `:tar_bz2` - BZip2 tarball (.tar.bz2).
|
37
|
-
* `:tar_gz` - GZip tarball (.tar.gz).
|
38
|
-
* `:zip` - Standard zip format (.zip - Poor compression, but best compatibility).
|
39
24
|
|
40
|
-
|
41
|
-
|
25
|
+
Installation
|
26
|
+
------------
|
42
27
|
|
43
|
-
|
28
|
+
gem install releasy
|
44
29
|
|
45
|
-
* `:github` - Upload to Github downloads.
|
46
|
-
* Others, such as `:dropbox`, when I get around to implementing them.
|
47
30
|
|
48
31
|
Example
|
49
32
|
-------
|
@@ -71,13 +54,13 @@ Example
|
|
71
54
|
# Create a variety of releases, for all platforms.
|
72
55
|
add_build :osx_app do
|
73
56
|
url "com.github.my_application"
|
74
|
-
wrapper "
|
57
|
+
wrapper "wrappers/gosu-mac-wrapper-0.7.41.tar.gz" # Assuming this is where you downloaded this file.
|
75
58
|
icon "media/icon.icns"
|
76
59
|
add_package :tar_gz
|
77
60
|
end
|
78
61
|
|
79
62
|
add_build :source do
|
80
|
-
add_package :
|
63
|
+
add_package :"7z"
|
81
64
|
end
|
82
65
|
|
83
66
|
add_build :windows_folder do
|
@@ -93,6 +76,12 @@ Example
|
|
93
76
|
add_package :zip
|
94
77
|
end
|
95
78
|
|
79
|
+
add_build :windows_wrapped do
|
80
|
+
wrapper "wrappers/ruby-1.9.3-p0-i386-mingw32.7z" # Assuming this is where you downloaded this file.
|
81
|
+
exclude_tcl_tk
|
82
|
+
add_package :zip
|
83
|
+
end
|
84
|
+
|
96
85
|
add_deploy :github # Upload to a github project.
|
97
86
|
end
|
98
87
|
#>>>
|
@@ -102,6 +91,8 @@ Example
|
|
102
91
|
Note: The `windows:folder`, `windows:installer` and `windows:standalone` will be created only if running on Windows.
|
103
92
|
The `windows:wrapped` task will not be created if running on Windows.
|
104
93
|
|
94
|
+
The output from "rake -T" on Windows would be:
|
95
|
+
|
105
96
|
rake build # Build My Application 1.4.0
|
106
97
|
rake build:osx # Build all osx
|
107
98
|
rake build:osx:app # Build OS X app
|
@@ -111,19 +102,99 @@ The `windows:wrapped` task will not be created if running on Windows.
|
|
111
102
|
rake build:windows:installer # Build windows installer
|
112
103
|
rake deploy # Deploy My Application 1.4.0
|
113
104
|
rake deploy:osx:app:tar_gz:github # github <= osx app .tar.gz
|
114
|
-
rake deploy:source:
|
105
|
+
rake deploy:source:7z:github # github <= source .7z
|
115
106
|
rake deploy:windows:folder:exe:github # github <= windows folder .exe
|
116
|
-
rake deploy:windows:installer:
|
107
|
+
rake deploy:windows:installer:zip:github # github <= windows installer .zip
|
117
108
|
rake generate:images # Generate images
|
118
109
|
rake package # Package My Application 1.4.0
|
119
110
|
rake package:osx:app:tar_gz # Package osx app .tar.gz
|
120
|
-
rake package:source:
|
111
|
+
rake package:source:7z # Package source .7z
|
121
112
|
rake package:windows:folder:exe # Package windows folder .exe
|
122
113
|
rake package:windows:installer:zip # Package windows installer .zip
|
123
114
|
|
124
115
|
A variety of unlisted tasks are also created, that allow for more control, such as `deploy:github` (Deploy all packages to Github only),
|
125
116
|
`deploy:windows:folder` (deploy all windows folder packages all destinations) or `package:windows` (Package all windows builds).
|
126
117
|
|
118
|
+
|
119
|
+
Build types supported
|
120
|
+
----------------------
|
121
|
+
|
122
|
+
The project can build one or more release folders:
|
123
|
+
|
124
|
+
* `:source`
|
125
|
+
- Plain source folder, which can be used by anyone with Ruby already installed.
|
126
|
+
- See {Releasy::Builders::Source}
|
127
|
+
* `:osx_app`
|
128
|
+
- OS X application bundle (.app) build, requiring a pre-made Ruby OS X wrapper. Note that this only contains binary gems for Gosu, TexPlay and Chipmunk, but will work with applications using any other source gems.
|
129
|
+
- See {Releasy::Builders::OsxApp}
|
130
|
+
* `:windows_folder`
|
131
|
+
- A folder containing Ruby, application source files and an EXE to run them.
|
132
|
+
- Available on _Windows only_.
|
133
|
+
- See {Releasy::Builders::WindowsFolder}
|
134
|
+
* `:windows_wrapped`
|
135
|
+
- A folder containing Ruby, application source files and an EXE to run them, requiring a copy of a RubyInstaller archive.
|
136
|
+
- Available on _OS X and Linux only_.
|
137
|
+
- Creates larger release than other Windows build options.
|
138
|
+
- See {Releasy::Builders::WindowsWrapped}
|
139
|
+
* `:windows_installer`
|
140
|
+
- A Windows installer.
|
141
|
+
- Available on _Windows only and requires [InnoSetup](http://www.jrsoftware.org/isinfo.php) to be installed_.
|
142
|
+
- See {Releasy::Builders::WindowsInstaller}
|
143
|
+
* `:windows_standalone`
|
144
|
+
- Standalone EXE file that self-extracts to a temporary directory, which is the default behaviour for [Ocra](https://github.com/larsch/ocra).
|
145
|
+
- Available on _Windows only_.
|
146
|
+
- Slower startup than the other Windows build options (up to 2s slower).
|
147
|
+
- See {Releasy::Builders::WindowsStandalone}
|
148
|
+
|
149
|
+
See {Releasy::Project#add_build}
|
150
|
+
|
151
|
+
|
152
|
+
Package types supported
|
153
|
+
-----------------------
|
154
|
+
|
155
|
+
Optionally, release folders can be packaged into an archive using one or more of:
|
156
|
+
|
157
|
+
* `:"7z"`
|
158
|
+
- 7Zip format (.7z - Best compression).
|
159
|
+
- See {Releasy::Packagers::SevenZip}
|
160
|
+
* `:dmg`
|
161
|
+
- OS X self-extractor (.dmg - requires `hdiutil` to be installed, so only available on OS X).
|
162
|
+
- Available on OS X only (`hdiutils` command required).
|
163
|
+
- See {Releasy::Packagers::Dmg}
|
164
|
+
* `:exe`
|
165
|
+
- Windows self-extractor (.exe - Includes a 7z decompression module, so not efficient for small releases).
|
166
|
+
- See {Releasy::Packagers::Exe}
|
167
|
+
* `:tar_bz2`
|
168
|
+
- Bzip2 tarball (.tar.bz2).
|
169
|
+
- See {Releasy::Packagers::TarBzip2}
|
170
|
+
* `:tar_gz`
|
171
|
+
- Gzip tarball (.tar.gz).
|
172
|
+
- See {Releasy::Packagers::TarGzip}
|
173
|
+
* `:zip`
|
174
|
+
- Standard zip format (.zip - Poor compression, but best compatibility).
|
175
|
+
- See {Releasy::Packagers::Zip}
|
176
|
+
|
177
|
+
See {Releasy::Mixins::HasPackagers#add_package}
|
178
|
+
|
179
|
+
|
180
|
+
Deploy types supported
|
181
|
+
----------------------
|
182
|
+
|
183
|
+
Optionally, packaged releases can be deployed using one or more of:
|
184
|
+
|
185
|
+
* `:github`
|
186
|
+
- Upload to a Github project's downloads page.
|
187
|
+
- See {Releasy::Deployers::Github}
|
188
|
+
* `:local`
|
189
|
+
- Copy files locally, for example into a local web server or dropbox folder.
|
190
|
+
- See {Releasy::Deployers::Local}
|
191
|
+
* `:rsync`
|
192
|
+
- Upload to remote server with rsync (requires 'rsync' command be installed).
|
193
|
+
- See {Releasy::Deployers::Rsync}
|
194
|
+
|
195
|
+
See {Releasy::Project#add_deploy}
|
196
|
+
|
197
|
+
|
127
198
|
CLI Commands
|
128
199
|
------------
|
129
200
|
|
@@ -135,7 +206,7 @@ Releasy also provides some supplementary commands:
|
|
135
206
|
External Requirements
|
136
207
|
---------------------
|
137
208
|
|
138
|
-
### 7-Zip
|
209
|
+
### 7-Zip (OS X/Linux only - Windows `7za` executable included in Windows)
|
139
210
|
|
140
211
|
The [7z](http://www.7-zip.org) command must be installed on your system for Releasy to work:
|
141
212
|
|
@@ -147,9 +218,9 @@ The [7z](http://www.7-zip.org) command must be installed on your system for Rele
|
|
147
218
|
|
148
219
|
<pre>sudo apt-get install p7zip-full</pre>
|
149
220
|
|
150
|
-
- Installing on
|
221
|
+
- Installing on other OS
|
151
222
|
|
152
|
-
* [Download 7-Zip](http://www.7-zip.org/download.html)
|
223
|
+
* [Download 7-Zip](http://www.7-zip.org/download.html)
|
153
224
|
|
154
225
|
### To build `:windows_installer` release (Windows only)
|
155
226
|
|
@@ -163,6 +234,8 @@ The [7z](http://www.7-zip.org) command must be installed on your system for Rele
|
|
163
234
|
|
164
235
|
[libgosu app wrapper](http://www.libgosu.org/downloads/). Latest version of the OS X-compatible wrapper is "gosu-mac-wrapper-0.7.41.tar.gz" which uses Ruby 1.9.2 and includes some binary gems: Gosu, Chipmunk and TexPlay.
|
165
236
|
|
237
|
+
Warning: "gosu-mac-0.7.41.tar.gz" is NOT the complete OS X app wrapper, but rather just the Gosu gem pre-compiled for OS X!
|
238
|
+
|
166
239
|
Credits
|
167
240
|
-------
|
168
241
|
|
@@ -175,5 +248,5 @@ Credits
|
|
175
248
|
Third Party Assets included
|
176
249
|
---------------------------
|
177
250
|
|
178
|
-
* bin/7z.sfx - Windows [
|
179
|
-
|
251
|
+
* bin/7z.sfx - Windows [7-ZIP](http://www.7-zip.org) self-extractor module, which can be installed using `releasy install-sfx` [License: [GNU LGPL](http://www.7-zip.org/license.txt)]
|
252
|
+
* bin/7za.exe - Windows [7-ZIP](http://www.7-zip.org) CLI executable.
|
data/Rakefile
CHANGED
@@ -0,0 +1,56 @@
|
|
1
|
+
7-Zip
|
2
|
+
~~~~~
|
3
|
+
License for use and distribution
|
4
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
5
|
+
|
6
|
+
7-Zip Copyright (C) 1999-2010 Igor Pavlov.
|
7
|
+
|
8
|
+
Licenses for files are:
|
9
|
+
|
10
|
+
1) 7z.dll: GNU LGPL + unRAR restriction
|
11
|
+
2) All other files: GNU LGPL
|
12
|
+
|
13
|
+
The GNU LGPL + unRAR restriction means that you must follow both
|
14
|
+
GNU LGPL rules and unRAR restriction rules.
|
15
|
+
|
16
|
+
|
17
|
+
Note:
|
18
|
+
You can use 7-Zip on any computer, including a computer in a commercial
|
19
|
+
organization. You don't need to register or pay for 7-Zip.
|
20
|
+
|
21
|
+
|
22
|
+
GNU LGPL information
|
23
|
+
--------------------
|
24
|
+
|
25
|
+
This library is free software; you can redistribute it and/or
|
26
|
+
modify it under the terms of the GNU Lesser General Public
|
27
|
+
License as published by the Free Software Foundation; either
|
28
|
+
version 2.1 of the License, or (at your option) any later version.
|
29
|
+
|
30
|
+
This library is distributed in the hope that it will be useful,
|
31
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
32
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
33
|
+
Lesser General Public License for more details.
|
34
|
+
|
35
|
+
You can receive a copy of the GNU Lesser General Public License from
|
36
|
+
http://www.gnu.org/
|
37
|
+
|
38
|
+
|
39
|
+
unRAR restriction
|
40
|
+
-----------------
|
41
|
+
|
42
|
+
The decompression engine for RAR archives was developed using source
|
43
|
+
code of unRAR program.
|
44
|
+
All copyrights to original unRAR code are owned by Alexander Roshal.
|
45
|
+
|
46
|
+
The license for original unRAR code has the following restriction:
|
47
|
+
|
48
|
+
The unRAR sources cannot be used to re-create the RAR compression algorithm,
|
49
|
+
which is proprietary. Distribution of modified unRAR sources in separate form
|
50
|
+
or as a part of other software is permitted, provided that it is clearly
|
51
|
+
stated in the documentation and source comments that the code may
|
52
|
+
not be used to develop a RAR (WinRAR) compatible archiver.
|
53
|
+
|
54
|
+
|
55
|
+
--
|
56
|
+
Igor Pavlov
|
data/bin/7za.exe
ADDED
Binary file
|
@@ -0,0 +1,29 @@
|
|
1
|
+
7-Zip Command line version
|
2
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
3
|
+
License for use and distribution
|
4
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
5
|
+
|
6
|
+
7-Zip Copyright (C) 1999-2010 Igor Pavlov.
|
7
|
+
|
8
|
+
7za.exe is distributed under the GNU LGPL license
|
9
|
+
|
10
|
+
Notes:
|
11
|
+
You can use 7-Zip on any computer, including a computer in a commercial
|
12
|
+
organization. You don't need to register or pay for 7-Zip.
|
13
|
+
|
14
|
+
|
15
|
+
GNU LGPL information
|
16
|
+
--------------------
|
17
|
+
|
18
|
+
This library is free software; you can redistribute it and/or
|
19
|
+
modify it under the terms of the GNU Lesser General Public
|
20
|
+
License as published by the Free Software Foundation; either
|
21
|
+
version 2.1 of the License, or (at your option) any later version.
|
22
|
+
|
23
|
+
This library is distributed in the hope that it will be useful,
|
24
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
25
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
26
|
+
Lesser General Public License for more details.
|
27
|
+
|
28
|
+
You can receive a copy of the GNU Lesser General Public License from
|
29
|
+
http://www.gnu.org/
|
data/lib/releasy.rb
CHANGED
@@ -4,11 +4,14 @@ $LOAD_PATH.unshift File.expand_path("..", __FILE__)
|
|
4
4
|
|
5
5
|
# Application release manager.
|
6
6
|
module Releasy
|
7
|
-
def self.win_platform?; RUBY_PLATFORM =~ /mingw|win32
|
7
|
+
def self.win_platform?; !!(RUBY_PLATFORM =~ /mingw|win32/); end
|
8
8
|
|
9
9
|
# An error caused when Releasy configuration is incorrect or inconsistent.
|
10
10
|
class ConfigError < StandardError; end
|
11
11
|
|
12
|
+
# Failed to find a particular CLI command on the system.
|
13
|
+
class CommandNotFoundError < StandardError; end
|
14
|
+
|
12
15
|
# Modules used to extend Releasy classes.
|
13
16
|
module Mixins; end
|
14
17
|
end
|
@@ -1,21 +1,29 @@
|
|
1
1
|
require "releasy/mixins/has_packagers"
|
2
|
-
require "releasy/mixins/
|
2
|
+
require "releasy/mixins/utilities"
|
3
3
|
require "releasy/mixins/log"
|
4
4
|
|
5
5
|
module Releasy
|
6
6
|
module Builders
|
7
7
|
# Builds release folders.
|
8
8
|
# @abstract
|
9
|
+
#
|
10
|
+
# @attr suffix [String] Suffix on the folder generated, after name and version.
|
9
11
|
class Builder
|
10
12
|
include Rake::DSL
|
11
13
|
include Mixins::HasPackagers
|
12
|
-
include Mixins::
|
14
|
+
include Mixins::Utilities
|
13
15
|
include Mixins::Log
|
14
16
|
|
15
17
|
# @return [Project] that this Builder belongs to.
|
16
18
|
attr_reader :project
|
17
|
-
|
18
|
-
|
19
|
+
|
20
|
+
attr_reader :suffix
|
21
|
+
def suffix=(suffix)
|
22
|
+
raise TypeError, "suffix must be a String" unless suffix.is_a? String
|
23
|
+
@suffix = suffix
|
24
|
+
end
|
25
|
+
alias_method :folder_suffix, :suffix
|
26
|
+
alias_method :folder_suffix=, :suffix=
|
19
27
|
|
20
28
|
# @return [Symbol] Type of builder.
|
21
29
|
def type; self.class::TYPE; end
|
@@ -26,7 +34,7 @@ module Builders
|
|
26
34
|
def initialize(project)
|
27
35
|
super()
|
28
36
|
@project = project
|
29
|
-
@
|
37
|
+
@suffix = self.class::DEFAULT_FOLDER_SUFFIX
|
30
38
|
setup
|
31
39
|
end
|
32
40
|
|
@@ -34,7 +42,7 @@ module Builders
|
|
34
42
|
# @return [String] Called from the project, but users don't need to know about it.
|
35
43
|
def task_group; type.to_s.split(/_/).first; end
|
36
44
|
# @return [String] Output folder.
|
37
|
-
def folder; "#{project.folder_base}#{
|
45
|
+
def folder; "#{project.folder_base}#{suffix.empty? ? '' : '_'}#{suffix}"; end
|
38
46
|
|
39
47
|
protected
|
40
48
|
# Called by {#initalize}
|
@@ -2,14 +2,16 @@ require "releasy/builders/windows_builder"
|
|
2
2
|
|
3
3
|
module Releasy
|
4
4
|
module Builders
|
5
|
-
# Functionality for a {WindowsBuilder} that use Ocra
|
5
|
+
# Functionality for a {WindowsBuilder} that use Ocra to build on Windows.
|
6
|
+
#
|
6
7
|
# @attr icon [String] Optional filename of icon to show on executable/installer (.ico).
|
8
|
+
#
|
7
9
|
# @abstract
|
8
10
|
class OcraBuilder < WindowsBuilder
|
9
11
|
OCRA_COMMAND = "ocra"
|
10
12
|
ICON_EXTENSION = ".ico"
|
11
13
|
|
12
|
-
# @return [String] Extra options to send to Ocra
|
14
|
+
# @return [String] Extra options to send to Ocra, but they are unlikely to be needed explicitly. '_--no-enc_' is automatically used if {#exclude_encoding} is called and '_--console_' or '_--window_' is used based on {#executable_type}
|
13
15
|
attr_accessor :ocra_parameters
|
14
16
|
|
15
17
|
def valid_for_platform?; Releasy.win_platform?; end
|