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
@@ -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
|
|
@@ -10,91 +10,91 @@ module RubyPackager
|
|
10
10
|
|
11
11
|
# Information about the author
|
12
12
|
# map< Symbol, Object >
|
13
|
-
attr_reader :
|
13
|
+
attr_reader :author_info
|
14
14
|
|
15
15
|
# Information about the project
|
16
16
|
# map< Symbol, Object >
|
17
|
-
attr_reader :
|
17
|
+
attr_reader :project_info
|
18
18
|
|
19
19
|
# Information about the executables
|
20
20
|
# list< map< Symbol, Object > >
|
21
|
-
attr_reader :
|
21
|
+
attr_reader :executables_info
|
22
22
|
|
23
23
|
# Information about the installer
|
24
24
|
# map< Symbol, Object >
|
25
|
-
attr_reader :
|
25
|
+
attr_reader :install_info
|
26
26
|
|
27
27
|
# Information about SourceForge
|
28
28
|
# map< Symbol, Object >
|
29
|
-
attr_reader :
|
29
|
+
attr_reader :sf_info
|
30
30
|
|
31
31
|
# Information about RubyForge
|
32
32
|
# map< Symbol, Object >
|
33
|
-
attr_reader :
|
33
|
+
attr_reader :rf_info
|
34
34
|
|
35
35
|
# Information about the Gem
|
36
36
|
# map< Symbol, Object >
|
37
|
-
attr_reader :
|
37
|
+
attr_reader :gem_info
|
38
38
|
|
39
39
|
# List of core files patterns
|
40
40
|
# list< String >
|
41
|
-
attr_reader :
|
41
|
+
attr_reader :core_files
|
42
42
|
|
43
43
|
# List of additional files patterns
|
44
44
|
# list< String >
|
45
|
-
attr_reader :
|
45
|
+
attr_reader :additional_files
|
46
46
|
|
47
47
|
# List of test files patterns
|
48
48
|
# list< String >
|
49
|
-
attr_reader :
|
49
|
+
attr_reader :test_files
|
50
50
|
|
51
51
|
# Constructor
|
52
52
|
def initialize
|
53
53
|
# This sets also default values
|
54
|
-
@
|
55
|
-
@
|
56
|
-
@
|
57
|
-
@
|
58
|
-
@
|
59
|
-
@
|
60
|
-
@
|
54
|
+
@author_info = {}
|
55
|
+
@project_info = {}
|
56
|
+
@executables_info = []
|
57
|
+
@install_info = {}
|
58
|
+
@sf_info = {}
|
59
|
+
@rf_info = {}
|
60
|
+
@gem_info = {}
|
61
61
|
# Files patterns list
|
62
|
-
@
|
63
|
-
@
|
64
|
-
@
|
62
|
+
@core_files = []
|
63
|
+
@additional_files = []
|
64
|
+
@test_files = []
|
65
65
|
end
|
66
66
|
|
67
67
|
# Add Author properties
|
68
68
|
#
|
69
|
-
# Parameters
|
69
|
+
# Parameters::
|
70
70
|
# * *iParams* (<em>map<Symbol,Object></em>): The parameters:
|
71
|
-
#
|
72
|
-
#
|
73
|
-
#
|
74
|
-
# Return
|
71
|
+
# * *:name* (_String_): The author name
|
72
|
+
# * *:email* (_String_): The author's email
|
73
|
+
# * *:web_page_url* (_String_): The author's web page
|
74
|
+
# Return::
|
75
75
|
# * _ReleaseInfo_: self
|
76
76
|
def author(iParams)
|
77
|
-
@
|
77
|
+
@author_info.merge!(iParams)
|
78
78
|
|
79
79
|
return self
|
80
80
|
end
|
81
81
|
|
82
82
|
# Add Project properties
|
83
83
|
#
|
84
|
-
# Parameters
|
84
|
+
# Parameters::
|
85
85
|
# * *iParams* (<em>map<Symbol,Object></em>): The parameters:
|
86
|
-
#
|
87
|
-
#
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
#
|
93
|
-
#
|
94
|
-
# Return
|
86
|
+
# * *:name* (_String_): Project name
|
87
|
+
# * *:web_page_url* (_String_): Project home page
|
88
|
+
# * *:summary* (_String_): Project Summary
|
89
|
+
# * *:description* (_String_): Project description
|
90
|
+
# * *:image_url* (_String_): URL of the project's image
|
91
|
+
# * *:favicon_url* (_String_): URL of the project's favicon
|
92
|
+
# * *:browse_source_url* (_String_): URL to browse the source code
|
93
|
+
# * *:dev_status* (_String_): Development status
|
94
|
+
# Return::
|
95
95
|
# * _ReleaseInfo_: self
|
96
96
|
def project(iParams)
|
97
|
-
@
|
97
|
+
@project_info.merge!(iParams)
|
98
98
|
|
99
99
|
return self
|
100
100
|
end
|
@@ -102,114 +102,116 @@ module RubyPackager
|
|
102
102
|
# Add executable package properties.
|
103
103
|
# This method can be called several times to specify several executables.
|
104
104
|
#
|
105
|
-
# Parameters
|
105
|
+
# Parameters::
|
106
106
|
# * *iParams* (<em>map<Symbol,Object></em>): The parameters:
|
107
|
-
#
|
108
|
-
#
|
109
|
-
#
|
110
|
-
#
|
111
|
-
# Return
|
107
|
+
# * *:startup_rb_file* (_String_): Name of RB file to execute as startup file.
|
108
|
+
# * *:exe_name* (_String_): Name of executable file to produce.
|
109
|
+
# * *:icon_name* (_String_): Name of the executable icon.
|
110
|
+
# * *:terminal_application* (_Boolean_): Does this binary execute in a terminal ?
|
111
|
+
# Return::
|
112
112
|
# * _ReleaseInfo_: self
|
113
113
|
def executable(iParams)
|
114
|
-
@
|
114
|
+
@executables_info << iParams
|
115
115
|
|
116
116
|
return self
|
117
117
|
end
|
118
118
|
|
119
119
|
# Add installer properties
|
120
120
|
#
|
121
|
-
# Parameters
|
121
|
+
# Parameters::
|
122
122
|
# * *iParams* (<em>map<Symbol,Object></em>): The parameters:
|
123
|
-
#
|
124
|
-
#
|
125
|
-
# Return
|
123
|
+
# * *:nsis_file_name* (_String_): Name of the NSI file to use to generate the installer
|
124
|
+
# * *:installer_name* (_String_): Name of the generated installer
|
125
|
+
# Return::
|
126
126
|
# * _ReleaseInfo_: self
|
127
127
|
def install(iParams)
|
128
|
-
@
|
128
|
+
@install_info.merge!(iParams)
|
129
129
|
|
130
130
|
return self
|
131
131
|
end
|
132
132
|
|
133
133
|
# Add SF.NET properties
|
134
134
|
#
|
135
|
-
# Parameters
|
135
|
+
# Parameters::
|
136
136
|
# * *iParams* (<em>map<Symbol,Object></em>): The parameters:
|
137
|
-
#
|
138
|
-
#
|
139
|
-
#
|
137
|
+
# * *:login* (_String_): The releaser's SF.NET login
|
138
|
+
# * *:project_unix_name* (_String_): Unix name of the SF project
|
139
|
+
# * *:ask_for_password* (_Boolean_): Do we ask for the user password to give to SSH ?
|
140
|
+
# * *:ask_for_key_passphrase* (_Boolean_): Do we ask for the key passphrase to give to SSH ?
|
141
|
+
# Return::
|
140
142
|
# * _ReleaseInfo_: self
|
141
|
-
def
|
142
|
-
@
|
143
|
+
def source_forge(iParams)
|
144
|
+
@sf_info.merge!(iParams)
|
143
145
|
|
144
146
|
return self
|
145
147
|
end
|
146
148
|
|
147
149
|
# Add RubyForge properties
|
148
150
|
#
|
149
|
-
# Parameters
|
151
|
+
# Parameters::
|
150
152
|
# * *iParams* (<em>map<Symbol,Object></em>): The parameters:
|
151
|
-
#
|
152
|
-
#
|
153
|
-
# Return
|
153
|
+
# * *:login* (_String_): The releaser's RubyForge login
|
154
|
+
# * *:project_unix_name* (_String_): Unix name of the RubyForge project
|
155
|
+
# Return::
|
154
156
|
# * _ReleaseInfo_: self
|
155
|
-
def
|
156
|
-
@
|
157
|
+
def ruby_forge(iParams)
|
158
|
+
@rf_info.merge!(iParams)
|
157
159
|
|
158
160
|
return self
|
159
161
|
end
|
160
162
|
|
161
163
|
# Add Gem properties
|
162
164
|
#
|
163
|
-
# Parameters
|
165
|
+
# Parameters::
|
164
166
|
# * *iParams* (<em>map<Symbol,Object></em>): The parameters:
|
165
|
-
#
|
166
|
-
#
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
#
|
171
|
-
#
|
172
|
-
#
|
173
|
-
# Return
|
167
|
+
# * *:gem_name* (_String_): The Gem name
|
168
|
+
# * *:gem_platform_class_name* (_String_): The name of the Gem platform class
|
169
|
+
# * *:require_path* (_String_): Single path to require
|
170
|
+
# * *:require_paths* (<em>list<String></em>): Paths to require
|
171
|
+
# * *:has_rdoc* (_String_): Include RDoc in the Gem ?
|
172
|
+
# * *:extra_rdoc_files* (<em>list<String></em>): List of file patterns to be included in the RDoc but not in the Gem
|
173
|
+
# * *:test_file* (_String_): Name of the test file to execute
|
174
|
+
# * *:gem_dependencies* (<em>list< [String,String] ></em>): List of [ Gem, Version criteria ] this Gem depends on
|
175
|
+
# Return::
|
174
176
|
# * _ReleaseInfo_: self
|
175
177
|
def gem(iParams)
|
176
|
-
@
|
178
|
+
@gem_info.merge!(iParams)
|
177
179
|
|
178
180
|
return self
|
179
181
|
end
|
180
182
|
|
181
183
|
# Add core files patterns
|
182
184
|
#
|
183
|
-
# Parameters
|
185
|
+
# Parameters::
|
184
186
|
# * *iFilesPatternsList* (<em>list<String></em>): The list of files patterns to add
|
185
|
-
# Return
|
187
|
+
# Return::
|
186
188
|
# * _ReleaseInfo_: self
|
187
|
-
def
|
188
|
-
@
|
189
|
+
def add_core_files(iFilesPatternsList)
|
190
|
+
@core_files.concat(iFilesPatternsList)
|
189
191
|
|
190
192
|
return self
|
191
193
|
end
|
192
194
|
|
193
195
|
# Add additional files patterns
|
194
196
|
#
|
195
|
-
# Parameters
|
197
|
+
# Parameters::
|
196
198
|
# * *iFilesPatternsList* (<em>list<String></em>): The list of files patterns to add
|
197
|
-
# Return
|
199
|
+
# Return::
|
198
200
|
# * _ReleaseInfo_: self
|
199
|
-
def
|
200
|
-
@
|
201
|
+
def add_additional_files(iFilesPatternsList)
|
202
|
+
@additional_files.concat(iFilesPatternsList)
|
201
203
|
|
202
204
|
return self
|
203
205
|
end
|
204
206
|
|
205
207
|
# Add test files patterns
|
206
208
|
#
|
207
|
-
# Parameters
|
209
|
+
# Parameters::
|
208
210
|
# * *iFilesPatternsList* (<em>list<String></em>): The list of files patterns to add
|
209
|
-
# Return
|
211
|
+
# Return::
|
210
212
|
# * _ReleaseInfo_: self
|
211
|
-
def
|
212
|
-
@
|
213
|
+
def add_test_files(iFilesPatternsList)
|
214
|
+
@test_files.concat(iFilesPatternsList)
|
213
215
|
|
214
216
|
return self
|
215
217
|
end
|
@@ -1,5 +1,6 @@
|
|
1
|
+
# coding: utf-8
|
1
2
|
#--
|
2
|
-
# Copyright (c) 2009-
|
3
|
+
# Copyright (c) 2009 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
3
4
|
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
5
|
#++
|
5
6
|
|
@@ -14,7 +15,7 @@ module RubyPackager
|
|
14
15
|
|
15
16
|
# Copy a list of files patterns to the release directory
|
16
17
|
#
|
17
|
-
# Parameters
|
18
|
+
# Parameters::
|
18
19
|
# * *iRootDir* (_String_): The root dir
|
19
20
|
# * *iReleaseDir* (_String_): The release dir
|
20
21
|
# * *iFilesPatterns* (<em>list<String></em>): The list of files patterns
|
@@ -34,9 +35,9 @@ module RubyPackager
|
|
34
35
|
lDestFileName = "#{iReleaseDir}/#{lRelativeName}"
|
35
36
|
FileUtils::mkdir_p(File.dirname(lDestFileName))
|
36
37
|
if (File.directory?(iFileName))
|
37
|
-
|
38
|
+
log_debug "Create directory #{lRelativeName}"
|
38
39
|
else
|
39
|
-
|
40
|
+
log_debug "Copy file #{lRelativeName}"
|
40
41
|
FileUtils::cp(iFileName, lDestFileName)
|
41
42
|
end
|
42
43
|
end
|
@@ -49,7 +50,7 @@ module RubyPackager
|
|
49
50
|
|
50
51
|
# Constructor
|
51
52
|
#
|
52
|
-
# Parameters
|
53
|
+
# Parameters::
|
53
54
|
# * *iPluginsManager* (<em>RUtilAnts::Plugins::PluginsManager</em>): The Plugins manager
|
54
55
|
# * *iReleaseInfo* (_ReleaseInfo_): The release information
|
55
56
|
# * *iRootDir* (_String_): The root directory, containing files to ship in the distribution
|
@@ -65,7 +66,7 @@ module RubyPackager
|
|
65
66
|
# * *iDistributors* (<em>list<String></em>): The list of distributors to ship installers to
|
66
67
|
def initialize(iPluginsManager, iReleaseInfo, iRootDir, iReleaseBaseDir, iPlatformReleaseInfo, iReleaseVersion, iReleaseTags, iReleaseComment, iIncludeRuby, iIncludeTest, iGenerateRDoc, iInstallers, iDistributors)
|
67
68
|
@PluginsManager, @ReleaseInfo, @RootDir, @ReleaseBaseDir, @PlatformReleaseInfo, @ReleaseVersion, @ReleaseTags, @ReleaseComment, @IncludeRuby, @IncludeTest, @GenerateRDoc, @Installers, @Distributors = iPluginsManager, iReleaseInfo, iRootDir, iReleaseBaseDir, iPlatformReleaseInfo, iReleaseVersion, iReleaseTags, iReleaseComment, iIncludeRuby, iIncludeTest, iGenerateRDoc, iInstallers, iDistributors
|
68
|
-
@GemName = "#{@ReleaseInfo.
|
69
|
+
@GemName = "#{@ReleaseInfo.gem_info[:gem_name]}-#{@ReleaseVersion}.gem"
|
69
70
|
# Compute the release directory name
|
70
71
|
lStrOptions = 'Normal'
|
71
72
|
if (@IncludeRuby)
|
@@ -77,10 +78,11 @@ module RubyPackager
|
|
77
78
|
elsif (@IncludeTest)
|
78
79
|
lStrOptions = 'IncludeTest'
|
79
80
|
end
|
80
|
-
|
81
|
-
|
82
|
-
@
|
83
|
-
@
|
81
|
+
lBaseReleaseDir = "#{@ReleaseBaseDir}/#{RUBY_PLATFORM}/#{@ReleaseVersion}/#{lStrOptions}/#{Time.now.strftime('%Y_%m_%d_%H_%M_%S')}"
|
82
|
+
log_debug "Release to be performed in #{lBaseReleaseDir}"
|
83
|
+
@InstallerDir = "#{lBaseReleaseDir}/Installer"
|
84
|
+
@DocDir = "#{lBaseReleaseDir}/Documentation"
|
85
|
+
@ReleaseDir = "#{lBaseReleaseDir}/Release"
|
84
86
|
require 'fileutils'
|
85
87
|
FileUtils.mkdir_p(@ReleaseDir)
|
86
88
|
FileUtils.mkdir_p(@InstallerDir)
|
@@ -89,7 +91,7 @@ module RubyPackager
|
|
89
91
|
|
90
92
|
# Release
|
91
93
|
#
|
92
|
-
# Return
|
94
|
+
# Return::
|
93
95
|
# * _Boolean_: Success ?
|
94
96
|
def execute
|
95
97
|
rSuccess = true
|
@@ -102,24 +104,32 @@ module RubyPackager
|
|
102
104
|
(!@ReleaseInfo.checkReadyForRelease(@RootDir)))
|
103
105
|
rSuccess = false
|
104
106
|
end
|
105
|
-
if (!@ReleaseInfo.
|
107
|
+
if (!@ReleaseInfo.executables_info.empty?)
|
108
|
+
# Check first if there will be a need for binary compilation
|
109
|
+
lBinaryCompilation = false
|
110
|
+
@ReleaseInfo.executables_info.each do |iExecutableInfo|
|
111
|
+
if (iExecutableInfo[:exe_name] != nil)
|
112
|
+
lBinaryCompilation = true
|
113
|
+
break
|
114
|
+
end
|
115
|
+
end
|
106
116
|
# Check tools for platform dependent considerations
|
107
|
-
if (!@PlatformReleaseInfo.
|
117
|
+
if (!@PlatformReleaseInfo.check_exe_tools(@RootDir, @IncludeRuby, lBinaryCompilation))
|
108
118
|
rSuccess = false
|
109
119
|
end
|
110
120
|
end
|
111
121
|
@Installers.each do |iInstallerName|
|
112
|
-
@PluginsManager.
|
113
|
-
if ((ioPlugin.respond_to?(:
|
114
|
-
(!ioPlugin.
|
122
|
+
@PluginsManager.access_plugin('Installers', iInstallerName) do |ioPlugin|
|
123
|
+
if ((ioPlugin.respond_to?(:check_tools)) and
|
124
|
+
(!ioPlugin.check_tools))
|
115
125
|
rSuccess = false
|
116
126
|
end
|
117
127
|
end
|
118
128
|
end
|
119
129
|
@Distributors.each do |iDistributorName|
|
120
|
-
@PluginsManager.
|
121
|
-
if ((ioPlugin.respond_to?(:
|
122
|
-
(!ioPlugin.
|
130
|
+
@PluginsManager.access_plugin('Distributors', iDistributorName) do |ioPlugin|
|
131
|
+
if ((ioPlugin.respond_to?(:check_tools)) and
|
132
|
+
(!ioPlugin.check_tools))
|
123
133
|
rSuccess = false
|
124
134
|
end
|
125
135
|
end
|
@@ -145,8 +155,8 @@ module RubyPackager
|
|
145
155
|
lGeneratedInstallers = []
|
146
156
|
@Installers.each do |iInstallerName|
|
147
157
|
logOp("Create installer #{iInstallerName}") do
|
148
|
-
@PluginsManager.
|
149
|
-
lFileName = ioPlugin.
|
158
|
+
@PluginsManager.access_plugin('Installers', iInstallerName) do |ioPlugin|
|
159
|
+
lFileName = ioPlugin.create_installer(@RootDir, @ReleaseDir, @InstallerDir, @ReleaseVersion, @ReleaseInfo, @IncludeTest)
|
150
160
|
if (lFileName == nil)
|
151
161
|
rSuccess = false
|
152
162
|
else
|
@@ -159,7 +169,7 @@ module RubyPackager
|
|
159
169
|
# 5. Distribute
|
160
170
|
@Distributors.each do |iDistributorName|
|
161
171
|
logOp("Distribute to #{iDistributorName}") do
|
162
|
-
@PluginsManager.
|
172
|
+
@PluginsManager.access_plugin('Distributors', iDistributorName) do |ioPlugin|
|
163
173
|
if (!ioPlugin.distribute(@InstallerDir, @ReleaseVersion, @ReleaseInfo, lGeneratedInstallers, @DocDir))
|
164
174
|
rSuccess = false
|
165
175
|
end
|
@@ -180,24 +190,24 @@ module RubyPackager
|
|
180
190
|
|
181
191
|
# Log an operation, and call some code inside
|
182
192
|
#
|
183
|
-
# Parameters
|
193
|
+
# Parameters::
|
184
194
|
# * *iOperationName* (_String_): Operation name
|
185
195
|
# * *CodeBlock*: Code to call in this operation
|
186
196
|
def logOp(iOperationName)
|
187
|
-
|
197
|
+
log_debug "===== #{iOperationName} ..."
|
188
198
|
yield
|
189
|
-
|
199
|
+
log_debug "===== ... #{iOperationName}"
|
190
200
|
end
|
191
201
|
|
192
202
|
# Release files in a directory, and create the executable if needed
|
193
203
|
#
|
194
|
-
# Return
|
204
|
+
# Return::
|
195
205
|
# * _Boolean_: Success ?
|
196
206
|
def releaseFiles
|
197
207
|
rSuccess = true
|
198
208
|
|
199
209
|
logOp('Copy core files') do
|
200
|
-
RubyPackager::copyFiles(@RootDir, @ReleaseDir, @ReleaseInfo.
|
210
|
+
RubyPackager::copyFiles(@RootDir, @ReleaseDir, @ReleaseInfo.core_files)
|
201
211
|
# Create the ReleaseVersion file
|
202
212
|
lStrTags = nil
|
203
213
|
if (@ReleaseTags.empty?)
|
@@ -212,27 +222,27 @@ module RubyPackager
|
|
212
222
|
{
|
213
223
|
:Version => '#{@ReleaseVersion}',
|
214
224
|
#{lStrTags},
|
215
|
-
:
|
225
|
+
:dev_status => '#{@ReleaseInfo.project_info[:dev_status]}'
|
216
226
|
}
|
217
227
|
"
|
218
228
|
end
|
219
229
|
end
|
220
|
-
@ReleaseInfo.
|
221
|
-
if (iExecutableInfo[:
|
222
|
-
logOp("Create binary #{iExecutableInfo[:
|
230
|
+
@ReleaseInfo.executables_info.each do |iExecutableInfo|
|
231
|
+
if (iExecutableInfo[:exe_name] != nil)
|
232
|
+
logOp("Create binary #{iExecutableInfo[:exe_name]}") do
|
223
233
|
# TODO (crate): When crate will work correctly under Windows, use it here to pack everything
|
224
234
|
# For now the executable creation is platform dependent
|
225
|
-
rSuccess = @PlatformReleaseInfo.
|
235
|
+
rSuccess = @PlatformReleaseInfo.create_binary(@RootDir, @ReleaseDir, @IncludeRuby, iExecutableInfo)
|
226
236
|
end
|
227
237
|
end
|
228
238
|
end
|
229
239
|
if (rSuccess)
|
230
240
|
logOp('Copy additional files') do
|
231
|
-
RubyPackager::copyFiles(@RootDir, @ReleaseDir, @ReleaseInfo.
|
241
|
+
RubyPackager::copyFiles(@RootDir, @ReleaseDir, @ReleaseInfo.additional_files)
|
232
242
|
end
|
233
243
|
if (@IncludeTest)
|
234
244
|
logOp('Copy test files') do
|
235
|
-
RubyPackager::copyFiles(@RootDir, @ReleaseDir, @ReleaseInfo.
|
245
|
+
RubyPackager::copyFiles(@RootDir, @ReleaseDir, @ReleaseInfo.test_files)
|
236
246
|
end
|
237
247
|
end
|
238
248
|
end
|
@@ -242,49 +252,57 @@ module RubyPackager
|
|
242
252
|
|
243
253
|
# Generate rdoc
|
244
254
|
#
|
245
|
-
# Return
|
255
|
+
# Return::
|
246
256
|
# * _Boolean_: Success ?
|
247
257
|
def generateRDoc
|
248
258
|
rSuccess = true
|
249
259
|
|
250
260
|
logOp('Generating RDoc') do
|
251
|
-
$
|
252
|
-
:Name => @ReleaseInfo.
|
261
|
+
$project_info = {
|
262
|
+
:Name => @ReleaseInfo.project_info[:name],
|
253
263
|
:Version => @ReleaseVersion,
|
254
264
|
:Tags => @ReleaseTags,
|
255
265
|
:Date => Time.now,
|
256
|
-
:
|
257
|
-
:Author => @ReleaseInfo.
|
258
|
-
:AuthorMail => @ReleaseInfo.
|
259
|
-
:AuthorURL => @ReleaseInfo.
|
260
|
-
:HomepageURL => @ReleaseInfo.
|
261
|
-
:
|
266
|
+
:dev_status => @ReleaseInfo.project_info[:dev_status],
|
267
|
+
:Author => @ReleaseInfo.author_info[:name],
|
268
|
+
:AuthorMail => @ReleaseInfo.author_info[:email],
|
269
|
+
:AuthorURL => @ReleaseInfo.author_info[:web_page_url],
|
270
|
+
:HomepageURL => @ReleaseInfo.project_info[:web_page_url],
|
271
|
+
:image_url => @ReleaseInfo.project_info[:image_url],
|
262
272
|
# TODO: Do not hardcode SF anymore
|
263
|
-
:DownloadURL => "https://sourceforge.net/projects/#{@ReleaseInfo.
|
264
|
-
:
|
265
|
-
:
|
273
|
+
:DownloadURL => "https://sourceforge.net/projects/#{@ReleaseInfo.sf_info[:project_unix_name]}/files/#{@ReleaseVersion}/#{@GemName}/download",
|
274
|
+
:browse_source_url => @ReleaseInfo.project_info[:browse_source_url],
|
275
|
+
:favicon_url => @ReleaseInfo.project_info[:favicon_url],
|
266
276
|
# For the documentation, the Root dir is the Release dir as files have been copied there and the rdoc will be generated from there.
|
267
277
|
:RootDir => @ReleaseDir
|
268
278
|
}
|
279
|
+
# Create the created.rid file as otherwise rdoc will not finish
|
280
|
+
FileUtils::mkdir_p("#{@DocDir}/rdoc")
|
281
|
+
File.open("#{@DocDir}/rdoc/created.rid", 'w') do |oFile|
|
282
|
+
end
|
269
283
|
gem 'rdoc'
|
270
284
|
require 'rdoc/rdoc'
|
271
285
|
lRDocOptions = [
|
272
286
|
'--line-numbers',
|
273
287
|
'--tab-width=2',
|
274
|
-
"--title=#{@ReleaseInfo.
|
275
|
-
'--
|
288
|
+
"--title=#{@ReleaseInfo.project_info[:name].gsub(/'/,'\\\\\'')} v#{@ReleaseVersion}",
|
289
|
+
'--hyperlink-all',
|
290
|
+
'--charset=utf-8',
|
276
291
|
'--exclude=.svn',
|
292
|
+
'--exclude=.git',
|
277
293
|
'--exclude=nbproject',
|
278
294
|
'--exclude=Done.txt',
|
279
|
-
|
295
|
+
'--exclude=Releases',
|
296
|
+
'--force-update',
|
280
297
|
"--output=#{@DocDir}/rdoc"
|
281
298
|
]
|
282
299
|
# Bug (RDoc): Sometimes it does not change current directory correctly (not deterministic)
|
283
|
-
|
300
|
+
change_dir(@ReleaseDir) do
|
284
301
|
# First try with Muriel's template
|
285
302
|
begin
|
286
303
|
RDoc::RDoc.new.document( lRDocOptions + [ '--fmt=muriel' ] )
|
287
304
|
rescue Exception
|
305
|
+
log_warn "Exception while generating using Muriel's templates: #{$!}: #{$!.backtrace.join("\n")}"
|
288
306
|
# Then try with default template
|
289
307
|
RDoc::RDoc.new.document( lRDocOptions )
|
290
308
|
end
|
@@ -296,7 +314,7 @@ module RubyPackager
|
|
296
314
|
|
297
315
|
# Generate a release note file to attach to this release
|
298
316
|
#
|
299
|
-
# Return
|
317
|
+
# Return::
|
300
318
|
# * _Boolean_: Success ?
|
301
319
|
def generateReleaseNote_HTML
|
302
320
|
rSuccess = true
|
@@ -321,7 +339,7 @@ module RubyPackager
|
|
321
339
|
oFile << "
|
322
340
|
<html>
|
323
341
|
<head>
|
324
|
-
<link rel=\"shortcut icon\" href=\"#{@ReleaseInfo.
|
342
|
+
<link rel=\"shortcut icon\" href=\"#{@ReleaseInfo.project_info[:favicon_url]}%>\" />
|
325
343
|
<style type=\"text/css\">
|
326
344
|
body {
|
327
345
|
background: #fdfdfd;
|
@@ -371,21 +389,21 @@ module RubyPackager
|
|
371
389
|
</style>
|
372
390
|
</head>
|
373
391
|
<body>
|
374
|
-
<a href=\"#{@ReleaseInfo.
|
375
|
-
<h1>Release Note for #{@ReleaseInfo.
|
376
|
-
<h2>Development status: <span class=\"Important\">#{@ReleaseInfo.
|
392
|
+
<a href=\"#{@ReleaseInfo.project_info[:web_page_url]}\"><img src=\"#{@ReleaseInfo.project_info[:image_url]}\" align=\"right\" width=\"100px\"/></a>
|
393
|
+
<h1>Release Note for #{@ReleaseInfo.project_info[:name]} - v. #{@ReleaseVersion}</h1>
|
394
|
+
<h2>Development status: <span class=\"Important\">#{@ReleaseInfo.project_info[:dev_status]}</span></h2>
|
377
395
|
#{lStrWhatsNew}
|
378
396
|
<h2>Detailed changes with previous version</h2>
|
379
397
|
#{lLastChangesLines.join}
|
380
398
|
<h2>Useful links</h2>
|
381
399
|
<ul>
|
382
|
-
<li><a href=\"#{@ReleaseInfo.
|
383
|
-
<li><a href=\"https://sourceforge.net/projects/#{@ReleaseInfo.
|
384
|
-
<li>Author: <a href=\"#{@ReleaseInfo.
|
385
|
-
<li><a href=\"#{@ReleaseInfo.
|
386
|
-
<li><a href=\"#{@ReleaseInfo.
|
387
|
-
<li><a href=\"#{@ReleaseInfo.
|
388
|
-
<li><a href=\"#{@ReleaseInfo.
|
400
|
+
<li><a href=\"#{@ReleaseInfo.project_info[:web_page_url]}\">Project web site</a></li>
|
401
|
+
<li><a href=\"https://sourceforge.net/projects/#{@ReleaseInfo.sf_info[:project_unix_name]}/files/#{@ReleaseVersion}/#{@GemName}/download\">Download</a></li>
|
402
|
+
<li>Author: <a href=\"#{@ReleaseInfo.author_info[:web_page_url]}\">#{@ReleaseInfo.author_info[:name]}</a> (<a href=\"mailto://#{@ReleaseInfo.author_info[:email]}\">Contact</a>)</li>
|
403
|
+
<li><a href=\"#{@ReleaseInfo.project_info[:web_page_url]}rdoc/#{@ReleaseVersion}\">Browse RDoc</a></li>
|
404
|
+
<li><a href=\"#{@ReleaseInfo.project_info[:browse_source_url]}\">Browse source</a></li>
|
405
|
+
<li><a href=\"#{@ReleaseInfo.project_info[:browse_source_url]}ChangeLog?view=markup\">View complete ChangeLog</a></li>
|
406
|
+
<li><a href=\"#{@ReleaseInfo.project_info[:browse_source_url]}README?view=markup\">View README file</a></li>
|
389
407
|
</ul>
|
390
408
|
</body>
|
391
409
|
</html>
|
@@ -398,7 +416,7 @@ module RubyPackager
|
|
398
416
|
|
399
417
|
# Generate a release note file to attach to this release
|
400
418
|
#
|
401
|
-
# Return
|
419
|
+
# Return::
|
402
420
|
# * _Boolean_: Success ?
|
403
421
|
def generateReleaseNote_TXT
|
404
422
|
rSuccess = true
|
@@ -415,9 +433,9 @@ module RubyPackager
|
|
415
433
|
end
|
416
434
|
File.open("#{@DocDir}/ReleaseNote.txt", 'w') do |oFile|
|
417
435
|
oFile << "
|
418
|
-
= Release Note for #{@ReleaseInfo.
|
436
|
+
= Release Note for #{@ReleaseInfo.project_info[:name]} - v. #{@ReleaseVersion}
|
419
437
|
|
420
|
-
== Development status: #{@ReleaseInfo.
|
438
|
+
== Development status: #{@ReleaseInfo.project_info[:dev_status]}
|
421
439
|
|
422
440
|
#{lStrWhatsNew}
|
423
441
|
== Detailed changes with previous version
|
@@ -426,13 +444,13 @@ module RubyPackager
|
|
426
444
|
|
427
445
|
== Useful links
|
428
446
|
|
429
|
-
* Project web site: #{@ReleaseInfo.
|
430
|
-
* Download: https://sourceforge.net/projects/#{@ReleaseInfo.
|
431
|
-
* Author: #{@ReleaseInfo.
|
432
|
-
* Browse RDoc: #{@ReleaseInfo.
|
433
|
-
* Browse
|
434
|
-
* View complete ChangeLog: #{@ReleaseInfo.
|
435
|
-
* View README file: #{@ReleaseInfo.
|
447
|
+
* Project web site: #{@ReleaseInfo.project_info[:web_page_url]}
|
448
|
+
* Download: https://sourceforge.net/projects/#{@ReleaseInfo.project_info[:project_unix_name]}/files/#{@ReleaseVersion}/#{@GemName}/download
|
449
|
+
* Author: #{@ReleaseInfo.author_info[:name]} (#{@ReleaseInfo.author_info[:web_page_url]}) (Mail: #{@ReleaseInfo.author_info[:email]})
|
450
|
+
* Browse RDoc: #{@ReleaseInfo.project_info[:web_page_url]}rdoc/#{@ReleaseVersion}
|
451
|
+
* Browse source: #{@ReleaseInfo.project_info[:browse_source_url]}
|
452
|
+
* View complete ChangeLog: #{@ReleaseInfo.project_info[:browse_source_url]}ChangeLog?view=markup
|
453
|
+
* View README file: #{@ReleaseInfo.project_info[:browse_source_url]}README?view=markup
|
436
454
|
"
|
437
455
|
end
|
438
456
|
end
|
@@ -442,7 +460,7 @@ module RubyPackager
|
|
442
460
|
|
443
461
|
# Get the last change log
|
444
462
|
#
|
445
|
-
# Return
|
463
|
+
# Return::
|
446
464
|
# * <em>list<String></em>: The change log lines
|
447
465
|
def getLastChangeLog
|
448
466
|
rLastChangesLines = []
|