RubyPackager 0.1.0.20091021
Sign up to get free protection for your applications and to get access to all the features.
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/AUTHORS +3 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/ChangeLog +17 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/Credits +35 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/LICENSE +31 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/README +18 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/ReleaseInfo +8 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/TODO +11 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/lib/RubyPackager/Distributors/SourceForge.rb +159 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/lib/RubyPackager/Installers/Gem.rb +122 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/lib/RubyPackager/ReleaseInfo.rb +227 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/lib/RubyPackager/Releaser.rb +447 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/lib/RubyPackager/Tools.rb +72 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/lib/RubyPackager/i386-mswin32/Installers/NSIS.rb +60 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/lib/RubyPackager/i386-mswin32/PlatformReleaser.rb +173 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/lib/RubyPackager/i386-mswin32/edicon/edicon.exe +0 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/test/Applications/Basic/Distribution/ReleaseInfo.rb +16 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/test/Applications/Basic/Distribution/i386-mswin32/Icon.ico +0 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/test/Applications/Basic/Distribution/i386-mswin32/Installer/Icon.ico +0 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/test/Applications/Basic/Distribution/i386-mswin32/Installer/InstallLicense.txt +31 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/test/Applications/Basic/Distribution/i386-mswin32/Installer/install.nsi +51 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/test/Applications/Basic/Main.rb +8 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/test/Common.rb +50 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/test/i386-mswin32/run.rb +19 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/test/run.rb +19 -0
- data/test/run.rb +19 -0
- metadata +87 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
= RubyPackager Release History
|
2
|
+
|
3
|
+
== 0.1.0.20091021 (Alpha)
|
4
|
+
|
5
|
+
* Implemented release of libraries as well.
|
6
|
+
* Implemented generation of Installers.
|
7
|
+
* Implemented distribution to third parties (SourceForge...).
|
8
|
+
* Harmonized the way ReleaseInfo are described (!!! complete change with no compatibility with previous format).
|
9
|
+
* Plugins architecture for Installers and Distributors.
|
10
|
+
* Removed .rb suffixes in required files (better migration to .so if needed).
|
11
|
+
* Removed references to PBS.
|
12
|
+
* Bug correction: Dir.glob does not work correctly with '\'.
|
13
|
+
* Bug correction: Application specific checks for tools were ignored.
|
14
|
+
|
15
|
+
== 0.0.1.20090819 (Alpha)
|
16
|
+
|
17
|
+
* Initial public release.
|
@@ -0,0 +1,35 @@
|
|
1
|
+
= Projects used by RubyPackager
|
2
|
+
|
3
|
+
== AllInOneRuby
|
4
|
+
* Erik Veenstra <allinoneruby@erikveen.dds.nl>
|
5
|
+
* http://rubyforge.org/projects/allinoneruby/
|
6
|
+
* Used to release Ruby for platforms missing Ruby
|
7
|
+
|
8
|
+
== Exerb
|
9
|
+
* Yuya Kato <yuyakato@gmail.com>
|
10
|
+
* http://exerb.sourceforge.jp/index.en.html
|
11
|
+
* Used to create the executable entry point
|
12
|
+
|
13
|
+
== NSIS
|
14
|
+
* kichik@users.sourceforge.net
|
15
|
+
* http://nsis.sourceforge.net
|
16
|
+
* Used to create the installer for Windows
|
17
|
+
|
18
|
+
== Ocra
|
19
|
+
* Lars Christensen
|
20
|
+
* http://rubyforge.org/projects/ocra/
|
21
|
+
* Used its edicon utility to change executable icon
|
22
|
+
|
23
|
+
== Ruby
|
24
|
+
* Yukihiro « matz » Matsumoto (http://www.rubyist.net/~matz/)
|
25
|
+
* http://www.ruby-lang.org/
|
26
|
+
* Used to develop RubyPackager. Thanks a lot Matz for this truly wonderful language !
|
27
|
+
|
28
|
+
== RubyGems
|
29
|
+
* Paul Duncan <pabs@pablotron.org>
|
30
|
+
* http://rubygems.org/
|
31
|
+
* Used to automatically download Gem dependencies
|
32
|
+
|
33
|
+
= People that helped a lot in developing RubyPackager
|
34
|
+
|
35
|
+
* Jeremy Hinegardner <jeremy@hinegardner.org>, for his wonderful project Crate (http://copiousfreetime.rubyforge.org/crate/) that should be the next standard in shipping cross-platform ruby applications
|
@@ -0,0 +1,31 @@
|
|
1
|
+
|
2
|
+
The license stated herein is a copy of the BSD License (modified on July 1999).
|
3
|
+
The AUTHOR mentionned below refers to the list of people involved in the
|
4
|
+
creation and modification of any file included in the delivered package.
|
5
|
+
This list is found in the file named AUTHORS.
|
6
|
+
The AUTHORS and LICENSE files have to be included in any release of software
|
7
|
+
embedding source code of this package, or using it as a derivative software.
|
8
|
+
|
9
|
+
Copyright (c) 2009 Muriel Salvan (murielsalvan@users.sourceforge.net)
|
10
|
+
|
11
|
+
Redistribution and use in source and binary forms, with or without
|
12
|
+
modification, are permitted provided that the following conditions are met:
|
13
|
+
|
14
|
+
1. Redistributions of source code must retain the above copyright notice,
|
15
|
+
this list of conditions and the following disclaimer.
|
16
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
17
|
+
this list of conditions and the following disclaimer in the documentation
|
18
|
+
and/or other materials provided with the distribution.
|
19
|
+
3. The name of the author may not be used to endorse or promote products
|
20
|
+
derived from this software without specific prior written permission.
|
21
|
+
|
22
|
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
23
|
+
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
24
|
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
25
|
+
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
26
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
27
|
+
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
28
|
+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
29
|
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
30
|
+
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
31
|
+
OF SUCH DAMAGE.
|
@@ -0,0 +1,18 @@
|
|
1
|
+
-- This file is best viewed when processed by rdoc.
|
2
|
+
++
|
3
|
+
|
4
|
+
= RubyPackager
|
5
|
+
|
6
|
+
Packaging your Ruby applications on any platform.
|
7
|
+
|
8
|
+
== Where is the documentation ?
|
9
|
+
|
10
|
+
Check the website at http://rubypackager.sourceforge.net
|
11
|
+
|
12
|
+
== Who wrote it ?
|
13
|
+
|
14
|
+
Check the AUTHORS[link:files/AUTHORS.html] file.
|
15
|
+
|
16
|
+
== What is the license ?
|
17
|
+
|
18
|
+
You can find out in the LICENSE[link:files/LICENSE.html] file.
|
@@ -0,0 +1,159 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2009 Muriel Salvan (murielsalvan@users.sourceforge.net)
|
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 SourceForge
|
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 checkTools
|
21
|
+
rSuccess = true
|
22
|
+
|
23
|
+
begin
|
24
|
+
require 'net/ssh'
|
25
|
+
rescue Exception
|
26
|
+
puts '!!! Missing net/ssh library. gem install net-ssh.'
|
27
|
+
rSuccess = false
|
28
|
+
end
|
29
|
+
begin
|
30
|
+
require 'net/scp'
|
31
|
+
rescue Exception
|
32
|
+
puts '!!! Missing net/scp library. gem install net-scp.'
|
33
|
+
rSuccess = false
|
34
|
+
end
|
35
|
+
if (!system('zip -v'))
|
36
|
+
puts '!!! Missing zip command-line utility.'
|
37
|
+
rSuccess = false
|
38
|
+
end
|
39
|
+
|
40
|
+
return rSuccess
|
41
|
+
end
|
42
|
+
|
43
|
+
# Distribute what has been generated
|
44
|
+
#
|
45
|
+
# Parameters:
|
46
|
+
# * *iInstallerDir* (_String_): Directory where installers are generated
|
47
|
+
# * *iReleaseVersion* (_String_): Release version
|
48
|
+
# * *iReleaseInfo* (_ReleaseInfo_): Release info
|
49
|
+
# * *iGeneratedFileNames* (<em>list<String></em>): List of files to distribute
|
50
|
+
# * *iDocDir* (_String_): Directory where the documentation has been generated
|
51
|
+
# Return:
|
52
|
+
# * _Boolean_: Success ?
|
53
|
+
def distribute(iInstallerDir, iReleaseVersion, iReleaseInfo, iGeneratedFileNames, iDocDir)
|
54
|
+
rSuccess = true
|
55
|
+
|
56
|
+
@InstallerDir, @ReleaseVersion, @ReleaseInfo, @GeneratedFileNames, @DocDir = iInstallerDir, iReleaseVersion, iReleaseInfo, iGeneratedFileNames, iDocDir
|
57
|
+
@SFProjectSubPath = "#{@ReleaseInfo.SFInfo[:ProjectUnixName][0..0]}/#{@ReleaseInfo.SFInfo[:ProjectUnixName][0..1]}/#{@ReleaseInfo.SFInfo[:ProjectUnixName]}"
|
58
|
+
@SFLogin = "#{@ReleaseInfo.SFInfo[:Login]},#{@ReleaseInfo.SFInfo[:ProjectUnixName]}"
|
59
|
+
@SFReleaseDir = "/home/frs/project/#{@SFProjectSubPath}/#{@ReleaseVersion}"
|
60
|
+
createSFShell
|
61
|
+
createReleaseOnSFNET
|
62
|
+
uploadRDocOnSFNET
|
63
|
+
uploadReleaseNoteOnSFNET
|
64
|
+
uploadFilesOnSFNET
|
65
|
+
|
66
|
+
return rSuccess
|
67
|
+
end
|
68
|
+
|
69
|
+
private
|
70
|
+
|
71
|
+
# Create a Shell for SF.NET
|
72
|
+
def createSFShell
|
73
|
+
sshWithPassword(
|
74
|
+
'shell.sourceforge.net',
|
75
|
+
@SFLogin,
|
76
|
+
'create'
|
77
|
+
)
|
78
|
+
end
|
79
|
+
|
80
|
+
# Shutdown a Shell for SF.NET
|
81
|
+
def shutdownSFShell
|
82
|
+
sshWithPassword(
|
83
|
+
'shell.sourceforge.net',
|
84
|
+
@SFLogin,
|
85
|
+
'shutdown'
|
86
|
+
)
|
87
|
+
end
|
88
|
+
|
89
|
+
# Upload the RDoc on SF.NET
|
90
|
+
def uploadRDocOnSFNET
|
91
|
+
puts 'Uploading RDoc on SF.NET ...'
|
92
|
+
# Zip the RDoc
|
93
|
+
lOldDir = Dir.getwd
|
94
|
+
Dir.chdir(@DocDir)
|
95
|
+
system("zip -r rdoc.zip rdoc")
|
96
|
+
Dir.chdir(lOldDir)
|
97
|
+
# Send it
|
98
|
+
lRDocBaseDir = "/home/groups/#{@SFProjectSubPath}/htdocs/rdoc"
|
99
|
+
sshWithPassword(
|
100
|
+
'shell.sourceforge.net',
|
101
|
+
@SFLogin,
|
102
|
+
"mkdir -p #{lRDocBaseDir}"
|
103
|
+
)
|
104
|
+
scpWithPassword(
|
105
|
+
'shell.sourceforge.net',
|
106
|
+
@SFLogin,
|
107
|
+
"#{@DocDir}/rdoc.zip",
|
108
|
+
"#{lRDocBaseDir}/rdoc-#{@ReleaseVersion}.zip"
|
109
|
+
)
|
110
|
+
# Execute its uncompress remotely
|
111
|
+
sshWithPassword(
|
112
|
+
'shell.sourceforge.net',
|
113
|
+
@SFLogin,
|
114
|
+
"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"
|
115
|
+
)
|
116
|
+
# Remove temporary file
|
117
|
+
File.unlink("#{@DocDir}/rdoc.zip")
|
118
|
+
end
|
119
|
+
|
120
|
+
# Create the release on SF.NET
|
121
|
+
def createReleaseOnSFNET
|
122
|
+
puts 'Creating Release on SF.NET ...'
|
123
|
+
sshWithPassword(
|
124
|
+
'shell.sourceforge.net',
|
125
|
+
@SFLogin,
|
126
|
+
"mkdir -p #{@SFReleaseDir}"
|
127
|
+
)
|
128
|
+
end
|
129
|
+
|
130
|
+
# Upload the generated files on SF.NET
|
131
|
+
def uploadFilesOnSFNET
|
132
|
+
@GeneratedFileNames.each do |iFileName|
|
133
|
+
puts "Uploading #{iFileName} on SF.NET ..."
|
134
|
+
scpWithPassword(
|
135
|
+
'shell.sourceforge.net',
|
136
|
+
@SFLogin,
|
137
|
+
"#{@InstallerDir}/#{iFileName}",
|
138
|
+
"#{@SFReleaseDir}/#{iFileName}"
|
139
|
+
)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
# Upload the Release note on SF.NET
|
144
|
+
def uploadReleaseNoteOnSFNET
|
145
|
+
puts 'Uploading Release Note on SF.NET ...'
|
146
|
+
scpWithPassword(
|
147
|
+
'shell.sourceforge.net',
|
148
|
+
@SFLogin,
|
149
|
+
"#{@DocDir}/ReleaseNote.html",
|
150
|
+
"#{@SFReleaseDir}/ReleaseNote.html"
|
151
|
+
)
|
152
|
+
puts '!!! DON\'T FORGET to make association between ReleaseNote and Gem in SF.NET'
|
153
|
+
end
|
154
|
+
|
155
|
+
end
|
156
|
+
|
157
|
+
end
|
158
|
+
|
159
|
+
end
|
@@ -0,0 +1,122 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2009 Muriel Salvan (murielsalvan@users.sourceforge.net)
|
3
|
+
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
|
+
#++
|
5
|
+
|
6
|
+
module RubyPackager
|
7
|
+
|
8
|
+
module Installers
|
9
|
+
|
10
|
+
class Gem
|
11
|
+
|
12
|
+
# Check that we can use this installer
|
13
|
+
#
|
14
|
+
# Return:
|
15
|
+
# * _Boolean_: Can we use this installer ?
|
16
|
+
def checkTools
|
17
|
+
return true
|
18
|
+
end
|
19
|
+
|
20
|
+
# Create the installer with everything in the release directory.
|
21
|
+
#
|
22
|
+
# Parameters:
|
23
|
+
# * *iRootDir* (_String_): The Root directory
|
24
|
+
# * *iReleaseDir* (_String_): The release directory (all files to put in the installer are there)
|
25
|
+
# * *iInstallerDir* (_String_): The directory where the installer has to be put
|
26
|
+
# * *iVersion* (_String_): Release version
|
27
|
+
# * *iReleaseInfo* (_ReleaseInfo_): Release info
|
28
|
+
# Return:
|
29
|
+
# * _String_: File name to distribute, or nil in case of failure
|
30
|
+
def createInstaller(iRootDir, iReleaseDir, iInstallerDir, iVersion, iReleaseInfo)
|
31
|
+
rFileName = nil
|
32
|
+
|
33
|
+
# 1. Generate the gemspec that will build the gem
|
34
|
+
lStrHasRDoc = nil
|
35
|
+
if (iReleaseInfo.GemInfo[:HasRDoc])
|
36
|
+
lStrHasRDoc = 'true'
|
37
|
+
else
|
38
|
+
lStrHasRDoc = 'false'
|
39
|
+
end
|
40
|
+
lFilesFilter = "#{iReleaseDir}/**/*"
|
41
|
+
lStrFiles = "iSpec.files = [ '#{Dir.glob(lFilesFilter).join('\', \'')}' ]"
|
42
|
+
lStrExtraRDocFiles = ''
|
43
|
+
if ((iReleaseInfo.GemInfo[:ExtraRDocFiles] != nil) and
|
44
|
+
(!iReleaseInfo.GemInfo[:ExtraRDocFiles].empty?))
|
45
|
+
lStrExtraRDocFiles = "iSpec.extra_rdoc_files = [ '#{@Description[:ExtraRDocFiles].join('\', \'')}' ]"
|
46
|
+
RubyPackager::copyFiles(iRootDir, iReleaseDir, iReleaseInfo.GemInfo[:ExtraRDocFiles])
|
47
|
+
end
|
48
|
+
lGemDepsStrList = []
|
49
|
+
if (iReleaseInfo.GemInfo[:GemDependencies] != nil)
|
50
|
+
iReleaseInfo.GemInfo[:GemDependencies].each do |iGemDepInfo|
|
51
|
+
iGemName, iGemVersion = iGemDepInfo
|
52
|
+
if (iGemVersion != nil)
|
53
|
+
lGemDepsStrList << "iSpec.add_dependency('#{iGemName}', '#{iGemVersion}')"
|
54
|
+
else
|
55
|
+
lGemDepsStrList << "iSpec.add_dependency('#{iGemName}')"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
lStrTestFile = ''
|
60
|
+
if (iReleaseInfo.GemInfo[:TestFile] != nil)
|
61
|
+
lStrTestFile = "iSpec.test_file = '#{iReleaseInfo.GemInfo[:TestFile]}'"
|
62
|
+
end
|
63
|
+
lStrBinDir = ''
|
64
|
+
lStrDefaultExecutable = ''
|
65
|
+
if (iReleaseInfo.ExecutableInfo[:StartupRBFile] != nil)
|
66
|
+
lStrBinDir = "iSpec.bindir = '#{File.dirname(iReleaseInfo.ExecutableInfo[:StartupRBFile])}'"
|
67
|
+
lStrDefaultExecutable = "iSpec.default_executable = '#{File.basename(iReleaseInfo.ExecutableInfo[:StartupRBFile])}'"
|
68
|
+
end
|
69
|
+
lGemSpecFileName = 'release.gemspec.rb'
|
70
|
+
File.open(lGemSpecFileName, 'w') do |oFile|
|
71
|
+
oFile << "
|
72
|
+
Gem::Specification.new do |iSpec|
|
73
|
+
iSpec.name = '#{iReleaseInfo.GemInfo[:GemName]}'
|
74
|
+
iSpec.version = '#{iVersion}'
|
75
|
+
iSpec.author = '#{iReleaseInfo.AuthorInfo[:Name].gsub(/'/,'\\\\\'')}'
|
76
|
+
iSpec.email = '#{iReleaseInfo.AuthorInfo[:EMail]}'
|
77
|
+
iSpec.homepage = '#{iReleaseInfo.ProjectInfo[:WebPageURL]}'
|
78
|
+
iSpec.platform = #{iReleaseInfo.GemInfo[:GemPlatformClassName]}
|
79
|
+
iSpec.summary = '#{iReleaseInfo.ProjectInfo[:Summary].gsub(/'/,'\\\\\'')}'
|
80
|
+
iSpec.description = '#{iReleaseInfo.ProjectInfo[:Description].gsub(/'/,'\\\\\'')}'
|
81
|
+
#{lStrFiles}
|
82
|
+
iSpec.require_path = '#{iReleaseInfo.GemInfo[:RequirePath]}'
|
83
|
+
iSpec.has_rdoc = #{lStrHasRDoc}
|
84
|
+
#{lStrExtraRDocFiles}
|
85
|
+
iSpec.rubyforge_project = '#{iReleaseInfo.RFInfo[:ProjectUnixName]}'
|
86
|
+
#{lStrTestFile}
|
87
|
+
#{lStrBinDir}
|
88
|
+
#{lStrDefaultExecutable}
|
89
|
+
#{lGemDepsStrList.join("\n")}
|
90
|
+
end
|
91
|
+
"
|
92
|
+
end
|
93
|
+
# 2. Call gem build with this gemspec
|
94
|
+
# Load RubyGems
|
95
|
+
require 'rubygems/command_manager'
|
96
|
+
# Build gem
|
97
|
+
lGemOK = true
|
98
|
+
begin
|
99
|
+
::Gem::CommandManager.instance.find_command('build').invoke(lGemSpecFileName)
|
100
|
+
rescue ::Gem::SystemExitException
|
101
|
+
# For RubyGems, this is normal behaviour: success results in an exception thrown with exit_code 0.
|
102
|
+
if ($!.exit_code != 0)
|
103
|
+
puts "!!! RubyGems returned error #{$!.exit_code}."
|
104
|
+
lGemOK = false
|
105
|
+
end
|
106
|
+
end
|
107
|
+
File.unlink(lGemSpecFileName)
|
108
|
+
if (lGemOK)
|
109
|
+
# Move the Gem to the destination directory
|
110
|
+
require 'fileutils'
|
111
|
+
rFileName = "#{iReleaseInfo.GemInfo[:GemName]}-#{iVersion}.gem"
|
112
|
+
FileUtils::mv(rFileName, "#{iInstallerDir}/#{rFileName}")
|
113
|
+
end
|
114
|
+
|
115
|
+
return rFileName
|
116
|
+
end
|
117
|
+
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
121
|
+
|
122
|
+
end
|
@@ -0,0 +1,227 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2009 Muriel Salvan (murielsalvan@users.sourceforge.net)
|
3
|
+
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
|
+
#++
|
5
|
+
|
6
|
+
module RubyPackager
|
7
|
+
|
8
|
+
# This class is the base class of all releases info to be provided by packages.
|
9
|
+
class ReleaseInfo
|
10
|
+
|
11
|
+
# Information about the author
|
12
|
+
# map< Symbol, Object >
|
13
|
+
attr_reader :AuthorInfo
|
14
|
+
|
15
|
+
# Information about the project
|
16
|
+
# map< Symbol, Object >
|
17
|
+
attr_reader :ProjectInfo
|
18
|
+
|
19
|
+
# Information about the executable
|
20
|
+
# map< Symbol, Object >
|
21
|
+
attr_reader :ExecutableInfo
|
22
|
+
|
23
|
+
# Information about the installer
|
24
|
+
# map< Symbol, Object >
|
25
|
+
attr_reader :InstallInfo
|
26
|
+
|
27
|
+
# Information about SourceForge
|
28
|
+
# map< Symbol, Object >
|
29
|
+
attr_reader :SFInfo
|
30
|
+
|
31
|
+
# Information about RubyForge
|
32
|
+
# map< Symbol, Object >
|
33
|
+
attr_reader :RFInfo
|
34
|
+
|
35
|
+
# Information about the Gem
|
36
|
+
# map< Symbol, Object >
|
37
|
+
attr_reader :GemInfo
|
38
|
+
|
39
|
+
# List of core files patterns
|
40
|
+
# list< String >
|
41
|
+
attr_reader :CoreFiles
|
42
|
+
|
43
|
+
# List of additional files patterns
|
44
|
+
# list< String >
|
45
|
+
attr_reader :AdditionalFiles
|
46
|
+
|
47
|
+
# List of test files patterns
|
48
|
+
# list< String >
|
49
|
+
attr_reader :TestFiles
|
50
|
+
|
51
|
+
# Check if the tools needed for the release are ok
|
52
|
+
# This is meant to be overriden if needed
|
53
|
+
#
|
54
|
+
# Parameters:
|
55
|
+
# * *iRootDir* (_String_): Root directory from where the release is happening
|
56
|
+
# Return:
|
57
|
+
# * _Boolean_: Success ?
|
58
|
+
def checkTools(iRootDir)
|
59
|
+
return true
|
60
|
+
end
|
61
|
+
|
62
|
+
# Constructor
|
63
|
+
def initialize
|
64
|
+
# This sets also default values
|
65
|
+
@AuthorInfo = {}
|
66
|
+
@ProjectInfo = {}
|
67
|
+
@ExecutableInfo = {}
|
68
|
+
@InstallInfo = {}
|
69
|
+
@SFInfo = {}
|
70
|
+
@RFInfo = {}
|
71
|
+
@GemInfo = {}
|
72
|
+
# Files patterns list
|
73
|
+
@CoreFiles = []
|
74
|
+
@AdditionalFiles = []
|
75
|
+
@TestFiles = []
|
76
|
+
end
|
77
|
+
|
78
|
+
# Add Author properties
|
79
|
+
#
|
80
|
+
# Parameters:
|
81
|
+
# * *iParams* (<em>map<Symbol,Object></em>): The parameters:
|
82
|
+
# ** *:Name* (_String_): The author name
|
83
|
+
# ** *:EMail* (_String_): The author's email
|
84
|
+
# ** *:WebPageURL* (_String_): The author's web page
|
85
|
+
# Return:
|
86
|
+
# * _ReleaseInfo_: self
|
87
|
+
def author(iParams)
|
88
|
+
@AuthorInfo.merge!(iParams)
|
89
|
+
|
90
|
+
return self
|
91
|
+
end
|
92
|
+
|
93
|
+
# Add Project properties
|
94
|
+
#
|
95
|
+
# Parameters:
|
96
|
+
# * *iParams* (<em>map<Symbol,Object></em>): The parameters:
|
97
|
+
# ** *:Name* (_String_): Project name
|
98
|
+
# ** *:WebPageURL* (_String_): Project home page
|
99
|
+
# ** *:Summary* (_String_): Project Summary
|
100
|
+
# ** *:Description* (_String_): Project description
|
101
|
+
# ** *:ImageURL* (_String_): URL of the project's image
|
102
|
+
# ** *:FaviconURL* (_String_): URL of the project's favicon
|
103
|
+
# ** *:SVNBrowseURL* (_String_): URL of the SVN browse
|
104
|
+
# ** *:DevStatus* (_String_): Development status
|
105
|
+
# Return:
|
106
|
+
# * _ReleaseInfo_: self
|
107
|
+
def project(iParams)
|
108
|
+
@ProjectInfo.merge!(iParams)
|
109
|
+
|
110
|
+
return self
|
111
|
+
end
|
112
|
+
|
113
|
+
# Add executable package properties
|
114
|
+
#
|
115
|
+
# Parameters:
|
116
|
+
# * *iParams* (<em>map<Symbol,Object></em>): The parameters:
|
117
|
+
# ** *:StartupRBFile* (_String_): Name of RB file to execute as startup file.
|
118
|
+
# ** *:ExeName* (_String_): Name of executable file to produce.
|
119
|
+
# ** *:IconName* (_String_): Name of the executable icon.
|
120
|
+
# ** *:TerminalApplication* (_Boolean_): Does this binary execute in a terminal ?
|
121
|
+
# Return:
|
122
|
+
# * _ReleaseInfo_: self
|
123
|
+
def executable(iParams)
|
124
|
+
@ExecutableInfo.merge!(iParams)
|
125
|
+
|
126
|
+
return self
|
127
|
+
end
|
128
|
+
|
129
|
+
# Add installer properties
|
130
|
+
#
|
131
|
+
# Parameters:
|
132
|
+
# * *iParams* (<em>map<Symbol,Object></em>): The parameters:
|
133
|
+
# ** *:NSISFileName* (_String_): Name of the NSI file to use to generate the installer
|
134
|
+
# Return:
|
135
|
+
# * _ReleaseInfo_: self
|
136
|
+
def install(iParams)
|
137
|
+
@InstallInfo.merge!(iParams)
|
138
|
+
|
139
|
+
return self
|
140
|
+
end
|
141
|
+
|
142
|
+
# Add SF.NET properties
|
143
|
+
#
|
144
|
+
# Parameters:
|
145
|
+
# * *iParams* (<em>map<Symbol,Object></em>): The parameters:
|
146
|
+
# ** *:Login* (_String_): The releaser's SF.NET login
|
147
|
+
# ** *:ProjectUnixName* (_String_): Unix name of the SF project
|
148
|
+
# Return:
|
149
|
+
# * _ReleaseInfo_: self
|
150
|
+
def sourceForge(iParams)
|
151
|
+
@SFInfo.merge!(iParams)
|
152
|
+
|
153
|
+
return self
|
154
|
+
end
|
155
|
+
|
156
|
+
# Add RubyForge properties
|
157
|
+
#
|
158
|
+
# Parameters:
|
159
|
+
# * *iParams* (<em>map<Symbol,Object></em>): The parameters:
|
160
|
+
# ** *:Login* (_String_): The releaser's RubyForge login
|
161
|
+
# ** *:ProjectUnixName* (_String_): Unix name of the RubyForge project
|
162
|
+
# Return:
|
163
|
+
# * _ReleaseInfo_: self
|
164
|
+
def rubyForge(iParams)
|
165
|
+
@RFInfo.merge!(iParams)
|
166
|
+
|
167
|
+
return self
|
168
|
+
end
|
169
|
+
|
170
|
+
# Add Gem properties
|
171
|
+
#
|
172
|
+
# Parameters:
|
173
|
+
# * *iParams* (<em>map<Symbol,Object></em>): The parameters:
|
174
|
+
# ** *:GemName* (_String_): The Gem name
|
175
|
+
# ** *:GemPlatformClassName* (_String_): The name of the Gem platform class
|
176
|
+
# ** *:RequirePath* (_String_): Path to require
|
177
|
+
# ** *:HasRDoc* (_String_): Include RDoc in the Gem ?
|
178
|
+
# ** *:ExtraRDocFiles* (<em>list<String></em>): List of file patterns to be included in the RDoc but not in the Gem
|
179
|
+
# ** *:TestFile* (_String_): Name of the test file to execute
|
180
|
+
# ** *:GemDependencies* (<em>list<[String,String]></em>): List of [ Gem, Version criteria ] this Gem depends on
|
181
|
+
# Return:
|
182
|
+
# * _ReleaseInfo_: self
|
183
|
+
def gem(iParams)
|
184
|
+
@GemInfo.merge!(iParams)
|
185
|
+
|
186
|
+
return self
|
187
|
+
end
|
188
|
+
|
189
|
+
# Add core files patterns
|
190
|
+
#
|
191
|
+
# Parameters:
|
192
|
+
# * *iFilesPatternsList* (<em>list<String></em>): The list of files patterns to add
|
193
|
+
# Return:
|
194
|
+
# * _ReleaseInfo_: self
|
195
|
+
def addCoreFiles(iFilesPatternsList)
|
196
|
+
@CoreFiles.concat(iFilesPatternsList)
|
197
|
+
|
198
|
+
return self
|
199
|
+
end
|
200
|
+
|
201
|
+
# Add additional files patterns
|
202
|
+
#
|
203
|
+
# Parameters:
|
204
|
+
# * *iFilesPatternsList* (<em>list<String></em>): The list of files patterns to add
|
205
|
+
# Return:
|
206
|
+
# * _ReleaseInfo_: self
|
207
|
+
def addAdditionalFiles(iFilesPatternsList)
|
208
|
+
@AdditionalFiles.concat(iFilesPatternsList)
|
209
|
+
|
210
|
+
return self
|
211
|
+
end
|
212
|
+
|
213
|
+
# Add test files patterns
|
214
|
+
#
|
215
|
+
# Parameters:
|
216
|
+
# * *iFilesPatternsList* (<em>list<String></em>): The list of files patterns to add
|
217
|
+
# Return:
|
218
|
+
# * _ReleaseInfo_: self
|
219
|
+
def addTestFiles(iFilesPatternsList)
|
220
|
+
@TestFiles.concat(iFilesPatternsList)
|
221
|
+
|
222
|
+
return self
|
223
|
+
end
|
224
|
+
|
225
|
+
end
|
226
|
+
|
227
|
+
end
|