buildrizpack 0.2 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buildrizpack
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,302 +10,110 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain:
12
12
  - gem-public_cert.pem
13
- date: 2012-04-30 00:00:00.000000000 Z
13
+ date: 2012-07-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
- - - '='
20
+ - - ! '>='
21
21
  - !ruby/object:Gem::Version
22
- version: 0.8.7
22
+ version: 0.9.2.2
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  none: false
27
27
  requirements:
28
- - - '='
28
+ - - ! '>='
29
29
  - !ruby/object:Gem::Version
30
- version: 0.8.7
30
+ version: 0.9.2.2
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: builder
33
33
  requirement: !ruby/object:Gem::Requirement
34
34
  none: false
35
35
  requirements:
36
- - - '='
37
- - !ruby/object:Gem::Version
38
- version: 2.1.2
39
- type: :runtime
40
- prerelease: false
41
- version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - '='
45
- - !ruby/object:Gem::Version
46
- version: 2.1.2
47
- - !ruby/object:Gem::Dependency
48
- name: net-ssh
49
- requirement: !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - '='
53
- - !ruby/object:Gem::Version
54
- version: 2.0.23
55
- type: :runtime
56
- prerelease: false
57
- version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
- requirements:
60
- - - '='
61
- - !ruby/object:Gem::Version
62
- version: 2.0.23
63
- - !ruby/object:Gem::Dependency
64
- name: net-sftp
65
- requirement: !ruby/object:Gem::Requirement
66
- none: false
67
- requirements:
68
- - - '='
69
- - !ruby/object:Gem::Version
70
- version: 2.0.4
71
- type: :runtime
72
- prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
76
- - - '='
77
- - !ruby/object:Gem::Version
78
- version: 2.0.4
79
- - !ruby/object:Gem::Dependency
80
- name: rubyzip
81
- requirement: !ruby/object:Gem::Requirement
82
- none: false
83
- requirements:
84
- - - '='
85
- - !ruby/object:Gem::Version
86
- version: 0.9.4
87
- type: :runtime
88
- prerelease: false
89
- version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
- requirements:
92
- - - '='
93
- - !ruby/object:Gem::Version
94
- version: 0.9.4
95
- - !ruby/object:Gem::Dependency
96
- name: highline
97
- requirement: !ruby/object:Gem::Requirement
98
- none: false
99
- requirements:
100
- - - '='
101
- - !ruby/object:Gem::Version
102
- version: 1.5.1
103
- type: :runtime
104
- prerelease: false
105
- version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
- requirements:
108
- - - '='
109
- - !ruby/object:Gem::Version
110
- version: 1.5.1
111
- - !ruby/object:Gem::Dependency
112
- name: json_pure
113
- requirement: !ruby/object:Gem::Requirement
114
- none: false
115
- requirements:
116
- - - '='
117
- - !ruby/object:Gem::Version
118
- version: 1.4.3
119
- type: :runtime
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- none: false
123
- requirements:
124
- - - '='
125
- - !ruby/object:Gem::Version
126
- version: 1.4.3
127
- - !ruby/object:Gem::Dependency
128
- name: rubyforge
129
- requirement: !ruby/object:Gem::Requirement
130
- none: false
131
- requirements:
132
- - - '='
133
- - !ruby/object:Gem::Version
134
- version: 2.0.3
135
- type: :runtime
136
- prerelease: false
137
- version_requirements: !ruby/object:Gem::Requirement
138
- none: false
139
- requirements:
140
- - - '='
141
- - !ruby/object:Gem::Version
142
- version: 2.0.3
143
- - !ruby/object:Gem::Dependency
144
- name: hoe
145
- requirement: !ruby/object:Gem::Requirement
146
- none: false
147
- requirements:
148
- - - '='
149
- - !ruby/object:Gem::Version
150
- version: 2.3.3
151
- type: :runtime
152
- prerelease: false
153
- version_requirements: !ruby/object:Gem::Requirement
154
- none: false
155
- requirements:
156
- - - '='
157
- - !ruby/object:Gem::Version
158
- version: 2.3.3
159
- - !ruby/object:Gem::Dependency
160
- name: rjb
161
- requirement: !ruby/object:Gem::Requirement
162
- none: false
163
- requirements:
164
- - - '='
165
- - !ruby/object:Gem::Version
166
- version: 1.3.3
167
- type: :runtime
168
- prerelease: false
169
- version_requirements: !ruby/object:Gem::Requirement
170
- none: false
171
- requirements:
172
- - - '='
173
- - !ruby/object:Gem::Version
174
- version: 1.3.3
175
- - !ruby/object:Gem::Dependency
176
- name: atoulme-Antwrap
177
- requirement: !ruby/object:Gem::Requirement
178
- none: false
179
- requirements:
180
- - - '='
181
- - !ruby/object:Gem::Version
182
- version: 0.7.1
183
- type: :runtime
184
- prerelease: false
185
- version_requirements: !ruby/object:Gem::Requirement
186
- none: false
187
- requirements:
188
- - - '='
189
- - !ruby/object:Gem::Version
190
- version: 0.7.1
191
- - !ruby/object:Gem::Dependency
192
- name: diff-lcs
193
- requirement: !ruby/object:Gem::Requirement
194
- none: false
195
- requirements:
196
- - - '='
197
- - !ruby/object:Gem::Version
198
- version: 1.1.2
199
- type: :runtime
200
- prerelease: false
201
- version_requirements: !ruby/object:Gem::Requirement
202
- none: false
203
- requirements:
204
- - - '='
205
- - !ruby/object:Gem::Version
206
- version: 1.1.2
207
- - !ruby/object:Gem::Dependency
208
- name: rspec-expectations
209
- requirement: !ruby/object:Gem::Requirement
210
- none: false
211
- requirements:
212
- - - '='
213
- - !ruby/object:Gem::Version
214
- version: 2.1.0
215
- type: :runtime
216
- prerelease: false
217
- version_requirements: !ruby/object:Gem::Requirement
218
- none: false
219
- requirements:
220
- - - '='
221
- - !ruby/object:Gem::Version
222
- version: 2.1.0
223
- - !ruby/object:Gem::Dependency
224
- name: rspec-mocks
225
- requirement: !ruby/object:Gem::Requirement
226
- none: false
227
- requirements:
228
- - - '='
36
+ - - ! '>='
229
37
  - !ruby/object:Gem::Version
