buildrizpack 0.2-java → 0.2.1-java

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/buildrizpack.gemspec CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  Gem::Specification.new do |spec|
18
18
  spec.name = 'buildrizpack'
19
- spec.version = '0.2'
19
+ spec.version = '0.2.1'
20
20
  spec.author = 'Niklaus Giger'
21
21
  spec.email = "niklaus.giger@member.fsf.org"
22
22
  spec.homepage = "http://buildr.apache.org/"
@@ -36,41 +36,20 @@ TEXT
36
36
  spec.rdoc_options = '--title', 'BuildrIzPack', '--main', 'README.rdoc',
37
37
  '--webcvs', 'http://github.com/ngiger/buildrizpack'
38
38
  spec.post_install_message = "To get started run buildr --help"
39
- spec.add_dependency 'rake', '0.8.7'
40
- # spec.add_dependency 'buildr', '>=1.4.6'
41
- spec.add_dependency 'builder', '2.1.2'
42
- spec.add_dependency 'net-ssh', '2.0.23'
43
- spec.add_dependency 'net-sftp', '2.0.4'
44
- spec.add_dependency 'rubyzip', '0.9.4'
45
- spec.add_dependency 'highline', '1.5.1'
46
- spec.add_dependency 'json_pure', '1.4.3'
47
- spec.add_dependency 'rubyforge', '2.0.3'
48
- spec.add_dependency 'hoe', '2.3.3'
49
- spec.add_dependency 'rjb', '1.3.3' if spec.platform.to_s == 'ruby'
50
- spec.add_dependency 'rjb', '1.3.2' if spec.platform.to_s == 'x86-mswin32'
51
- spec.add_dependency 'atoulme-Antwrap', '0.7.1'
52
- spec.add_dependency 'diff-lcs', '1.1.2'
53
- spec.add_dependency 'rspec-expectations', '2.1.0'
54
- spec.add_dependency 'rspec-mocks', '2.1.0'
55
- spec.add_dependency 'rspec-core', '2.1.0'
56
- spec.add_dependency 'rspec', '2.1.0'
57
- spec.add_dependency 'xml-simple', '1.0.12'
58
- spec.add_dependency 'minitar', '0.5.3'
59
- spec.add_dependency 'jruby-openssl', '>= 0.7' if spec.platform.to_s == 'java'
39
+ # Tested against these dependencies.
40
+ spec.add_dependency 'rake', '>=0.9.2.2'
41
+ spec.add_dependency 'builder', '>=1.4.6'
60
42
 
61
- spec.add_development_dependency 'rdoc', '>=3.8'
62
- spec.add_development_dependency 'rcov', '0.9.9'
63
43
 
64
- spec.add_development_dependency 'ci_reporter', '1.6.3'
65
- spec.add_development_dependency 'sdoc'
66
- # spec.add_development_dependency 'psych', '>=1.3.0' if spec.platform.to_s != 'java' and !/1.8.\d/.match(RUBY_VERSION)
67
- # spec.add_development_dependency 'debugger'
68
- spec.add_development_dependency 'readline-ffi'
69
- spec.add_development_dependency 'pygmentize'
70
-
71
- spec.add_development_dependency 'bundler'
72
- spec.add_development_dependency 'win32console' if spec.platform.to_s == 'x86-mswin32'
73
- spec.add_development_dependency 'rubyforge'
44
+ # The documentation is currently not generated whe building via jruby
45
+ unless $platform.to_s == 'java'
46
+ spec.add_development_dependency 'pygmentize'
47
+ spec.add_development_dependency 'jekyll', '0.11.2'
48
+ spec.add_development_dependency 'RedCloth', '4.2.9'
49
+ spec.add_development_dependency 'jekylltask', '1.1.0'
50
+ spec.add_development_dependency 'rdoc', '3.8'
51
+ spec.add_development_dependency 'rcov', '0.9.9'
52
+ end
74
53
 
75
54
  # signing key and certificate chain
76
55
  spec.signing_key = '/mnt/Keys/gem-private_key.pem' if false
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: buildrizpack
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: "0.2"
5
+ version: 0.2.1
6
6
  platform: java
7
7
  authors:
8
8
  - Niklaus Giger
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain:
12
12
  - gem-public_cert.pem
13
- date: 2012-04-30 00:00:00 Z
13
+ date: 2012-07-18 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
@@ -18,9 +18,9 @@ dependencies:
18
18
  requirement: &id001 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
- - - "="
21
+ - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 0.8.7
23
+ version: 0.9.2.2
24
24
  type: :runtime
25
25
  version_requirements: *id001
26
26
  - !ruby/object:Gem::Dependency
@@ -29,275 +29,77 @@ dependencies:
29
29
  requirement: &id002 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
- - - "="
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: 2.1.2
34
+ version: 1.4.6
35
35
  type: :runtime
36
36
  version_requirements: *id002
37
37
  - !ruby/object:Gem::Dependency
38
- name: net-ssh
38
+ name: pygmentize
39
39
  prerelease: false
40
40
  requirement: &id003 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - "="
43
+ - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: 2.0.23
46
- type: :runtime
45
+ version: "0"
46
+ type: :development
47
47
  version_requirements: *id003
48
48
  - !ruby/object:Gem::Dependency
49
- name: net-sftp
49
+ name: jekyll
50
50
  prerelease: false
51
51
  requirement: &id004 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - "="
55
55
  - !ruby/object:Gem::Version
56
- version: 2.0.4
57
- type: :runtime
56
+ version: 0.11.2
57
+ type: :development
58
58
  version_requirements: *id004
59
59
  - !ruby/object:Gem::Dependency
60
- name: rubyzip
60
+ name: RedCloth
61
61
  prerelease: false
