RubyPackager 0.2.1.20101110 → 1.0.0.20120301
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/AUTHORS +1 -1
- data/ChangeLog +40 -1
- data/LICENSE +1 -1
- data/README +2 -5
- data/ReleaseInfo +2 -2
- data/bin/Release.rb +18 -18
- data/lib/RubyPackager/Distributors/RubyGems.rb +67 -0
- data/lib/RubyPackager/Distributors/SourceForge.rb +22 -75
- data/lib/RubyPackager/Installers/Gem.rb +34 -34
- data/lib/RubyPackager/ReleaseInfo.rb +87 -85
- data/lib/RubyPackager/Releaser.rb +91 -73
- data/lib/RubyPackager/Tools.rb +62 -33
- data/lib/RubyPackager/i386-cygwin/PlatformReleaser.rb +16 -15
- data/lib/RubyPackager/i386-linux/PlatformReleaser.rb +16 -15
- data/lib/RubyPackager/i386-mingw32/Installers/NSIS.rb +59 -0
- data/lib/RubyPackager/i386-mingw32/PlatformReleaser.rb +171 -0
- data/lib/RubyPackager/i386-mingw32/edicon/edicon.exe +0 -0
- data/lib/RubyPackager/i386-mswin32/Installers/NSIS.rb +12 -12
- data/lib/RubyPackager/i386-mswin32/PlatformReleaser.rb +34 -31
- metadata +42 -10
- data/TODO +0 -16
data/AUTHORS
CHANGED
data/ChangeLog
CHANGED
@@ -1,6 +1,45 @@
|
|
1
1
|
= RubyPackager Release History
|
2
2
|
|
3
|
-
== 0.
|
3
|
+
== 1.0.0.20120301 (Beta)
|
4
|
+
|
5
|
+
=== API changes
|
6
|
+
|
7
|
+
* Adapted to Ruby's standard conventions.
|
8
|
+
* Renamed public methods to match standard Ruby's conventions
|
9
|
+
* Added dependency on allinoneruby
|
10
|
+
* Added dependency on highline
|
11
|
+
* Added a way to specify password for normal SSH login or passphrases
|
12
|
+
|
13
|
+
=== New features
|
14
|
+
|
15
|
+
* Hide passwords entered using highline library.
|
16
|
+
* Removed --fileboxes deprecated option from RDoc
|
17
|
+
* Added --hyperlink-all option for RDoc
|
18
|
+
* Installer/RubyGems: Added RubyGems installer.
|
19
|
+
* Installer/SourceForge: Adapted to new SF.net FRS system (regression adapted).
|
20
|
+
* Installer/SourceForge: Do not ship release notes anymore
|
21
|
+
|
22
|
+
=== Misc
|
23
|
+
|
24
|
+
* Do not ask for exerb and edicon presence in the system if no binary packaging is needed.
|
25
|
+
* Removed rdoc warning in documentation
|
26
|
+
* Updated Copyright information
|
27
|
+
* Updated email address of Muriel Salvan
|
28
|
+
* Adapted comments to match a better RDoc syntax
|
29
|
+
* Adapted to new version of rUtilAnts >= 1.0
|
30
|
+
* Sanitized SSH interface
|
31
|
+
|
32
|
+
=== Regression
|
33
|
+
|
34
|
+
* Improved the way tests are written with system calls checking.
|
35
|
+
* Moved regression runs in temporary directories.
|
36
|
+
* Added a simple debug switch.
|
37
|
+
|
38
|
+
=== Bug corrections
|
39
|
+
|
40
|
+
* Regression: Gem testing did not work on all Windows platforms.
|
41
|
+
|
42
|
+
== 0.2.1.20101110 (Beta)
|
4
43
|
|
5
44
|
=== Misc
|
6
45
|
|
data/LICENSE
CHANGED
@@ -6,7 +6,7 @@ This list is found in the file named AUTHORS.
|
|
6
6
|
The AUTHORS and LICENSE files have to be included in any release of software
|
7
7
|
embedding source code of this package, or using it as a derivative software.
|
8
8
|
|
9
|
-
Copyright (c) 2009-
|
9
|
+
Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
10
10
|
|
11
11
|
Redistribution and use in source and binary forms, with or without
|
12
12
|
modification, are permitted provided that the following conditions are met:
|
data/README
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
-- This file is best viewed when processed by rdoc.
|
2
|
-
++
|
3
|
-
|
4
1
|
= RubyPackager
|
5
2
|
|
6
3
|
Packaging your Ruby applications on any platform.
|
@@ -11,8 +8,8 @@ Check the website at http://rubypackager.sourceforge.net
|
|
11
8
|
|
12
9
|
== Who wrote it ?
|
13
10
|
|
14
|
-
Check the AUTHORS[link:
|
11
|
+
Check the AUTHORS[link:AUTHORS.html] file.
|
15
12
|
|
16
13
|
== What is the license ?
|
17
14
|
|
18
|
-
You can find out in the LICENSE[link:
|
15
|
+
You can find out in the LICENSE[link:LICENSE.html] file.
|
data/ReleaseInfo
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# This file has been generated by RubyPackager during a delivery.
|
3
3
|
# More info about RubyPackager: http://rubypackager.sourceforge.net
|
4
4
|
{
|
5
|
-
:Version => '0.
|
5
|
+
:Version => '1.0.0.20120301',
|
6
6
|
:Tags => [ 'Beta' ],
|
7
|
-
:
|
7
|
+
:dev_status => 'Beta'
|
8
8
|
}
|
data/bin/Release.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!env ruby
|
2
2
|
#--
|
3
|
-
# Copyright (c) 2009-
|
3
|
+
# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
4
4
|
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
5
5
|
#++
|
6
6
|
|
@@ -12,9 +12,9 @@
|
|
12
12
|
# 4. In the case of specified distributors, ship the generated installers to those distributors
|
13
13
|
|
14
14
|
require 'rUtilAnts/Logging'
|
15
|
-
RUtilAnts::Logging::
|
15
|
+
RUtilAnts::Logging::install_logger_on_object(:lib_root_dir => "#{File.dirname(__FILE__)}/..", :bug_tracker_url => 'http://sourceforge.net/tracker/?group_id=274236&atid=1165400')
|
16
16
|
require 'rUtilAnts/Misc'
|
17
|
-
RUtilAnts::Misc.
|
17
|
+
RUtilAnts::Misc.install_misc_on_object
|
18
18
|
|
19
19
|
module RubyPackager
|
20
20
|
|
@@ -25,9 +25,9 @@ module RubyPackager
|
|
25
25
|
|
26
26
|
# Run the releaser
|
27
27
|
#
|
28
|
-
# Parameters
|
28
|
+
# Parameters::
|
29
29
|
# * *iParameters* (<em>list<String></em>): List of arguments, as in command-line
|
30
|
-
# Return
|
30
|
+
# Return::
|
31
31
|
# * _Boolean_: Success ?
|
32
32
|
def run(iParameters)
|
33
33
|
rSuccess = true
|
@@ -36,7 +36,7 @@ module RubyPackager
|
|
36
36
|
lRPReleaseInfo = {
|
37
37
|
:Version => 'Development',
|
38
38
|
:Tags => [],
|
39
|
-
:
|
39
|
+
:dev_status => 'Unofficial'
|
40
40
|
}
|
41
41
|
lReleaseInfoFileName = "#{File.dirname(FILE_PATH)}/../ReleaseInfo"
|
42
42
|
if (File.exists?(lReleaseInfoFileName))
|
@@ -48,10 +48,10 @@ module RubyPackager
|
|
48
48
|
# Parse for plugins
|
49
49
|
require 'rUtilAnts/Plugins'
|
50
50
|
lPluginsManager = RUtilAnts::Plugins::PluginsManager.new
|
51
|
-
lPluginsManager.
|
52
|
-
lPluginsManager.
|
53
|
-
lPluginsManager.
|
54
|
-
lPluginsManager.
|
51
|
+
lPluginsManager.parse_plugins_from_dir('Installers', "#{File.dirname(FILE_PATH)}/../lib/RubyPackager/Installers", 'RubyPackager::Installers')
|
52
|
+
lPluginsManager.parse_plugins_from_dir('Installers', "#{File.dirname(FILE_PATH)}/../lib/RubyPackager/#{RUBY_PLATFORM}/Installers", 'RubyPackager::Installers')
|
53
|
+
lPluginsManager.parse_plugins_from_dir('Distributors', "#{File.dirname(FILE_PATH)}/../lib/RubyPackager/Distributors", 'RubyPackager::Distributors')
|
54
|
+
lPluginsManager.parse_plugins_from_dir('Distributors', "#{File.dirname(FILE_PATH)}/../lib/RubyPackager/#{RUBY_PLATFORM}/Distributors", 'RubyPackager::Distributors')
|
55
55
|
|
56
56
|
# Parse command line arguments
|
57
57
|
# Variables set by the parser
|
@@ -74,7 +74,7 @@ module RubyPackager
|
|
74
74
|
end
|
75
75
|
lOptionsParser.on('-e', '--debug',
|
76
76
|
'Activate debugging logs.') do
|
77
|
-
|
77
|
+
activate_log_debug(true)
|
78
78
|
end
|
79
79
|
lOptionsParser.on('-v', '--version <Version>', String,
|
80
80
|
'<Version>: Version string of the release.',
|
@@ -105,12 +105,12 @@ module RubyPackager
|
|
105
105
|
end
|
106
106
|
lOptionsParser.on('-i', '--installer <InstallerName>', String,
|
107
107
|
'<InstallerName>: Name of an Installer to use.',
|
108
|
-
"Generate an installer. Can be specified multiple times. Available Installers are: #{lPluginsManager.
|
108
|
+
"Generate an installer. Can be specified multiple times. Available Installers are: #{lPluginsManager.get_plugins_names('Installers').join(', ')}") do |iArg|
|
109
109
|
lInstallers << iArg
|
110
110
|
end
|
111
111
|
lOptionsParser.on('-d', '--distributor <DistributorName>', String,
|
112
112
|
'<DistributorName>: Name of a Distributor to use.',
|
113
|
-
"Ship generated installers to a distributor. Can be specified multiple times. Available Distributors are: #{lPluginsManager.
|
113
|
+
"Ship generated installers to a distributor. Can be specified multiple times. Available Distributors are: #{lPluginsManager.get_plugins_names('Distributors').join(', ')}") do |iArg|
|
114
114
|
lDistributors << iArg
|
115
115
|
end
|
116
116
|
lReleaseInfo = nil
|
@@ -135,7 +135,7 @@ module RubyPackager
|
|
135
135
|
end
|
136
136
|
end
|
137
137
|
# Check the installers
|
138
|
-
lAvailableInstallers = lPluginsManager.
|
138
|
+
lAvailableInstallers = lPluginsManager.get_plugins_names('Installers')
|
139
139
|
lInstallers.each do |iInstallerName|
|
140
140
|
if (!lAvailableInstallers.include?(iInstallerName))
|
141
141
|
puts "Unknown specified installer: #{iInstallerName}."
|
@@ -144,7 +144,7 @@ module RubyPackager
|
|
144
144
|
end
|
145
145
|
end
|
146
146
|
# Check the distributors
|
147
|
-
lAvailableDistributors = lPluginsManager.
|
147
|
+
lAvailableDistributors = lPluginsManager.get_plugins_names('Distributors')
|
148
148
|
lDistributors.each do |iDistributorName|
|
149
149
|
if (!lAvailableDistributors.include?(iDistributorName))
|
150
150
|
puts "Unknown specified distributor: #{iDistributorName}."
|
@@ -159,7 +159,7 @@ module RubyPackager
|
|
159
159
|
end
|
160
160
|
if (rSuccess)
|
161
161
|
if (lDisplayUsage)
|
162
|
-
puts "RubyPackager v. #{lRPReleaseInfo[:Version]} - #{lRPReleaseInfo[:
|
162
|
+
puts "RubyPackager v. #{lRPReleaseInfo[:Version]} - #{lRPReleaseInfo[:dev_status]}"
|
163
163
|
puts ''
|
164
164
|
puts lOptionsParser
|
165
165
|
else
|
@@ -183,9 +183,9 @@ module RubyPackager
|
|
183
183
|
lDistributors
|
184
184
|
).execute
|
185
185
|
if (rSuccess)
|
186
|
-
|
186
|
+
log_info 'Release successful.'
|
187
187
|
else
|
188
|
-
|
188
|
+
log_err 'Error while releasing.'
|
189
189
|
end
|
190
190
|
end
|
191
191
|
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
3
|
+
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
|
+
#++
|
5
|
+
|
6
|
+
require 'RubyPackager/Tools'
|
7
|
+
|
8
|
+
module RubyPackager
|
9
|
+
|
10
|
+
module Distributors
|
11
|
+
|
12
|
+
class RubyGems
|
13
|
+
|
14
|
+
include RubyPackager::Tools
|
15
|
+
|
16
|
+
# Check that we can use this distributor
|
17
|
+
#
|
18
|
+
# Return::
|
19
|
+
# * _Boolean_: Can we use this distributor ?
|
20
|
+
def check_tools
|
21
|
+
rSuccess = true
|
22
|
+
|
23
|
+
begin
|
24
|
+
rSuccess = system('gem push --help')
|
25
|
+
rescue Exception
|
26
|
+
log_err "Error while testing \"gem push\": #{$!}. Please update your RubyGems library."
|
27
|
+
rSuccess = false
|
28
|
+
end
|
29
|
+
|
30
|
+
return rSuccess
|
31
|
+
end
|
32
|
+
|
33
|
+
# Distribute what has been generated
|
34
|
+
#
|
35
|
+
# Parameters::
|
36
|
+
# * *iInstallerDir* (_String_): Directory where installers are generated
|
37
|
+
# * *iReleaseVersion* (_String_): Release version
|
38
|
+
# * *iReleaseInfo* (_ReleaseInfo_): Release info
|
39
|
+
# * *iGeneratedFileNames* (<em>list<String></em>): List of files to distribute
|
40
|
+
# * *iDocDir* (_String_): Directory where the documentation has been generated
|
41
|
+
# Return::
|
42
|
+
# * _Boolean_: Success ?
|
43
|
+
def distribute(iInstallerDir, iReleaseVersion, iReleaseInfo, iGeneratedFileNames, iDocDir)
|
44
|
+
rSuccess = true
|
45
|
+
|
46
|
+
# Take only the Gem files
|
47
|
+
iGeneratedFileNames.each do |iFileName|
|
48
|
+
if (iFileName[-4..-1].upcase == '.GEM')
|
49
|
+
change_dir(iInstallerDir) do
|
50
|
+
if ((!system("gem push #{iFileName}")) or
|
51
|
+
(($? != nil) and
|
52
|
+
($? != 0)))
|
53
|
+
rSuccess = false
|
54
|
+
log_err "Error while pushing #{iFileName}: #{$?}."
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
return rSuccess
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2009-
|
2
|
+
# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
3
3
|
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
4
|
#++
|
5
5
|
|
@@ -15,25 +15,25 @@ module RubyPackager
|
|
15
15
|
|
16
16
|
# Check that we can use this distributor
|
17
17
|
#
|
18
|
-
# Return
|
18
|
+
# Return::
|
19
19
|
# * _Boolean_: Can we use this distributor ?
|
20
|
-
def
|
20
|
+
def check_tools
|
21
21
|
rSuccess = true
|
22
22
|
|
23
23
|
begin
|
24
24
|
require 'net/ssh'
|
25
25
|
rescue Exception
|
26
|
-
|
26
|
+
log_err 'Missing net/ssh library. gem install net-ssh.'
|
27
27
|
rSuccess = false
|
28
28
|
end
|
29
29
|
begin
|
30
30
|
require 'net/scp'
|
31
31
|
rescue Exception
|
32
|
-
|
32
|
+
log_err 'Missing net/scp library. gem install net-scp.'
|
33
33
|
rSuccess = false
|
34
34
|
end
|
35
35
|
if (!system('zip -v'))
|
36
|
-
|
36
|
+
log_err 'Missing zip command-line utility.'
|
37
37
|
rSuccess = false
|
38
38
|
end
|
39
39
|
|
@@ -42,28 +42,27 @@ module RubyPackager
|
|
42
42
|
|
43
43
|
# Distribute what has been generated
|
44
44
|
#
|
45
|
-
# Parameters
|
45
|
+
# Parameters::
|
46
46
|
# * *iInstallerDir* (_String_): Directory where installers are generated
|
47
47
|
# * *iReleaseVersion* (_String_): Release version
|
48
48
|
# * *iReleaseInfo* (_ReleaseInfo_): Release info
|
49
49
|
# * *iGeneratedFileNames* (<em>list<String></em>): List of files to distribute
|
50
50
|
# * *iDocDir* (_String_): Directory where the documentation has been generated
|
51
|
-
# Return
|
51
|
+
# Return::
|
52
52
|
# * _Boolean_: Success ?
|
53
53
|
def distribute(iInstallerDir, iReleaseVersion, iReleaseInfo, iGeneratedFileNames, iDocDir)
|
54
54
|
rSuccess = true
|
55
55
|
|
56
56
|
@InstallerDir, @ReleaseVersion, @ReleaseInfo, @GeneratedFileNames, @DocDir = iInstallerDir, iReleaseVersion, iReleaseInfo, iGeneratedFileNames, iDocDir
|
57
|
-
@
|
58
|
-
@
|
59
|
-
@
|
60
|
-
|
57
|
+
@SFLogin = "#{@ReleaseInfo.sf_info[:login]},#{@ReleaseInfo.sf_info[:project_unix_name]}"
|
58
|
+
@SFReleaseDir = "/home/frs/project/#{@ReleaseInfo.sf_info[:project_unix_name][0..0]}/#{@ReleaseInfo.sf_info[:project_unix_name][0..1]}/#{@ReleaseInfo.sf_info[:project_unix_name]}/#{@ReleaseVersion}"
|
59
|
+
set_ssh_options('shell.sourceforge.net', @SFLogin, @ReleaseInfo.sf_info)
|
60
|
+
ssh('create')
|
61
61
|
createReleaseOnSFNET
|
62
62
|
# It is possible that the RDoc has not been generated
|
63
63
|
if (File.exists?("#{@DocDir}/rdoc"))
|
64
64
|
uploadRDocOnSFNET
|
65
65
|
end
|
66
|
-
uploadReleaseNoteOnSFNET
|
67
66
|
uploadFilesOnSFNET
|
68
67
|
|
69
68
|
return rSuccess
|
@@ -71,89 +70,37 @@ module RubyPackager
|
|
71
70
|
|
72
71
|
private
|
73
72
|
|
74
|
-
# Create a Shell for SF.NET
|
75
|
-
def createSFShell
|
76
|
-
sshWithPassword(
|
77
|
-
'shell.sourceforge.net',
|
78
|
-
@SFLogin,
|
79
|
-
'create'
|
80
|
-
)
|
81
|
-
end
|
82
|
-
|
83
|
-
# Shutdown a Shell for SF.NET
|
84
|
-
def shutdownSFShell
|
85
|
-
sshWithPassword(
|
86
|
-
'shell.sourceforge.net',
|
87
|
-
@SFLogin,
|
88
|
-
'shutdown'
|
89
|
-
)
|
90
|
-
end
|
91
|
-
|
92
73
|
# Upload the RDoc on SF.NET
|
93
74
|
def uploadRDocOnSFNET
|
94
|
-
|
75
|
+
log_debug 'Uploading RDoc on SF.NET ...'
|
95
76
|
# Zip the RDoc
|
96
|
-
|
77
|
+
change_dir(@DocDir) do
|
97
78
|
system("zip -r rdoc.zip rdoc")
|
98
79
|
end
|
99
80
|
# Send it
|
100
|
-
lRDocBaseDir = "/home/
|
101
|
-
|
102
|
-
|
103
|
-
@SFLogin,
|
104
|
-
"mkdir -p #{lRDocBaseDir}"
|
105
|
-
)
|
106
|
-
scpWithPassword(
|
107
|
-
'shell.sourceforge.net',
|
108
|
-
@SFLogin,
|
109
|
-
"#{@DocDir}/rdoc.zip",
|
110
|
-
"#{lRDocBaseDir}/rdoc-#{@ReleaseVersion}.zip"
|
111
|
-
)
|
81
|
+
lRDocBaseDir = "/home/project-web/#{@ReleaseInfo.sf_info[:project_unix_name]}/htdocs/rdoc"
|
82
|
+
ssh("mkdir -p #{lRDocBaseDir}")
|
83
|
+
scp("#{@DocDir}/rdoc.zip", "#{lRDocBaseDir}/rdoc-#{@ReleaseVersion}.zip")
|
112
84
|
# Execute its uncompress remotely
|
113
|
-
|
114
|
-
'shell.sourceforge.net',
|
115
|
-
@SFLogin,
|
116
|
-
"unzip -o -d #{lRDocBaseDir} #{lRDocBaseDir}/rdoc-#{@ReleaseVersion}.zip ; mv #{lRDocBaseDir}/rdoc #{lRDocBaseDir}/#{@ReleaseVersion} ; rm #{lRDocBaseDir}/latest ; ln -s #{lRDocBaseDir}/#{@ReleaseVersion} #{lRDocBaseDir}/latest ; rm #{lRDocBaseDir}/rdoc-#{@ReleaseVersion}.zip"
|
117
|
-
)
|
85
|
+
ssh("unzip -o -d #{lRDocBaseDir} #{lRDocBaseDir}/rdoc-#{@ReleaseVersion}.zip ; mv #{lRDocBaseDir}/rdoc #{lRDocBaseDir}/#{@ReleaseVersion} ; rm #{lRDocBaseDir}/latest ; ln -s #{lRDocBaseDir}/#{@ReleaseVersion} #{lRDocBaseDir}/latest ; rm #{lRDocBaseDir}/rdoc-#{@ReleaseVersion}.zip")
|
118
86
|
# Remove temporary file
|
119
87
|
File.unlink("#{@DocDir}/rdoc.zip")
|
120
88
|
end
|
121
89
|
|
122
90
|
# Create the release on SF.NET
|
123
91
|
def createReleaseOnSFNET
|
124
|
-
|
125
|
-
|
126
|
-
'shell.sourceforge.net',
|
127
|
-
@SFLogin,
|
128
|
-
"mkdir -p #{@SFReleaseDir}"
|
129
|
-
)
|
92
|
+
log_debug 'Creating Release on SF.NET ...'
|
93
|
+
ssh("mkdir -p #{@SFReleaseDir}")
|
130
94
|
end
|
131
95
|
|
132
96
|
# Upload the generated files on SF.NET
|
133
97
|
def uploadFilesOnSFNET
|
134
98
|
@GeneratedFileNames.each do |iFileName|
|
135
|
-
|
136
|
-
|
137
|
-
'shell.sourceforge.net',
|
138
|
-
@SFLogin,
|
139
|
-
"#{@InstallerDir}/#{iFileName}",
|
140
|
-
"#{@SFReleaseDir}/#{iFileName}"
|
141
|
-
)
|
99
|
+
log_debug "Uploading #{iFileName} on SF.NET ..."
|
100
|
+
scp("#{@InstallerDir}/#{iFileName}", "#{@SFReleaseDir}/#{iFileName}")
|
142
101
|
end
|
143
102
|
end
|
144
103
|
|
145
|
-
# Upload the Release note on SF.NET
|
146
|
-
def uploadReleaseNoteOnSFNET
|
147
|
-
logDebug 'Uploading Release Note on SF.NET ...'
|
148
|
-
scpWithPassword(
|
149
|
-
'shell.sourceforge.net',
|
150
|
-
@SFLogin,
|
151
|
-
"#{@DocDir}/ReleaseNote.html",
|
152
|
-
"#{@SFReleaseDir}/ReleaseNote.html"
|
153
|
-
)
|
154
|
-
logInfo '!!! DON\'T FORGET to make association between ReleaseNote and Gem in SF.NET'
|
155
|
-
end
|
156
|
-
|
157
104
|
end
|
158
105
|
|
159
106
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2009-
|
2
|
+
# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
3
3
|
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
4
|
#++
|
5
5
|
|
@@ -11,22 +11,22 @@ module RubyPackager
|
|
11
11
|
|
12
12
|
# Create the installer with everything in the release directory.
|
13
13
|
#
|
14
|
-
# Parameters
|
14
|
+
# Parameters::
|
15
15
|
# * *iRootDir* (_String_): The Root directory
|
16
16
|
# * *iReleaseDir* (_String_): The release directory (all files to put in the installer are there)
|
17
17
|
# * *iInstallerDir* (_String_): The directory where the installer has to be put
|
18
18
|
# * *iVersion* (_String_): Release version
|
19
19
|
# * *iReleaseInfo* (_ReleaseInfo_): Release info
|
20
20
|
# * *iIncludeTest* (_Boolean_): Are test files part of the release ?
|
21
|
-
# Return
|
21
|
+
# Return::
|
22
22
|
# * _String_: File name to distribute, or nil in case of failure
|
23
|
-
def
|
23
|
+
def create_installer(iRootDir, iReleaseDir, iInstallerDir, iVersion, iReleaseInfo, iIncludeTest)
|
24
24
|
rFileName = nil
|
25
25
|
|
26
|
-
|
26
|
+
change_dir(iReleaseDir) do
|
27
27
|
# 1. Generate the gemspec that will build the gem
|
28
28
|
lStrHasRDoc = nil
|
29
|
-
if (iReleaseInfo.
|
29
|
+
if (iReleaseInfo.gem_info[:has_rdoc])
|
30
30
|
lStrHasRDoc = 'true'
|
31
31
|
else
|
32
32
|
lStrHasRDoc = 'false'
|
@@ -34,14 +34,14 @@ module RubyPackager
|
|
34
34
|
# !!! Don't use absolute paths here, otherwise they will be stored in the Gem
|
35
35
|
lStrFiles = "iSpec.files = [ '#{Dir.glob('**/*').join('\', \'')}' ]"
|
36
36
|
lStrExtraRDocFiles = ''
|
37
|
-
if ((iReleaseInfo.
|
38
|
-
(!iReleaseInfo.
|
39
|
-
lStrExtraRDocFiles = "iSpec.extra_rdoc_files = [ '#{iReleaseInfo.
|
40
|
-
RubyPackager::copyFiles(iRootDir, iReleaseDir, iReleaseInfo.
|
37
|
+
if ((iReleaseInfo.gem_info[:extra_rdoc_files] != nil) and
|
38
|
+
(!iReleaseInfo.gem_info[:extra_rdoc_files].empty?))
|
39
|
+
lStrExtraRDocFiles = "iSpec.extra_rdoc_files = [ '#{iReleaseInfo.gem_info[:extra_rdoc_files].join('\', \'')}' ]"
|
40
|
+
RubyPackager::copyFiles(iRootDir, iReleaseDir, iReleaseInfo.gem_info[:extra_rdoc_files])
|
41
41
|
end
|
42
42
|
lGemDepsStrList = []
|
43
|
-
if (iReleaseInfo.
|
44
|
-
iReleaseInfo.
|
43
|
+
if (iReleaseInfo.gem_info[:gem_dependencies] != nil)
|
44
|
+
iReleaseInfo.gem_info[:gem_dependencies].each do |iGemDepInfo|
|
45
45
|
iGemName, iGemVersion = iGemDepInfo
|
46
46
|
if (iGemVersion != nil)
|
47
47
|
lGemDepsStrList << "iSpec.add_dependency('#{iGemName}', '#{iGemVersion}')"
|
@@ -52,22 +52,22 @@ module RubyPackager
|
|
52
52
|
end
|
53
53
|
lStrTestFile = ''
|
54
54
|
if ((iIncludeTest) and
|
55
|
-
(iReleaseInfo.
|
56
|
-
lStrTestFile = "iSpec.test_file = '#{iReleaseInfo.
|
55
|
+
(iReleaseInfo.gem_info[:test_file] != nil))
|
56
|
+
lStrTestFile = "iSpec.test_file = '#{iReleaseInfo.gem_info[:test_file]}'"
|
57
57
|
end
|
58
58
|
# Compute the list of executable files and the executable directory
|
59
59
|
lBinError = false
|
60
60
|
lExecutablesDir = nil
|
61
61
|
lExecutablesBase = []
|
62
|
-
iReleaseInfo.
|
62
|
+
iReleaseInfo.executables_info.each do |iExecutableInfo|
|
63
63
|
if (lExecutablesDir == nil)
|
64
|
-
lExecutablesDir = File.dirname(iExecutableInfo[:
|
65
|
-
elsif (lExecutablesDir != File.dirname(iExecutableInfo[:
|
64
|
+
lExecutablesDir = File.dirname(iExecutableInfo[:startup_rb_file])
|
65
|
+
elsif (lExecutablesDir != File.dirname(iExecutableInfo[:startup_rb_file]))
|
66
66
|
# Error
|
67
|
-
|
67
|
+
log_err "Executables should be all in the same directory. \"#{lExecutablesDir}\" and \"#{File.dirname(iExecutableInfo[:startup_rb_file])}\" are different directories."
|
68
68
|
lBinError = true
|
69
69
|
end
|
70
|
-
lExecutablesBase << File.basename(iExecutableInfo[:
|
70
|
+
lExecutablesBase << File.basename(iExecutableInfo[:startup_rb_file])
|
71
71
|
end
|
72
72
|
if (!lBinError)
|
73
73
|
lStrBinDir = ''
|
@@ -78,11 +78,11 @@ module RubyPackager
|
|
78
78
|
end
|
79
79
|
# Compute require paths
|
80
80
|
lRequirePaths = []
|
81
|
-
if (iReleaseInfo.
|
82
|
-
lRequirePaths = [ iReleaseInfo.
|
81
|
+
if (iReleaseInfo.gem_info[:require_path] != nil)
|
82
|
+
lRequirePaths = [ iReleaseInfo.gem_info[:require_path] ]
|
83
83
|
end
|
84
|
-
if (iReleaseInfo.
|
85
|
-
lRequirePaths.concat(iReleaseInfo.
|
84
|
+
if (iReleaseInfo.gem_info[:require_paths] != nil)
|
85
|
+
lRequirePaths.concat(iReleaseInfo.gem_info[:require_paths])
|
86
86
|
end
|
87
87
|
lStrRequirePaths = 'iSpec.require_path = \'\''
|
88
88
|
if (!lRequirePaths.empty?)
|
@@ -92,19 +92,19 @@ module RubyPackager
|
|
92
92
|
File.open(lGemSpecFileName, 'w') do |oFile|
|
93
93
|
oFile << "
|
94
94
|
Gem::Specification.new do |iSpec|
|
95
|
-
iSpec.name = '#{iReleaseInfo.
|
95
|
+
iSpec.name = '#{iReleaseInfo.gem_info[:gem_name]}'
|
96
96
|
iSpec.version = '#{iVersion}'
|
97
|
-
iSpec.author = '#{iReleaseInfo.
|
98
|
-
iSpec.email = '#{iReleaseInfo.
|
99
|
-
iSpec.homepage = '#{iReleaseInfo.
|
100
|
-
iSpec.platform = #{iReleaseInfo.
|
101
|
-
iSpec.summary = '#{iReleaseInfo.
|
102
|
-
iSpec.description = '#{iReleaseInfo.
|
97
|
+
iSpec.author = '#{iReleaseInfo.author_info[:name].gsub(/'/,'\\\\\'')}'
|
98
|
+
iSpec.email = '#{iReleaseInfo.author_info[:email]}'
|
99
|
+
iSpec.homepage = '#{iReleaseInfo.project_info[:web_page_url]}'
|
100
|
+
iSpec.platform = #{iReleaseInfo.gem_info[:gem_platform_class_name]}
|
101
|
+
iSpec.summary = '#{iReleaseInfo.project_info[:summary].gsub(/'/,'\\\\\'')}'
|
102
|
+
iSpec.description = '#{iReleaseInfo.project_info[:description].gsub(/'/,'\\\\\'')}'
|
103
103
|
#{lStrFiles}
|
104
104
|
#{lStrRequirePaths}
|
105
105
|
iSpec.has_rdoc = #{lStrHasRDoc}
|
106
106
|
#{lStrExtraRDocFiles}
|
107
|
-
iSpec.rubyforge_project = '#{iReleaseInfo.
|
107
|
+
iSpec.rubyforge_project = '#{iReleaseInfo.rf_info[:project_unix_name]}'
|
108
108
|
#{lStrTestFile}
|
109
109
|
#{lStrBinDir}
|
110
110
|
#{lStrExecutables}
|
@@ -122,7 +122,7 @@ end
|
|
122
122
|
rescue ::Gem::SystemExitException
|
123
123
|
# For RubyGems, this is normal behaviour: success results in an exception thrown with exit_code 0.
|
124
124
|
if ($!.exit_code != 0)
|
125
|
-
|
125
|
+
log_err "RubyGems returned error #{$!.exit_code}."
|
126
126
|
lGemOK = false
|
127
127
|
end
|
128
128
|
end
|
@@ -131,9 +131,9 @@ end
|
|
131
131
|
# Move the Gem to the destination directory
|
132
132
|
require 'fileutils'
|
133
133
|
# Find the name of the Gem: it can differ depending on the platform
|
134
|
-
rFileName = Dir.glob("#{iReleaseInfo.
|
134
|
+
rFileName = Dir.glob("#{iReleaseInfo.gem_info[:gem_name]}-#{iVersion}*.gem")[0]
|
135
135
|
if (rFileName == nil)
|
136
|
-
|
136
|
+
log_err "Unable to find generated gem \"#{iReleaseInfo.gem_info[:gem_name]}-#{iVersion}*.gem\""
|
137
137
|
else
|
138
138
|
FileUtils::mv(rFileName, "#{iInstallerDir}/#{rFileName}")
|
139
139
|
end
|