230
- version: 2.1.0
38
+ version: 1.4.6
231
39
  type: :runtime
232
40
  prerelease: false
233
41
  version_requirements: !ruby/object:Gem::Requirement
234
42
  none: false
235
43
  requirements:
236
- - - '='
44
+ - - ! '>='
237
45
  - !ruby/object:Gem::Version
238
- version: 2.1.0
46
+ version: 1.4.6
239
47
  - !ruby/object:Gem::Dependency
240
- name: rspec-core
48
+ name: pygmentize
241
49
  requirement: !ruby/object:Gem::Requirement
242
50
  none: false
243
51
  requirements:
244
- - - '='
52
+ - - ! '>='
245
53
  - !ruby/object:Gem::Version
246
- version: 2.1.0
247
- type: :runtime
54
+ version: '0'
55
+ type: :development
248
56
  prerelease: false
249
57
  version_requirements: !ruby/object:Gem::Requirement
250
58
  none: false
251
59
  requirements:
252
- - - '='
60
+ - - ! '>='
253
61
  - !ruby/object:Gem::Version
254
- version: 2.1.0
62
+ version: '0'
255
63
  - !ruby/object:Gem::Dependency
256
- name: rspec
64
+ name: jekyll
257
65
  requirement: !ruby/object:Gem::Requirement
258
66
  none: false
259
67
  requirements:
260
68
  - - '='
261
69
  - !ruby/object:Gem::Version
262
- version: 2.1.0
263
- type: :runtime
70
+ version: 0.11.2
71
+ type: :development
264
72
  prerelease: false
265
73
  version_requirements: !ruby/object:Gem::Requirement
266
74
  none: false
267
75
  requirements:
268
76
  - - '='
269
77
  - !ruby/object:Gem::Version
270
- version: 2.1.0
78
+ version: 0.11.2
271
79
  - !ruby/object:Gem::Dependency
272
- name: xml-simple
80
+ name: RedCloth
273
81
  requirement: !ruby/object:Gem::Requirement
274
82
  none: false
275
83
  requirements:
276
84
  - - '='
277
85
  - !ruby/object:Gem::Version
278
- version: 1.0.12
279
- type: :runtime
86
+ version: 4.2.9
87
+ type: :development
280
88
  prerelease: false
281
89
  version_requirements: !ruby/object:Gem::Requirement
282
90
  none: false
283
91
  requirements:
284
92
  - - '='
285
93
  - !ruby/object:Gem::Version
286
- version: 1.0.12
94
+ version: 4.2.9
287
95
  - !ruby/object:Gem::Dependency
288
- name: minitar
96
+ name: jekylltask
289
97
  requirement: !ruby/object:Gem::Requirement
290
98
  none: false
291
99
  requirements:
292
100
  - - '='
293
101
  - !ruby/object:Gem::Version
294
- version: 0.5.3
295
- type: :runtime
102
+ version: 1.1.0
103
+ type: :development
296
104
  prerelease: false
297
105
  version_requirements: !ruby/object:Gem::Requirement
298
106
  none: false
299
107
  requirements:
300
108
  - - '='
301
109
  - !ruby/object:Gem::Version
302
- version: 0.5.3
110
+ version: 1.1.0
303
111
  - !ruby/object:Gem::Dependency
304
112
  name: rdoc
305
113
  requirement: !ruby/object:Gem::Requirement
306
114
  none: false
307
115
  requirements:
308
- - - ! '>='
116
+ - - '='
309
117
  - !ruby/object:Gem::Version
310
118
  version: '3.8'
311
119
  type: :development