62
62
  requirement: &id005 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - "="
66
66
  - !ruby/object:Gem::Version
67
- version: 0.9.4
68
- type: :runtime
67
+ version: 4.2.9
68
+ type: :development
69
69
  version_requirements: *id005
70
70
  - !ruby/object:Gem::Dependency
71
- name: highline
71
+ name: jekylltask
72
72
  prerelease: false
73
73
  requirement: &id006 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - "="
77
77
  - !ruby/object:Gem::Version
78
- version: 1.5.1
79
- type: :runtime
78
+ version: 1.1.0
79
+ type: :development
80
80
  version_requirements: *id006
81
81
  - !ruby/object:Gem::Dependency
82
- name: json_pure
82
+ name: rdoc
83
83
  prerelease: false
84
84
  requirement: &id007 !ruby/object:Gem::Requirement
85
85
  none: false
86
86
  requirements:
87
87
  - - "="
88
- - !ruby/object:Gem::Version
89
- version: 1.4.3
90
- type: :runtime
91
- version_requirements: *id007
92
- - !ruby/object:Gem::Dependency
93
- name: rubyforge
94
- prerelease: false
95
- requirement: &id008 !ruby/object:Gem::Requirement
96
- none: false
97
- requirements:
98
- - - "="
99
- - !ruby/object:Gem::Version
100
- version: 2.0.3
101
- type: :runtime
102
- version_requirements: *id008
103
- - !ruby/object:Gem::Dependency
104
- name: hoe
105
- prerelease: false
106
- requirement: &id009 !ruby/object:Gem::Requirement
107
- none: false
108
- requirements:
109
- - - "="
110
- - !ruby/object:Gem::Version
111
- version: 2.3.3
112
- type: :runtime
113
- version_requirements: *id009
114
- - !ruby/object:Gem::Dependency
115
- name: atoulme-Antwrap
116
- prerelease: false
117
- requirement: &id010 !ruby/object:Gem::Requirement
118
- none: false
119
- requirements:
120
- - - "="
121
- - !ruby/object:Gem::Version
122
- version: 0.7.1
123
- type: :runtime
124
- version_requirements: *id010
125
- - !ruby/object:Gem::Dependency
126
- name: diff-lcs
127
- prerelease: false
128
- requirement: &id011 !ruby/object:Gem::Requirement
129
- none: false
130
- requirements:
131
- - - "="
132
- - !ruby/object:Gem::Version
133
- version: 1.1.2
134
- type: :runtime
135
- version_requirements: *id011
136
- - !ruby/object:Gem::Dependency
137
- name: rspec-expectations
138
- prerelease: false
139
- requirement: &id012 !ruby/object:Gem::Requirement
140
- none: false
141
- requirements:
142
- - - "="
143
- - !ruby/object:Gem::Version
144
- version: 2.1.0
145
- type: :runtime
146
- version_requirements: *id012
147
- - !ruby/object:Gem::Dependency
148
- name: rspec-mocks
149
- prerelease: false
150
- requirement: &id013 !ruby/object:Gem::Requirement
151
- none: false
152
- requirements:
153
- - - "="
154
- - !ruby/object:Gem::Version
155
- version: 2.1.0
156
- type: :runtime
157
- version_requirements: *id013
158
- - !ruby/object:Gem::Dependency
159
- name: rspec-core
160
- prerelease: false
161
- requirement: &id014 !ruby/object:Gem::Requirement
162
- none: false
163
- requirements:
164
- - - "="
165
- - !ruby/object:Gem::Version
166
- version: 2.1.0
167
- type: :runtime
168
- version_requirements: *id014
169
- - !ruby/object:Gem::Dependency
170
- name: rspec
171
- prerelease: false
172
- requirement: &id015 !ruby/object:Gem::Requirement
173
- none: false
174
- requirements:
175
- - - "="
176
- - !ruby/object:Gem::Version
177
- version: 2.1.0
178
- type: :runtime
179
- version_requirements: *id015
180
- - !ruby/object:Gem::Dependency
181
- name: xml-simple
182
- prerelease: false
183
- requirement: &id016 !ruby/object:Gem::Requirement
184
- none: false
185
- requirements:
186
- - - "="
187
- - !ruby/object:Gem::Version
188
- version: 1.0.12
189
- type: :runtime
190
- version_requirements: *id016
191
- - !ruby/object:Gem::Dependency
192
- name: minitar
193
- prerelease: false
194
- requirement: &id017 !ruby/object:Gem::Requirement
195
- none: false
196
- requirements:
197
- - - "="
198
- - !ruby/object:Gem::Version
199
- version: 0.5.3
200
- type: :runtime
201
- version_requirements: *id017
202
- - !ruby/object:Gem::Dependency
203
- name: jruby-openssl
204
- prerelease: false
205
- requirement: &id018 !ruby/object:Gem::Requirement
206
- none: false
207
- requirements:
208
- - - ">="
209
- - !ruby/object:Gem::Version
210
- version: "0.7"
211
- type: :runtime
212
- version_requirements: *id018
213
- - !ruby/object:Gem::Dependency
214
- name: rdoc
215
- prerelease: false
216
- requirement: &id019 !ruby/object:Gem::Requirement
217
- none: false
218
- requirements:
219
- - - ">="
220
88
  - !ruby/object:Gem::Version
221
89
  version: "3.8"
222
90
  type: :development
223
- version_requirements: *id019
91
+ version_requirements: *id007
224
92
  - !ruby/object:Gem::Dependency
225
93
  name: rcov
226
94
  prerelease: false
227
- requirement: &id020 !ruby/object:Gem::Requirement
95
+ requirement: &id008 !ruby/object:Gem::Requirement
228
96
  none: false
229
97
  requirements:
