releasy 0.2.0rc1 → 0.2.0rc2
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.
- data/CHANGELOG.md +1 -1
- data/README.md +79 -65
- data/Rakefile +1 -1
- data/lib/releasy/builders.rb +1 -1
- data/lib/releasy/builders/builder.rb +6 -4
- data/lib/releasy/builders/osx_app.rb +49 -27
- data/lib/releasy/builders/source.rb +1 -3
- data/lib/releasy/builders/windows_builder.rb +3 -10
- data/lib/releasy/builders/windows_folder.rb +4 -6
- data/lib/releasy/builders/windows_installer.rb +3 -5
- data/lib/releasy/builders/windows_standalone.rb +1 -3
- data/lib/releasy/builders/{windows_folder_from_ruby_dist.rb → windows_wrapped.rb} +24 -22
- data/lib/releasy/cli/install_sfx.rb +3 -3
- data/lib/releasy/deployers.rb +12 -0
- data/lib/releasy/deployers/deployer.rb +28 -0
- data/lib/releasy/deployers/github.rb +109 -0
- data/lib/releasy/mixins/can_exclude_encoding.rb +22 -0
- data/lib/releasy/mixins/exec.rb +2 -2
- data/lib/releasy/mixins/has_gemspecs.rb +6 -6
- data/lib/releasy/mixins/has_packagers.rb +37 -0
- data/lib/releasy/mixins/log.rb +39 -0
- data/lib/releasy/mixins/register.rb +0 -1
- data/lib/releasy/packagers.rb +12 -0
- data/lib/releasy/{archivers → packagers}/dmg.rb +4 -4
- data/lib/releasy/{archivers → packagers}/exe.rb +4 -4
- data/lib/releasy/{archivers/archiver.rb → packagers/packager.rb} +20 -11
- data/lib/releasy/packagers/seven_zip.rb +12 -0
- data/lib/releasy/{archivers → packagers}/tar_bzip2.rb +4 -4
- data/lib/releasy/{archivers → packagers}/tar_gzip.rb +4 -4
- data/lib/releasy/{archivers/tar_archiver.rb → packagers/tar_packager.rb} +4 -4
- data/lib/releasy/{archivers → packagers}/zip.rb +4 -4
- data/lib/releasy/project.rb +105 -46
- data/lib/releasy/version.rb +1 -1
- data/lib/releasy/windows_wrapper_maker.rb +0 -3
- data/releasy.gemspec +1 -0
- data/test/releasy/builders/helpers/helper.rb +0 -1
- data/test/releasy/builders/osx_app_test.rb +18 -8
- data/test/releasy/builders/{windows_folder_from_ruby_dist_test.rb → windows_wrapped_test.rb} +16 -14
- data/test/releasy/deployers/github_test.rb +133 -0
- data/test/releasy/deployers/helpers/helper.rb +19 -0
- data/test/releasy/integration/source_test.rb +25 -6
- data/test/releasy/mixins/log_test.rb +15 -0
- data/test/releasy/mixins/register_test.rb +0 -1
- data/test/releasy/{archivers_test.rb → packagers_test.rb} +16 -19
- data/test/releasy/project_test.rb +33 -29
- data/test/teststrap.rb +3 -1
- data/test/yard_test.rb +1 -1
- metadata +55 -34
- data/lib/releasy/archivers.rb +0 -12
- data/lib/releasy/archivers/seven_zip.rb +0 -12
- data/lib/releasy/mixins/has_archivers.rb +0 -37
data/CHANGELOG.md
CHANGED
@@ -10,7 +10,7 @@ v0.2.0
|
|
10
10
|
* Included gems in osx-app more safely, so that no files will be missing.
|
11
11
|
* Added `:exe` archive format (Windows self-extractor, used on any OS).
|
12
12
|
* Added `:dmg` archive format (OS X self-extractor, used on OS X only).
|
13
|
-
* Added `:
|
13
|
+
* Added `:windows_wrapped` output (windows folder made from a RubyInstaller archive, used on OSX/Linux).
|
14
14
|
* Allowed project and outputs to have archive formats (when called on Project, affecting all outputs).
|
15
15
|
* Archive formats can have a different `#extension` set.
|
16
16
|
* Output formats can have a different `#folder_suffix` set.
|
data/README.md
CHANGED
@@ -3,120 +3,126 @@ Releasy
|
|
3
3
|
|
4
4
|
_Releasy_ automates the release of Ruby applications (name comes from "Release + easy").
|
5
5
|
By configuring a {Releasy::Project} in your application's rakefile, Releasy can generates a number of Rake tasks for use
|
6
|
-
when there is a need to
|
6
|
+
when there is a need to build, archive and/or deploy a new version of the application.
|
7
7
|
|
8
|
-
Releasy allows cross-platform releases, relying on
|
9
|
-
(Releasy is able to make the latter type of wrapper itself).
|
8
|
+
Releasy allows cross-platform releases, relying on OS X or Windows "wrappers" to act as templates.
|
10
9
|
|
11
10
|
* Author: [Bil Bas (Spooner)](https://github.com/Spooner)
|
12
11
|
* Licence: [MIT](http://www.opensource.org/licenses/mit-license.php)
|
13
12
|
* [Github project](https://github.com/Spooner/releasy)
|
14
13
|
* [Reporting issues](https://github.com/Spooner/releasy/issues)
|
15
|
-
*
|
16
|
-
- _Windows:_ [RubyInstaller 7-ZIP archives](http://rubyinstaller.org/downloads/); Ruby 1.8.7, 1.9.2 or 1.9.3
|
17
|
-
- _OS X:_ [libgosu downloads](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.
|
18
|
-
* 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!
|
14
|
+
* Relapse 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!
|
19
15
|
|
20
|
-
|
16
|
+
Build types supported
|
21
17
|
----------------------
|
22
18
|
|
23
|
-
The project can
|
19
|
+
The project can build one or more release folders:
|
24
20
|
|
25
21
|
* `:source` - Plain source folder, which can be used by anyone with Ruby already installed.
|
26
|
-
* `:osx_app` - OS X application bundle (.app) build, requiring a pre-made Ruby OS X wrapper
|
27
|
-
* `:windows_folder` - A folder containing Ruby, application source files and an EXE to run them [creation on Windows only]
|
28
|
-
* `:
|
29
|
-
* `:windows_installer` - A regular Windows installer [creation on Windows only and requires InnoSetup to be installed]
|
30
|
-
* `:windows_standalone` - Standalone EXE file that self-extracts to a temporary directory - slower startup than the other Windows options [creation on Windows only]
|
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].
|
31
27
|
|
32
|
-
|
28
|
+
Package types supported
|
33
29
|
-----------------------
|
34
30
|
|
35
|
-
Optionally, release folders can be
|
31
|
+
Optionally, release folders can be packaged into an archive using one or more of:
|
36
32
|
|
37
|
-
* `:dmg` - OS X self-extractor (.dmg - requires `hdiutil` to be installed, so only available on OS X)
|
38
|
-
* `:exe` - Windows self-extractor (.exe - Includes a 7z decompression module, so not efficient for small releases)
|
39
|
-
* `:"7z"` - 7Zip format (.7z - Best compression)
|
40
|
-
* `:tar_bz2` - BZip2 tarball (.tar.bz2)
|
41
|
-
* `:tar_gz` - GZip tarball (.tar.gz)
|
42
|
-
* `:zip` - Standard zip format (.zip - Poor compression, but best compatibility)
|
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
|
+
|
40
|
+
Deploy types supported
|
41
|
+
----------------------
|
42
|
+
|
43
|
+
Optionally, packaged releases can be deployed using one or more of:
|
44
|
+
|
45
|
+
* `:github` - Upload to Github downloads.
|
46
|
+
* Others, such as `:dropbox`, when I get around to implementing them.
|
43
47
|
|
44
48
|
Example
|
45
49
|
-------
|
46
50
|
|
47
51
|
### Project's Rakefile
|
48
52
|
|
49
|
-
# Example is from my game, Alpha Channel.
|
50
53
|
require 'rubygems'
|
51
54
|
require 'bundler/setup' # Releasy doesn't require that your application uses bundler, but it does make things easier.
|
52
55
|
require 'releasy'
|
53
|
-
require 'lib/
|
56
|
+
require 'lib/my_application/version'
|
54
57
|
|
55
58
|
#<<<
|
56
59
|
Releasy::Project.new do
|
57
|
-
name "
|
58
|
-
version
|
60
|
+
name "My Application"
|
61
|
+
version MyApplication::VERSION
|
59
62
|
|
60
|
-
executable "bin/
|
63
|
+
executable "bin/my_application.rbw"
|
61
64
|
files `git ls-files`.split("\n")
|
62
65
|
files.exclude '.gitignore'
|
63
66
|
|
64
67
|
exposed_files ["README.html", "LICENSE.txt"]
|
65
|
-
add_link "http://
|
68
|
+
add_link "http://my_application.github.com", "My Application website"
|
69
|
+
exclude_encoding
|
66
70
|
|
67
71
|
# Create a variety of releases, for all platforms.
|
68
72
|
add_build :osx_app do
|
69
|
-
|
70
|
-
url "com.github.spooner.games.alpha_channel"
|
73
|
+
url "com.github.my_application"
|
71
74
|
wrapper "../osx_app/gosu-mac-wrapper-0.7.41.tar.gz"
|
72
75
|
icon "media/icon.icns"
|
76
|
+
add_package :tar_gz
|
73
77
|
end
|
74
78
|
|
75
|
-
add_build :source
|
79
|
+
add_build :source do
|
80
|
+
add_package :zip
|
81
|
+
end
|
76
82
|
|
77
83
|
add_build :windows_folder do
|
78
84
|
icon "media/icon.ico"
|
79
|
-
|
80
|
-
exclude_encoding
|
85
|
+
add_package :exe
|
81
86
|
end
|
82
87
|
|
83
88
|
add_build :windows_installer do
|
84
89
|
icon "media/icon.ico"
|
85
|
-
exclude_encoding
|
86
90
|
start_menu_group "Spooner Games"
|
87
91
|
readme "README.html" # User asked if they want to view readme after install.
|
88
92
|
license "LICENSE.txt" # User asked to read this and confirm before installing.
|
93
|
+
add_package :zip
|
89
94
|
end
|
90
95
|
|
91
|
-
|
96
|
+
add_deploy :github # Upload to a github project.
|
92
97
|
end
|
93
98
|
#>>>
|
94
99
|
|
95
100
|
### Tasks created
|
96
101
|
|
97
102
|
Note: The `windows:folder`, `windows:installer` and `windows:standalone` will be created only if running on Windows.
|
98
|
-
The `windows:
|
99
|
-
|
100
|
-
rake build
|
101
|
-
rake build:osx
|
102
|
-
rake build:osx:app
|
103
|
-
rake build:source
|
104
|
-
rake build:windows
|
105
|
-
rake build:windows:folder
|
106
|
-
rake build:windows:installer
|
107
|
-
rake
|
108
|
-
rake
|
109
|
-
rake
|
110
|
-
rake
|
111
|
-
rake
|
112
|
-
rake
|
113
|
-
rake package
|
114
|
-
rake package:
|
115
|
-
rake package:
|
116
|
-
rake package:windows:folder:exe
|
117
|
-
rake package:windows:
|
118
|
-
|
119
|
-
|
103
|
+
The `windows:wrapped` task will not be created if running on Windows.
|
104
|
+
|
105
|
+
rake build # Build My Application 1.4.0
|
106
|
+
rake build:osx # Build all osx
|
107
|
+
rake build:osx:app # Build OS X app
|
108
|
+
rake build:source # Build source
|
109
|
+
rake build:windows # Build all windows
|
110
|
+
rake build:windows:folder # Build windows folder
|
111
|
+
rake build:windows:installer # Build windows installer
|
112
|
+
rake deploy # Deploy My Application 1.4.0
|
113
|
+
rake deploy:osx:app:tar_gz:github # github <= osx app .tar.gz
|
114
|
+
rake deploy:source:zip:github # github <= source .zip
|
115
|
+
rake deploy:windows:folder:exe:github # github <= windows folder .exe
|
116
|
+
rake deploy:windows:installer:exe:github # github <= windows installer .zip
|
117
|
+
rake generate:images # Generate images
|
118
|
+
rake package # Package My Application 1.4.0
|
119
|
+
rake package:osx:app:tar_gz # Package osx app .tar.gz
|
120
|
+
rake package:source:zip # Package source .zip
|
121
|
+
rake package:windows:folder:exe # Package windows folder .exe
|
122
|
+
rake package:windows:installer:zip # Package windows installer .zip
|
123
|
+
|
124
|
+
A variety of unlisted tasks are also created, that allow for more control, such as `deploy:github` (Deploy all packages to Github only),
|
125
|
+
`deploy:windows:folder` (deploy all windows folder packages all destinations) or `package:windows` (Package all windows builds).
|
120
126
|
|
121
127
|
CLI Commands
|
122
128
|
------------
|
@@ -126,12 +132,12 @@ Releasy also provides some supplementary commands:
|
|
126
132
|
* `releasy install-sfx [options]` - Installs a copy of the Windows self-extractor in the local 7z installation, to allow use of the `:exe` archive format (it comes with the Windows version of 7z, so only need to use this command on OS X/Linux).
|
127
133
|
|
128
134
|
|
129
|
-
External Requirements
|
130
|
-
|
135
|
+
External Requirements
|
136
|
+
---------------------
|
131
137
|
|
132
|
-
###
|
138
|
+
### 7-Zip
|
133
139
|
|
134
|
-
[7z](http://www.7-zip.org) must be installed
|
140
|
+
The [7z](http://www.7-zip.org) command must be installed on your system for Releasy to work:
|
135
141
|
|
136
142
|
- Installing on OS X homebrew:
|
137
143
|
|
@@ -143,11 +149,19 @@ External Requirements (Optional, but recommended)
|
|
143
149
|
|
144
150
|
- Installing on Windows (or other OS)
|
145
151
|
|
146
|
-
* [Download](http://www.7-zip.org/download.html)
|
152
|
+
* [Download 7-Zip](http://www.7-zip.org/download.html) - Either the full version or the command line version will work with Releasy.
|
153
|
+
|
154
|
+
### To build `:windows_installer` release (Windows only)
|
155
|
+
|
156
|
+
[InnoSetup](http://www.jrsoftware.org/isdl.php) is used to create an installer for the application.
|
157
|
+
|
158
|
+
### To build `:windows_wrapped` release (OS X/Linux)
|
159
|
+
|
160
|
+
[RubyInstaller 7-ZIP archives](http://rubyinstaller.org/downloads/) for Ruby 1.8.7, 1.9.2 or 1.9.3. Used as a wrapper for a Windows release built on non-Windows systems.
|
147
161
|
|
148
|
-
### To
|
162
|
+
### To build `:osx_app` application bundle release (any platform)
|
149
163
|
|
150
|
-
[
|
164
|
+
[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.
|
151
165
|
|
152
166
|
Credits
|
153
167
|
-------
|
@@ -161,5 +175,5 @@ Credits
|
|
161
175
|
Third Party Assets included
|
162
176
|
---------------------------
|
163
177
|
|
164
|
-
* bin/7z.sfx - Windows [7z 9.20](http://www.7-zip.org) self-extractor module [License: [GNU LGPL](http://www.7-zip.org/license.txt)]
|
178
|
+
* bin/7z.sfx - Windows [7z 9.20](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)]
|
165
179
|
|
data/Rakefile
CHANGED
data/lib/releasy/builders.rb
CHANGED
@@ -7,6 +7,6 @@ module Releasy
|
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
|
-
%w[osx_app source windows_folder
|
10
|
+
%w[osx_app source windows_folder windows_wrapped windows_installer windows_standalone].each do |builder|
|
11
11
|
require "releasy/builders/#{builder}"
|
12
12
|
end
|
@@ -1,5 +1,6 @@
|
|
1
|
-
require "releasy/mixins/
|
1
|
+
require "releasy/mixins/has_packagers"
|
2
2
|
require "releasy/mixins/exec"
|
3
|
+
require "releasy/mixins/log"
|
3
4
|
|
4
5
|
module Releasy
|
5
6
|
module Builders
|
@@ -7,8 +8,9 @@ module Builders
|
|
7
8
|
# @abstract
|
8
9
|
class Builder
|
9
10
|
include Rake::DSL
|
10
|
-
include Mixins::
|
11
|
+
include Mixins::HasPackagers
|
11
12
|
include Mixins::Exec
|
13
|
+
include Mixins::Log
|
12
14
|
|
13
15
|
# @return [Project] that this Builder belongs to.
|
14
16
|
attr_reader :project
|
@@ -43,8 +45,8 @@ module Builders
|
|
43
45
|
def copy_files_relative(files, folder)
|
44
46
|
files.each do |file|
|
45
47
|
destination = File.join(folder, File.dirname(file))
|
46
|
-
mkdir_p destination unless File.exists? destination
|
47
|
-
cp file, destination
|
48
|
+
mkdir_p destination, fileutils_options unless File.exists? destination
|
49
|
+
cp file, destination, fileutils_options
|
48
50
|
end
|
49
51
|
end
|
50
52
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require "releasy/builders/builder"
|
2
2
|
require "releasy/mixins/has_gemspecs"
|
3
|
+
require "releasy/mixins/can_exclude_encoding"
|
3
4
|
|
4
5
|
module Releasy
|
5
6
|
module Builders
|
@@ -8,6 +9,7 @@ module Releasy
|
|
8
9
|
# @attr icon [String] Optional filename of icon to show on executable/installer (.icns).
|
9
10
|
class OsxApp < Builder
|
10
11
|
include Mixins::HasGemspecs
|
12
|
+
include Mixins::CanExcludeEncoding
|
11
13
|
|
12
14
|
TYPE = :osx_app
|
13
15
|
|
@@ -20,6 +22,11 @@ module Releasy
|
|
20
22
|
# Source gems included in app that we should remove.
|
21
23
|
SOURCE_GEMS_TO_REMOVE = %w[chingu]
|
22
24
|
|
25
|
+
# Encoding files that are required, even if we don't need most of them if we select to {#exclude_encoding}.
|
26
|
+
REQUIRED_ENCODING_FILES = %w[encdb.bundle iso_8859_1.bundle utf_16le.bundle trans/single_byte.bundle trans/transdb.bundle trans/utf_16_32.bundle]
|
27
|
+
|
28
|
+
VALID_GOSU_WRAPPER = /gosu-mac-wrapper-\d\.\d\.\d+.tar.gz/
|
29
|
+
|
23
30
|
Builders.register self
|
24
31
|
|
25
32
|
# @return [String] Name of .app directory used as the framework for osx app release.
|
@@ -31,17 +38,16 @@ module Releasy
|
|
31
38
|
attr_reader :icon
|
32
39
|
|
33
40
|
def icon=(icon)
|
34
|
-
raise
|
41
|
+
raise ArgumentError, "icon must be a #{ICON_EXTENSION} file" unless File.extname(icon) == ICON_EXTENSION
|
35
42
|
@icon = icon
|
36
43
|
end
|
37
44
|
|
38
45
|
protected
|
39
46
|
def generate_tasks
|
40
47
|
raise ConfigError, "#url not set" unless url
|
48
|
+
raise ConfigError, "#url not valid: #{url}" unless url =~ /\w+(\.\w+)*/i
|
41
49
|
raise ConfigError, "#wrapper not set" unless wrapper
|
42
|
-
raise ConfigError, "#wrapper not valid wrapper: #{wrapper}" unless File.basename(wrapper) =~
|
43
|
-
|
44
|
-
new_app = File.join folder, app_name
|
50
|
+
raise ConfigError, "#wrapper not valid wrapper: #{wrapper}" unless File.basename(wrapper) =~ VALID_GOSU_WRAPPER
|
45
51
|
|
46
52
|
directory folder
|
47
53
|
|
@@ -49,26 +55,35 @@ module Releasy
|
|
49
55
|
task "build:osx:app" => folder
|
50
56
|
|
51
57
|
file folder => project.files + [wrapper] do
|
52
|
-
|
58
|
+
build
|
59
|
+
end
|
60
|
+
end
|
53
61
|
|
54
|
-
|
55
|
-
|
56
|
-
|
62
|
+
protected
|
63
|
+
def build
|
64
|
+
raise ConfigError, "#wrapper file does not exist: #{wrapper}" unless File.exists? wrapper
|
57
65
|
|
58
|
-
|
59
|
-
copy_files_relative project.files, File.join(new_app, 'Contents/Resources/application')
|
66
|
+
new_app = File.join folder, app_name
|
60
67
|
|
61
|
-
|
62
|
-
|
68
|
+
# Copy the app files.
|
69
|
+
exec %[7z x -so -bd "#{wrapper}" | 7z x -si -mmt -bd -ttar -o"#{folder}"]
|
70
|
+
mv File.join(folder, "RubyGosu App.app"), new_app, fileutils_options
|
63
71
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
+
## Copy my source files.
|
73
|
+
copy_files_relative project.files, File.join(new_app, 'Contents/Resources/application')
|
74
|
+
|
75
|
+
remove_encoding if encoding_excluded?
|
76
|
+
|
77
|
+
# Copy accompanying files.
|
78
|
+
project.exposed_files.each {|file| cp file, folder, fileutils_options }
|
79
|
+
|
80
|
+
copy_gems vendored_gem_names(BINARY_GEMS), File.join(new_app, 'Contents/Resources/vendor')
|
81
|
+
create_main new_app
|
82
|
+
edit_init new_app
|
83
|
+
remove_gems new_app
|
84
|
+
rename_executable new_app
|
85
|
+
update_icon new_app
|
86
|
+
create_executable_setter
|
72
87
|
end
|
73
88
|
|
74
89
|
protected
|
@@ -97,33 +112,40 @@ END
|
|
97
112
|
end
|
98
113
|
end
|
99
114
|
|
115
|
+
protected
|
116
|
+
def remove_encoding
|
117
|
+
encoding_files = Dir[File.join folder, "#{app_name}/Contents/Resources/lib/enc/**/*.bundle"]
|
118
|
+
required_encoding_files = REQUIRED_ENCODING_FILES.map {|f| File.join folder, "#{app_name}/Contents/Resources/lib/enc", f }
|
119
|
+
rm_r encoding_files - required_encoding_files, fileutils_options
|
120
|
+
end
|
121
|
+
|
100
122
|
protected
|
101
123
|
def rename_executable(app)
|
102
124
|
new_executable = "#{app}/Contents/MacOS/#{project.name}"
|
103
|
-
mv "#{app}/Contents/MacOS/RubyGosu App" , new_executable
|
104
|
-
chmod 0755, new_executable
|
125
|
+
mv "#{app}/Contents/MacOS/RubyGosu App" , new_executable, fileutils_options
|
126
|
+
chmod 0755, new_executable, fileutils_options
|
105
127
|
end
|
106
128
|
|
107
129
|
protected
|
108
130
|
# Remove unnecessary gems from the distribution.
|
109
131
|
def remove_gems(app)
|
110
132
|
SOURCE_GEMS_TO_REMOVE.each do |gem|
|
111
|
-
rm_r "#{app}/Contents/Resources/lib/#{gem}"
|
133
|
+
rm_r "#{app}/Contents/Resources/lib/#{gem}", fileutils_options
|
112
134
|
end
|
113
135
|
end
|
114
136
|
|
115
137
|
protected
|
116
138
|
def update_icon(app)
|
117
139
|
if icon
|
118
|
-
rm "#{app}/Contents/Resources/Gosu.icns"
|
119
|
-
cp icon, "#{app}/Contents/Resources"
|
140
|
+
rm "#{app}/Contents/Resources/Gosu.icns", fileutils_options
|
141
|
+
cp icon, "#{app}/Contents/Resources", fileutils_options
|
120
142
|
end
|
121
143
|
end
|
122
144
|
|
123
145
|
protected
|
124
146
|
def create_main(app)
|
125
147
|
# Something for the .app to run -> just a little redirection file.
|
126
|
-
|
148
|
+
info "Creating Main.rb"
|
127
149
|
File.open("#{app}/Contents/Resources/Main.rb", "w") do |file|
|
128
150
|
file.puts <<END_TEXT
|
129
151
|
Dir[File.expand_path("../vendor/gems/*/lib", __FILE__)].each do |lib|
|
@@ -146,7 +168,7 @@ END_TEXT
|
|
146
168
|
def edit_init(app)
|
147
169
|
file = "#{app}/Contents/Info.plist"
|
148
170
|
# Edit the info file to be specific for my game.
|
149
|
-
|
171
|
+
info "Editing init"
|
150
172
|
info = File.read(file)
|
151
173
|
info.sub!('<string>Gosu</string>', "<string>#{File.basename(icon).chomp(File.extname(icon))}</string>") if icon
|
152
174
|
info.sub!('<string>RubyGosu App</string>', "<string>#{project.name}</string>")
|
@@ -11,14 +11,12 @@ module Releasy
|
|
11
11
|
|
12
12
|
protected
|
13
13
|
def generate_tasks
|
14
|
-
desc "Build source
|
14
|
+
desc "Build source"
|
15
15
|
task "build:source" => folder
|
16
16
|
|
17
17
|
directory folder
|
18
18
|
|
19
19
|
file folder => project.files do
|
20
|
-
Rake::FileUtilsExt.verbose project.verbose?
|
21
|
-
|
22
20
|
copy_files_relative project.files, folder
|
23
21
|
end
|
24
22
|
end
|