@@ -313,7 +121,7 @@ dependencies:
313
121
  version_requirements: !ruby/object:Gem::Requirement
314
122
  none: false
315
123
  requirements:
316
- - - ! '>='
124
+ - - '='
317
125
  - !ruby/object:Gem::Version
318
126
  version: '3.8'
319
127
  - !ruby/object:Gem::Dependency
@@ -332,102 +140,6 @@ dependencies:
332
140
  - - '='
333
141
  - !ruby/object:Gem::Version
334
142
  version: 0.9.9
335
- - !ruby/object:Gem::Dependency
336
- name: ci_reporter
337
- requirement: !ruby/object:Gem::Requirement
338
- none: false
339
- requirements:
340
- - - '='
341
- - !ruby/object:Gem::Version
342
- version: 1.6.3
343
- type: :development
344
- prerelease: false
345
- version_requirements: !ruby/object:Gem::Requirement
346
- none: false
347
- requirements:
348
- - - '='
349
- - !ruby/object:Gem::Version
350
- version: 1.6.3
351
- - !ruby/object:Gem::Dependency
352
- name: sdoc
353
- requirement: !ruby/object:Gem::Requirement
354
- none: false
355
- requirements:
356
- - - ! '>='
357
- - !ruby/object:Gem::Version
358
- version: '0'
359
- type: :development
360
- prerelease: false
361
- version_requirements: !ruby/object:Gem::Requirement
362
- none: false
363
- requirements:
364
- - - ! '>='
365
- - !ruby/object:Gem::Version
366
- version: '0'
367
- - !ruby/object:Gem::Dependency
368
- name: readline-ffi
369
- requirement: !ruby/object:Gem::Requirement
370
- none: false
371
- requirements:
372
- - - ! '>='
373
- - !ruby/object:Gem::Version
374
- version: '0'
375
- type: :development
376
- prerelease: false
377
- version_requirements: !ruby/object:Gem::Requirement
378
- none: false
379
- requirements:
380
- - - ! '>='
381
- - !ruby/object:Gem::Version
382
- version: '0'
383
- - !ruby/object:Gem::Dependency
384
- name: pygmentize
385
- requirement: !ruby/object:Gem::Requirement
386
- none: false
387
- requirements:
388
- - - ! '>='
389
- - !ruby/object:Gem::Version
390
- version: '0'
391
- type: :development
392
- prerelease: false
393
- version_requirements: !ruby/object:Gem::Requirement
394
- none: false
395
- requirements:
396
- - - ! '>='
397
- - !ruby/object:Gem::Version
398
- version: '0'
399
- - !ruby/object:Gem::Dependency
400
- name: bundler
401
- requirement: !ruby/object:Gem::Requirement
402
- none: false
403
- requirements:
404
- - - ! '>='
405
- - !ruby/object:Gem::Version
406
- version: '0'
407
- type: :development
408
- prerelease: false
409
- version_requirements: !ruby/object:Gem::Requirement
410
- none: false
411
- requirements:
412
- - - ! '>='
413
- - !ruby/object:Gem::Version
414
- version: '0'
415
- - !ruby/object:Gem::Dependency
416
- name: rubyforge
417
- requirement: !ruby/object:Gem::Requirement
418
- none: false
419
- requirements:
420
- - - ! '>='
421
- - !ruby/object:Gem::Version
422
- version: '0'
423
- type: :development
424
- prerelease: false
425
- version_requirements: !ruby/object:Gem::Requirement
426
- none: false
427
- requirements:
428
- - - ! '>='
429
- - !ruby/object:Gem::Version
430
- version: '0'
431
143
  description: ! 'A buildr plugin contributing a new packaging method to package your
432
144
  project as a IzPack installer.
433
145
 
@@ -442,20 +154,14 @@ extra_rdoc_files:
442
154
  files:
443
155
  - lib/buildrizpack.rb
444
156
  - lib/buildrizpack/package.rb
445
- - lib/buildrizpack/package.rb~
446
- - rakelib/doc.rake~
447
157
  - rakelib/checks.rake
448
- - rakelib/package.rake~
449
158
  - rakelib/package.rake
450
159
  - rakelib/rspec.rake
451
160
  - rakelib/stage.rake
452
161
  - rakelib/doc.rake
453
162
  - rakelib/release.rake
454
- - rakelib/checks.rake~
455
- - rakelib/rspec.rake~
456
163
  - rakelib/all-in-one.rake
457
164
  - rakelib/metrics.rake
458
- - spec/buildrizpack/package_spec.rb~
459
165
  - spec/buildrizpack/package_spec.rb
460
166
  - spec/spec_helpers.rb
461
167
  - buildrizpack.gemspec
@@ -489,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
489
195
  version: '0'
490
196
  requirements: []
491
197
  rubyforge_project: buildrizpack
492
- rubygems_version: 1.8.21
198
+ rubygems_version: 1.8.24
493
199
  signing_key:
494
200
  specification_version: 3
495
201
  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
@@ -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
@@ -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' }
@@ -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