230
98
  - - "="
231
99
  - !ruby/object:Gem::Version
232
100
  version: 0.9.9
233
101
  type: :development
234
- version_requirements: *id020
235
- - !ruby/object:Gem::Dependency
236
- name: ci_reporter
237
- prerelease: false
238
- requirement: &id021 !ruby/object:Gem::Requirement
239
- none: false
240
- requirements:
241
- - - "="
242
- - !ruby/object:Gem::Version
243
- version: 1.6.3
244
- type: :development
245
- version_requirements: *id021
246
- - !ruby/object:Gem::Dependency
247
- name: sdoc
248
- prerelease: false
249
- requirement: &id022 !ruby/object:Gem::Requirement
250
- none: false
251
- requirements:
252
- - - ">="
253
- - !ruby/object:Gem::Version
254
- version: "0"
255
- type: :development
256
- version_requirements: *id022
257
- - !ruby/object:Gem::Dependency
258
- name: readline-ffi
259
- prerelease: false
260
- requirement: &id023 !ruby/object:Gem::Requirement
261
- none: false
262
- requirements:
263
- - - ">="
264
- - !ruby/object:Gem::Version
265
- version: "0"
266
- type: :development
267
- version_requirements: *id023
268
- - !ruby/object:Gem::Dependency
269
- name: pygmentize
270
- prerelease: false
271
- requirement: &id024 !ruby/object:Gem::Requirement
272
- none: false
273
- requirements:
274
- - - ">="
275
- - !ruby/object:Gem::Version
276
- version: "0"
277
- type: :development
278
- version_requirements: *id024
279
- - !ruby/object:Gem::Dependency
280
- name: bundler
281
- prerelease: false
282
- requirement: &id025 !ruby/object:Gem::Requirement
283
- none: false
284
- requirements:
285
- - - ">="
286
- - !ruby/object:Gem::Version
287
- version: "0"
288
- type: :development
289
- version_requirements: *id025
290
- - !ruby/object:Gem::Dependency
291
- name: rubyforge
292
- prerelease: false
293
- requirement: &id026 !ruby/object:Gem::Requirement
294
- none: false
295
- requirements:
296
- - - ">="
297
- - !ruby/object:Gem::Version
298
- version: "0"
299
- type: :development
300
- version_requirements: *id026
102
+ version_requirements: *id008
301
103
  description: |
302
104
  A buildr plugin contributing a new packaging method to package your project as a IzPack installer.
303
105
 
@@ -313,21 +115,15 @@ extra_rdoc_files:
313
115
  files:
314
116
  - lib/buildrizpack.rb
315
117
  - lib/buildrizpack/package.rb
316
- - lib/buildrizpack/package.rb~
317
- - rakelib/doc.rake~
318
118
  - rakelib/checks.rake
319
- - rakelib/package.rake~
320
119
  - rakelib/package.rake
321
120
  - rakelib/rspec.rake
322
121
  - rakelib/stage.rake
323
122
  - rakelib/doc.rake
324
123
  - rakelib/release.rake
325
- - rakelib/checks.rake~
326
- - rakelib/rspec.rake~
327
124
  - rakelib/all-in-one.rake
328
125
  - rakelib/metrics.rake
329
126
  - spec/spec_helpers.rb
330
- - spec/buildrizpack/package_spec.rb~
331
127
  - spec/buildrizpack/package_spec.rb
332
128
  - buildrizpack.gemspec
333
129
  - LICENSE
@@ -362,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
362
158
  requirements: []
363
159
 
364
160
  rubyforge_project: buildrizpack
365
- rubygems_version: 1.8.15
161
+ rubygems_version: 1.8.24
366
162
  signing_key:
367
163
  specification_version: 3
368
164
  summary: A buildr plugin for packaging projects as IzPack installer
@@ -1,224 +0,0 @@
1
- # encoding: UTF-8
2
- # :include:../../README.rdoc
3
- # Licensed to the Apache Software Foundation (ASF) under one or more
4
- # contributor license agreements. See the NOTICE file distributed with this
5
- # work for additional information regarding copyright ownership. The ASF
6
- # licenses this file to you under the Apache License, Version 2.0 (the
7
- # "License"); you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
- # License for the specific language governing permissions and limitations under
16
- # the License.
17
-
18
- require "rexml/document"
19
- include REXML
20
-
21
- module BuildrIzPack
22
-
23
- # A simple helper class to create a single pack
24
- #
25
- class Pack
26
- # The path to be used by the IzPack-installer for this pack. Defaults to
27
- attr_reader :defaultPath
28
- # A hast of the files to be packed (src => installpath)
29
- attr_reader :files
30
- # A more elaborate description of the pack
31
- attr_reader :description
32
- # Attributes of the pack. a hash of name => value, eg. 'require' => 'yes'
33
- attr_reader :attributes
34
- # Initialize an IzPack-Pack by name, description.
35
- # :attributes: Attributes of the pack, a Hash, eg. { 'required' => 'yes' }
36
- def initialize(name, description, attributes = {}, defaultPath = '$INSTALL_PATH/plugins')
37
- @description = description
38
- @attributes = attributes
39
- @attributes['name'] = name
40
- @files = Hash.new
41
- @defaultPath = defaultPath
42
- @attributes['required'] = 'no' if !@attributes['required']
43
- end
44
-
45
- # Add a single file to the pack
46
- def addFile(src, dest=nil)
47
- orig = dest
48
- dest = File.join(@defaultPath, File.basename(src)) if !dest
49
- @files[src] = dest
50
- end
51
-
52
- # collect the XML representation for the pack using an XMLMarkup object
53
- def emitIzPackXML(xm)
54
- # raise "xm must be an Builder::XmlMarkup object, but is #{xm.class}" if xm.class != Builder::XmlMarkup
55
- xm.pack(@attributes) {
56
- xm.description(@description)
57
- @files.each{ |src, dest| xm.singlefile('src'=> src, 'target' =>dest) }
58
- }
59
- end
60
- end
61
-
62
- class IzPackTask < Buildr::ArchiveTask
63
-
64
- # a hash of name => value to be passed when calling the izpack installer
65
- # See also IzPackTask.html[http://www.jarvana.com/jarvana/view/org/codehaus/izpack/izpack-standalone-compiler/4.0.1/izpack-standalone-compiler-4.0.1-javadoc.jar!/com/izforge/izpack/ant/IzPackTask.html]
66
- attr_accessor :properties
67
- # "IzPack"[http://izpack.org/documentation/installation-files.html] to be used as starting point for calling the izpack installer
68
- # some or all of its content may be overwritten, if you specify other attributes, e.g.
69
- # if you want to specify one or mor pack bundles with a file list maintained by buildr.
70
- # If not specified BuildrIzPack will create one at File.join(project.path_to(:target, 'install.xml'))
71
- attr_accessor :input
72
- # ther version of the izpack installer to be used. Defaults to 4.3.5
73
- attr_accessor :izpackVersion
74
- # Application name used by the IzPack installer. Defaults to the current project
75
- attr_accessor :appName
76
- # The installer output directory and filename (defaults to <project>-<version>.izpack)
77
- attr_accessor :output
78
- # The base directory of compilation process (defaults project.path_to(:target))
79
- attr_accessor :basedir
80
- # The installer type (defaults to standard). You can select between standard and web.
81
- attr_accessor :installerType
82
- # It seems that in order to propagate all project properties to the the izpack compiler you need to set the inheritAll attribute to "true".
83
- # Therefore it defaults to true
84
- attr_accessor :inheritAll
85
- # defaults to deflate. You can select between default, deflate and raw.
86
- attr_accessor :compression
87
- # defaults to 9. The compression level of the installation (defaults to -1 for no compression). Valid values are -1 to 9.
88
- attr_accessor :compressionLevel
89
- # the packs (including attributes, fileset, os-dependencies etc). Must be an array of XmlMarkup object.
90
- attr_accessor :packs
91
-
92
- # The supported locale's for the installer. Must be an array of XmlMarkup object. Defaults to ['eng']
93
- # For details look at IzPacks installation.dtd (Distributed with this gem)
94
- attr_accessor :locales
95
- # IzPacks panels's. Must be an array of XmlMarkup object. Defaults to ['TargetPanel', 'InstallPack']
96
- attr_accessor :panels
97
- # the supported locale's. Must be an array of XmlMarkup object. Defaults to 680 x 520
98
- attr_accessor :guiprefs
99
-
100
- attr_accessor :packaging, :properties, :variables, :dynamicvariables, :conditions, :installerrequirements,:resources,
101
- :listeners, :jar, :native
102
-
103
- # The ArchiveTask class delegates this method
104
- # so we can create the archive.
105
- # the file_map is the result of the computations of the include and exclude filters.
106
- #
107
- def create_from(file_map)
108
- @izpackVersion ||= '4.3.5'
109
- @appName ||= project.id
110
- @izpackBaseDir = File.dirname(@output) if !@izpackBaseDir
111
- @installerType ||= 'standard'
112
- @inheritAll ||= 'true'
113
- @compression ||= 'deflate'
114
- @compressionLevel ||= '9'
115
- @locales ||= ['eng']
116
- @panels ||= ['TargetPanel', 'InstallPanel']
117
- @packs ||=
118
- raise "You must include at least one file to create an izPack installer" if file_map.size == 0 and !File.exists?(@input)
119
- izPackArtifact = Buildr.artifact( "org.codehaus.izpack:izpack-standalone-compiler:jar:#{@izpackVersion}")
120
- doc = nil
121
- if !File.exists?(@input)
122
- genInstaller(Builder::XmlMarkup.new(:target=>File.open(@input, 'w+'), :indent => 2), file_map)
123
- # genInstaller(Builder::XmlMarkup.new(:target=>$stdout, :indent => 2), file_map)
124
- # genInstaller(Builder::XmlMarkup.new(:target=>File.open('/home/niklaus/tmp2.xml', 'w+'), :indent => 2), file_map)
125
- end
126
- Buildr.ant('izpack-ant') do |x|
127
- izPackArtifact.invoke
128
- msg = "Generating izpack aus #{File.expand_path(@input)} #{File.size(@input)}"
129
- trace msg
130
- if properties
131
- properties.each{ |name, value|
132
- puts "Need added property #{name} with value #{value}"
133
- x.property(:name => name, :value => value)
134
- }
135
- end
136
- x.echo(:message =>msg)
137
- x.taskdef :name=>'izpack',
138
- :classname=>'com.izforge.izpack.ant.IzPackTask',
139
- :classpath=>izPackArtifact.to_s
140
- x.izpack :input=> @input,
141
- :output => @output,
142
- :basedir => @izpackBaseDir,
143
- :installerType=> @installerType,
144
- :inheritAll=> @inheritAll,
145
- :compression => @compression,
146
- :compressionLevel => @compressionLevel do
147
- end
148
- end
149
- end
150
-
151
- private
152
- def genInstaller(xm, file_map)
153
- xm.instruct!
154
- xm.installation('version'=>'1.0') {
155
- xm.tag!('info') { xm.appname(@appName); xm.appversion(@version)}
156
- if @guiprefs then xm << @guiprefs
157
- else
158
- xm.guiprefs('width' => '680', 'height' => '520', 'resizable' => 'yes')
159
- end
160
- if @panels.class == String then xm << @panels
161
- else
162
- xm.panels {
163
- @panels.each{ |x| xm.panel('classname' => x) }
164
- }
165
- end
166
- if @panels.class == String then xm << @panels
167
- else
168
- xm.locale {
169
- @locales.each{ |x| xm.langpack('iso3'=>x) }
170
- }
171
- end
172
- if @packs then xm << @packs
173
- else
174
- #default definiton of packs
175
- xm.packs {
176
- xm.pack('name' => 'main', 'required' => 'yes') {
177
- xm.description("Main pack of #{@appName}")
178
- file_map.each{ |src,aJar|
179
- xm.file('src'=> aJar, 'targetdir' =>'$INSTALL_PATH')
180
- }
181
- }
182
- }
183
- end
184
- [@packaging, @properties, @variables, @dynamicvariables, @conditions, @installerrequirements,@resources,@listeners, @jar, @native].each do
185
- |element|
186
- xm << element if element
187
- end
188
-
189
- }
190
- # Don't close $stdout
191
- xm.target!().close if xm.target!.class == File
192
- end
193
-
194
- end
195
-
196
- module ActAsIzPackPackager
197
- include Extension
198
-
199
- def package_as_izpack(file_name)
200
- izpack = IzPackTask.define_task(file_name)
201
- izpack.enhance do |task|
202
- task.enhance do
203
- package ||= project.id
204
- version ||= project.version
205
- end
206
- task.input ||= File.join(project.path_to(:target, 'install.xml'))
207
- task.appName ||= project.id
208
- task.output ||= file_name
209
- task.basedir ||= project.path_to(:target)
210
- task.installerType ||= 'standard'
211
- task.inheritAll ||= 'true'
212
- task.compression ||= 'deflate'
213
- task.compressionLevel ||= '9'
214
- end
215
- return izpack
216
- end
217
- end
218
- end
219
-
220
- module Buildr
221
- class Project
222
- include BuildrIzPack::ActAsIzPackPackager
223
- end
224
- end
data/rakelib/checks.rake~ DELETED
@@ -1,28 +0,0 @@
1
- # Licensed to the Apache Software Foundation (ASF) under one or more
2
- # contributor license agreements. See the NOTICE file distributed with this
3
- # work for additional information regarding copyright ownership. The ASF
4
- # licenses this file to you under the Apache License, Version 2.0 (the
5
- # "License"); you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
- # License for the specific language governing permissions and limitations under
14
- # the License.
15
-
16
-
17
- desc "Check that source files contain the Apache license"
18
- task :license=>FileList["**/*.{rb,rake,java,gemspec,buildfile}", 'Rakefile'] do |task|
19
- puts "Checking that files contain the Apache license ... "
20
- required = task.prerequisites.select { |fn| File.file?(fn) }
21
- missing = required.reject { |fn|
22
- comments = File.read(fn).scan(/(\/\*(.*?)\*\/)|^#\s+(.*?)$|^-#\s+(.*?)$|<!--(.*?)-->/m).
23
- map { |match| match.compact }.flatten.join("\n")
24
- comments =~ /Licensed to the Apache Software Foundation/ && comments =~ /http:\/\/www.apache.org\/licenses\/LICENSE-2.0/
25
- }
26
- fail "#{missing.join(', ')} missing Apache License, please add it before making a release!" unless missing.empty?
27
- puts "[x] Source files contain the Apache license"
28
- end
data/rakelib/doc.rake~ DELETED
@@ -1,121 +0,0 @@
1
- # Licensed to the Apache Software Foundation (ASF) under one or more
2
- # contributor license agreements. See the NOTICE file distributed with this
3
- # work for additional information regarding copyright ownership. The ASF
4
- # licenses this file to you under the Apache License, Version 2.0 (the
5
- # "License"); you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
- # License for the specific language governing permissions and limitations under
14
- # the License.
15
-
16
- gem 'rdoc'
17
- require 'rdoc/task'
18
- desc "Creates a symlink to rake's lib directory to support combined rdoc generation"
19
- file "rake/lib" do
20
- rake_path = $LOAD_PATH.find { |p| File.exist? File.join(p, "rake.rb") }
21
- mkdir_p "rake"
22
- File.symlink(rake_path, "rake/lib")
23
- end
24
-
25
- desc "Generate RDoc documentation in rdoc/"
26
- RDoc::Task.new :rdoc do |rdoc|
27
- rdoc.rdoc_dir = 'rdoc'
28
- rdoc.title = spec.name
29
- rdoc.options = spec.rdoc_options.clone
30
- rdoc.rdoc_files.include('lib/**/*.rb')
31
- rdoc.rdoc_files.include spec.extra_rdoc_files
32
-
33
- # include rake source for better inheritance rdoc
34
- rdoc.rdoc_files.include('rake/lib/**.rb')
35
- end
36
- task :rdoc => ["rake/lib"]
37
-
38
- begin
39
- require 'jekylltask'
40
- module TocFilter
41
- def toc(input)
42
- output = "<ol class=\"toc\">"
43
- input.scan(/<(h2)(?:>|\s+(.*?)>)([^<]*)<\/\1\s*>/mi).each do |entry|
44
- id = (entry[1][/^id=(['"])(.*)\1$/, 2] rescue nil)
45
- title = entry[2].gsub(/<(\w*).*?>(.*?)<\/\1\s*>/m, '\2').strip
46
- if id
47
- output << %{<li><a href="##{id}">#{title}</a></li>}
48
- else
49
- output << %{<li>#{title}</li>}
50
- end
51
- end
52
- output << "</ol>"
53
- output
54
- end
55
- end
56
- Liquid::Template.register_filter(TocFilter)
57
-
58
- desc "Generate Buildr documentation in _site/"
59
- JekyllTask.new :jekyll do |task|
60
- task.source = 'doc'
61
- task.target = '_site'
62
- end
63
-
64
- rescue LoadError
65
- puts "Buildr uses the jekyll gem to generate the Web site. You can install it by running bundler"
66
- end
67
-
68
- if `pygmentize -V`.empty?
69
- puts "Buildr uses the Pygments python library. You can install it by running 'sudo easy_install Pygments'"
70
- end
71
-
72
- desc "Generate Buildr documentation as buildr.pdf"
73
- file 'buildr.pdf'=>'_site' do |task|
74
- pages = File.read('_site/preface.html').scan(/<li><a href=['"]([^'"]+)/).flatten.map { |f| "_site/#{f}" }
75
- sh 'prince', '--input=html', '--no-network', '--log=prince_errors.log', "--output=#{task.name}", '_site/preface.html', *pages
76
- end
77
-
78
- desc "Build a copy of the Web site in the ./_site"
79
- task :site=>['_site', :rdoc, '_reports/specs.html', '_reports/coverage', 'buildr.pdf'] do
80
- cp_r 'rdoc', '_site'
81
- fail 'No RDocs in site directory' unless File.exist?('_site/rdoc/lib/buildr_rb.html')
82
- cp '_reports/specs.html', '_site'
83
- cp_r '_reports/coverage', '_site'
84
- fail 'No coverage report in site directory' unless File.exist?('_site/coverage/index.html')
85
- cp 'CHANGELOG', '_site'
86
- open("_site/.htaccess", "w") do |htaccess|
87
- htaccess << %Q{
88
- <FilesMatch "CHANGELOG">
89
- ForceType 'text/plain; charset=UTF-8'
90
- </FilesMatch>
91
- }
92
- end
93
- cp 'buildr.pdf', '_site'
94
- fail 'No PDF in site directory' unless File.exist?('_site/buildr.pdf')
95
- puts 'OK'
96
- end
97
-
98
- # Publish prerequisites to Web site.
99
- task 'publish'=>:site do
100
- target = "people.apache.org:/www/#{spec.name}.apache.org/"
101
- puts "Uploading new site to #{target} ..."
102
- sh 'rsync', '--progress', '--recursive', '--delete', '_site/', target
103
- sh 'ssh', 'people.apache.org', 'chmod', '-f', '-R', 'g+w', "/www/#{spec.name}.apache.org/*"
104
- puts "Done"
105
- end
106
-
107
- # Update HTML + PDF documentation (but not entire site; no specs, coverage, etc.)
108
- task 'publish-doc' => ['buildr.pdf', '_site'] do
109
- cp 'buildr.pdf', '_site'
110
- target = "people.apache.org:/www/#{spec.name}.apache.org/"
111
- puts "Uploading new site to #{target} ..."
112
- sh 'rsync', '--progress', '--recursive', '_site/', target # Note: no --delete
113
- sh 'ssh', 'people.apache.org', 'chmod', '-f', '-R', 'g+w', "/www/#{spec.name}.apache.org/*"
114
- puts "Done"
115
- end
116
-
117
- task :clobber do
118
- rm_rf '_site'
119
- rm_f 'buildr.pdf'
120
- rm_f 'prince_errors.log'
121
- end
@@ -1,63 +0,0 @@
1
- # Licensed to the Apache Software Foundation (ASF) under one or more
2
- # contributor license agreements. See the NOTICE file distributed with this
3
- # work for additional information regarding copyright ownership. The ASF
4
- # licenses this file to you under the Apache License, Version 2.0 (the
5
- # "License"); you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
- # License for the specific language governing permissions and limitations under
14
- # the License.
15
-
16
-
17
- require 'rubygems/package_task'
18
-
19
-
20
- package = Gem::PackageTask.new(spec) do |pkg|
21
- pkg.need_tar = true
22
- pkg.need_zip = true
23
- end
24
-
25
- desc "Install Buildr from source"
26
- task :install=>["#{package.package_dir}/#{package.gem_spec.file_name}"] do |task|
27
- print "Installing #{spec.name} ... "
28
- args = Config::CONFIG['ruby_install_name'], '-S', 'gem', 'install', "#{package.package_dir}/#{package.gem_spec.file_name}"
29
- args.unshift('sudo') if sudo_needed?
30
- sh *args
31
- puts "[x] Installed Buildr #{spec.version}"
32
- end
33
-
34
- desc "Uninstall previous rake install"
35
- task :uninstall do |task|
36
- puts "Uninstalling #{spec.name} ... "
37
- args = Config::CONFIG['ruby_install_name'], '-S', 'gem', 'uninstall', spec.name, '--version', spec.version.to_s
38
- args.unshift('sudo') if sudo_needed?
39
- sh *args
40
- puts "[x] Uninstalled Buildr #{spec.version}"
41
- end
42
-
43
-
44
- # We also need the other packages (JRuby if building on Ruby, and vice versa)
45
- # Must call new with block, even if block does nothing, otherwise bad things happen.
46
- @specs.values.each do |s|
47
- Gem::PackageTask.new(s) { |task| }
48
- end
49
-
50
-
51
- desc "Upload snapshot packages over to people.apache.org"
52
- task :snapshot=>[:package] do
53
- rm_rf '_snapshot' # Always start with empty directory
54
- puts "Copying existing gems from Apache"
55
- sh 'rsync', '--progress', '--recursive', 'people.apache.org:public_html/buildr/snapshot/', '_snapshot/'
56
- puts "Copying new gems over"
57
- cp FileList['pkg/{*.gem,*.tgz,*.zip}'], '_snapshot/gems'
58
- puts "Generating gem index ..."
59
- sh 'gem', 'generate_index', '--directory', '_snapshot'
60
- puts "Copying gem and index back to Apache"
61
- sh 'rsync', '--progress', '--recursive', '_snapshot/', 'people.apache.org:public_html/buildr/snapshot/'
62
- end
63
- task(:clobber) { rm_rf '_snapshot' }
data/rakelib/rspec.rake~ DELETED
@@ -1,92 +0,0 @@
1
- # Licensed to the Apache Software Foundation (ASF) under one or more
2
- # contributor license agreements. See the NOTICE file distributed with this
3
- # work for additional information regarding copyright ownership. The ASF
4
- # licenses this file to you under the Apache License, Version 2.0 (the
5
- # "License"); you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
- # License for the specific language governing permissions and limitations under
14
- # the License.
15
-
16
- begin
17
- require 'rspec/core/rake_task'
18
- directory '_reports'
19
-
20
- def default_spec_opts
21
- default = %w{--format documentation --out _reports/specs.txt --backtrace}
22
- default << '--colour' if $stdout.isatty && !(Config::CONFIG['host_os'] =~ /mswin|win32|dos/i)
23
- default
24
- end
25
-
26
- # RSpec doesn't support file exclusion, so hack our own.
27
- class RSpec::Core::RakeTask
28
- attr_accessor :rspec_files
29
- private
30
- def files_to_run
31
- @rspec_files
32
- end
33
- end
34
-
35
- desc "Run all specs"
36
- RSpec::Core::RakeTask.new :spec=>['_reports'] do |task|
37
- ENV['USE_FSC'] = 'no'
38
- task.rspec_files = FileList['spec/**/*_spec.rb']
39
- task.rspec_files.exclude('spec/groovy/*') if RUBY_PLATFORM[/java/]
40
- task.rspec_opts = default_spec_opts
41
- task.rspec_opts = %w{--format html --out _reports/specs.html --backtrace}
42
- end
43
- file('_reports/specs.html') { task(:spec).invoke }
44
-
45
- desc 'Run RSpec and generate Spec and coverage reports (slow)'
46
- RSpec::Core::RakeTask.new :coverage=>['_reports'] do |task|
47
- ENV['USE_FSC'] = 'no'
48
- task.rspec_files = FileList['spec/**/*_spec.rb']
49
- task.rspec_files.exclude('spec/groovy/*') if RUBY_PLATFORM[/java/]
50
- task.rspec_opts = default_spec_opts
51
- task.rcov = true
52
- task.rcov_opts = %w{-o _reports/coverage --exclude / --include-file ^lib --text-summary}
53
- end
54
- file('_reports/coverage') { task(:coverage).invoke }
55
-
56
- task :load_ci_reporter do
57
- gem 'ci_reporter'
58
- ENV['CI_REPORTS'] = '_reports/ci'
59
- # CI_Reporter does not quote the path to rspec_loader which causes problems when ruby is installed in C:/Program Files.
60
- # However, newer versions of rspec don't like double quotes escaping as well, so removing them for now.
61
- ci_rep_path = Gem.loaded_specs['ci_reporter'].full_gem_path
62
- ENV["SPEC_OPTS"] = [ENV["SPEC_OPTS"], default_spec_opts, "--require", "#{ci_rep_path}/lib/ci/reporter/rake/rspec_loader.rb", "--format", "CI::Reporter::RSpec"].join(" ")
63
- end
64
-
65
- desc 'Run all specs with CI reporter'
66
- task :ci=>[:load_ci_reporter, :spec]
67
-
68
- # Useful for testing with JRuby when using Ruby and vice versa.
69
- namespace :spec do
70
- desc "Run all specs specifically with Ruby"
71
- task :ruby do
72
- puts "Running test suite using Ruby ..."
73
- sh 'ruby -S rake spec'
74
- end
75
-
76
- desc "Run all specs specifically with JRuby"
77
- task :jruby do
78
- puts "Running test suite using JRuby ..."
79
- sh 'jruby -S rake spec'
80
- end
81
- end
82
-
83
- task :clobber do
84
- rm_f 'failed'
85
- rm_rf '_reports'
86
- end
87
-
88
- rescue LoadError => e
89
- puts "Buildr uses RSpec. You can install it by running rake setup"
90
- task(:setup) { install_gem 'rcov', :version=>'~>0.8' }
91
- task(:setup) { install_gem 'win32console' if RUBY_PLATFORM[/win32/] } # Colors for RSpec, only on Windows platform.
92
- end
@@ -1,155 +0,0 @@
1
- #encoding: utf-8
2
- # Licensed to the Apache Software Foundation (ASF) under one or more
3
- # contributor license agreements. See the NOTICE file distributed with this
4
- # work for additional information regarding copyright ownership. The ASF
5
- # licenses this file to you under the Apache License, Version 2.0 (the
6
- # "License"); you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- # License for the specific language governing permissions and limitations under
15
- # the License.
16
-
17
- require File.join(File.dirname(__FILE__), '../spec_helpers')
18
-
19
- describe BuildrIzPack::IzPackTask do
20
-
21
- def writeJavaMain(filename)
22
- Buildr::write(filename, "public class Main { public static void main(String[] args) {}}")
23
- end
24
-
25
- def define_project(project_name='foo')
26
- myPath = "src/main/java/Main.java"
27
- writeJavaMain(myPath)
28
- @project = define(project_name, :version => "1.0.0.001") do
29
- x = path_to(:sources, :main, :java)+'/**/*.java'
30
- package(:jar)
31
- package(:izpack).include(package(:jar))
32
- end
33
- end
34
-
35
- def writeSimpleInstaller(filename)
36
- content = %(<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
37
- <installation version="1.0">
38
- <info>
39
- <appname>demo app</appname>
40
- <appversion>7.6.5</appversion>
41
- </info>
42
- <guiprefs width="700" height="520" resizable="yes" />
43
- <locale>
44
- <langpack iso3="eng" />
45
- </locale>
46
- <panels>
47
- <panel classname="InstallPanel" />
48
- </panels>
49
- <packs>
50
- <pack name="Demo-App" required="yes">
51
- <description>Our demo app.</description>
52
- <file src="withXml-1.0.0.001.jar" targetdir="$SYSTEM_user_home/demo" />
53
- </pack>
54
- </packs>
55
- </installation>)
56
- puts "writeSimpleInstaller wrote #{File.expand_path(filename)}"
57
- Buildr::write(filename, content)
58
- end
59
-
60
- it "must add correctly a single file" do
61
- @project = define('nofile', :version => "1.0.2") do
62
- pack = BuildrIzPack::Pack.new('myPackName', 'myPack description')
63
- myInstXml = File.join(Dir.pwd, 'singleFileInstaller.xml')
64
- pack.addFile(myInstXml)
65
- xm = Builder::XmlMarkup.new(:target=>File.open(myInstXml, 'w+'), :indent => 2)
66
- xm.instruct!
67
- xm.installation('version'=>'1.0') {
68
- xm.tag!('info') { xm.appversion(project.version); xm.appname(project.name) }
69
- xm.guiprefs('width' => '400', 'height' => '400', 'resizable' => 'no')
70
- xm.panels { |x| xm.panel('classname' => 'InstallPanel') }
71
- xm.locale { |x| xm.langpack('iso3'=>'eng') }
72
- xm.packs {
73
- pack.emitIzPackXML(xm)
74
- }
75
- }
76
- xm.target!().close
77
- package(:izpack).input = myInstXml
78
- @inhalt = IO.readlines(myInstXml).join('')
79
- package(:izpack)
80
- end
81
- @project.package(:izpack).invoke
82
- @instPath = File.join(@project.path_to(:target, :main), "#{@project.name}-#{@project.version}.izpack.jar")
83
- inhalt = IO.readlines(File.join(Dir.pwd, 'singleFileInstaller.xml')).join('')
84
- File.exists?(@instPath).should be_true
85
- (inhalt.index('<pack name="myPackName" required="no">') > 0).should be_true
86
- (inhalt.index('<description>myPack description</description>') > 0).should be_true
87
- (inhalt.index('singleFileInstaller.xml" target="$INSTALL_PATH/plugins/singleFileInstaller.xml"/>') > 0).should be_true
88
- end
89
-
90
-
91
- it "should generate an installer jar" do
92
- define_project
93
- @project.package(:izpack).invoke
94
- @path = @project.package(:jar).to_s
95
- File.exists?(@path).should be_true
96
- @path.to_s.should include(".jar")
97
- Zip::ZipFile.open(@path) do |zip|
98
- zip.find_entry("Main.class").should_not be_nil
99
- zip.find_entry("META-INF/MANIFEST.MF").should_not be_nil
100
- end
101
- File.exists?(@path).should be_true
102
- @instPath = File.join(@project.path_to(:target, :main), "#{@project.name}-#{@project.version}.izpack.jar")
103
- File.exists?(@instPath).should be_true
104
- end
105
-
106
- it "should use the provided install.xml" do
107
- define_project('withXml')
108
- xmlPath = File.join(@project.path_to(:target), "install.xml")
109
- writeSimpleInstaller(xmlPath)
110
- @project.package(:izpack).input = xmlPath
111
- @project.package(:izpack).invoke
112
- @instPath = File.join(@project.path_to(:target, :main), "#{@project.name}-#{@project.version}.izpack.jar")
113
- File.exists?(@instPath).should be_true
114
- end
115
-
116
- it "must include at least one file" do
117
- @project = define('nofile', :version => "1.0.2") do
118
- package(:izpack)
119
- end
120
- lambda { project("nofile").package(:izpack).invoke }.should raise_error(/You must include at least one file to create an izPack installer/)
121
- end
122
-
123
- it "should be possible to add several files to several packs" do
124
- define_project('severalPacks')
125
- @project.package(:izpack).locales = ['eng', 'fra', 'deu']
126
- Buildr.write(@project.path_to(:target)+"/1_5.txt", "This is file 1_5.txt")
127
- Buildr.write(@project.path_to(:target)+"/3_7.txt", "This is file 3_7.txt")
128
- s = ''
129
- xm = Builder::XmlMarkup.new(:target=>s)
130
- xm.packs {
131
- xm.pack('name' => 'pack_3', 'required' => 'yes') {
132
- xm.description("Niklaus ist am Testen")
133
- xm.file('src'=> @project.path_to(:target)+"/1_5.txt", 'targetdir' =>'1/5')
134
- xm.file('src'=> @project.path_to(:target)+"/3_7.txt", 'targetdir' =>'3/7')
135
- }
136
- }
137
-
138
- @project.package(:izpack).packs = s
139
- s = ''
140
- xm = Builder::XmlMarkup.new(:target=>s)
141
- xm.native('type'=>'izpack', 'name'=>'ShellLink.dll')
142
- @project.package(:izpack).native = s
143
- @project.package(:izpack).invoke
144
- File.exists?(@project.package(:izpack).input).should be_true
145
- content = IO.readlines(@project.package(:izpack).input)
146
- content.join.should match('pack_3')
147
- content.join.should match('1_5.txt')
148
- content.join.should match('3/7')
149
- content.join.should match('<native ')
150
-
151
- @instPath = File.join(@project.path_to(:target, :main), "#{@project.name}-#{@project.version}.izpack.jar")
152
- File.exists?(@instPath).should be_true
153
- end
154
-
155
- end