buildr 1.4.20-java → 1.4.21-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -298,7 +298,7 @@ module Buildr #:nodoc:
298
298
  !@excludes.any? { |pattern| File.fnmatch(pattern, entry.name) }
299
299
  dest = path =~ /^\/?$/ ? entry.name : Util.relative_path(path + "/" + entry.name)
300
300
  trace "Adding #{dest}"
301
- file_map[dest] = lambda { |output| output.write source.read(entry) }
301
+ file_map[dest] = ZipEntryData.new(source, entry)
302
302
  end
303
303
  end
304
304
  end
@@ -306,6 +306,20 @@ module Buildr #:nodoc:
306
306
 
307
307
  end
308
308
 
309
+ class ZipEntryData
310
+ def initialize(zipfile, entry)
311
+ @zipfile = zipfile
312
+ @entry = entry
313
+ end
314
+
315
+ def call(output)
316
+ output.write @zipfile.read(@entry)
317
+ end
318
+
319
+ def mode
320
+ @entry.unix_perms
321
+ end
322
+ end
309
323
 
310
324
  def initialize(*args) #:nodoc:
311
325
  super
@@ -92,7 +92,7 @@ module Buildr #:nodoc:
92
92
 
93
93
  file_map.each do |path, content|
94
94
  if content.respond_to?(:call)
95
- tar.add_file(path, options) { |os, opts| content.call os }
95
+ tar.add_file(path, content.respond_to?(:mode) ? options.merge(:mode => content.mode) : options) { |os, _| content.call os }
96
96
  elsif content.nil?
97
97
  elsif File.directory?(content.to_s)
98
98
  stat = File.stat(content.to_s)
@@ -67,7 +67,8 @@ module Buildr #:nodoc:
67
67
  warn "Warning: Path in zipfile #{name} contains backslash: #{path}" if path =~ /\\/
68
68
  mkpath.call File.dirname(path)
69
69
  if content.respond_to?(:call)
70
- zip.put_next_entry(path, compression_level)
70
+ entry = zip.put_next_entry(path, compression_level)
71
+ entry.unix_perms = content.mode & 07777 if content.respond_to?(:mode)
71
72
  content.call zip
72
73
  elsif content.nil? || File.directory?(content.to_s)
73
74
  mkpath.call path
@@ -14,5 +14,5 @@
14
14
  # the License.
15
15
 
16
16
  module Buildr #:nodoc:
17
- VERSION = '1.4.20'.freeze
17
+ VERSION = '1.4.21'.freeze
18
18
  end
@@ -97,7 +97,7 @@ task 'stage' => %w(clobber prepare) do |task, args|
97
97
  puts 'Ensuring all files have appropriate group and other permissions...'
98
98
  sh 'find . -type f | xargs chmod go+r'
99
99
  sh 'find . -type d | xargs chmod go+rx'
100
- puts '[X] File permissions updated/validted.'
100
+ puts '[X] File permissions updated/validated.'
101
101
  end.call
102
102
 
103
103
  # Start by figuring out what has changed.
@@ -445,6 +445,23 @@ describe TarTask do
445
445
  unzip('target' => 'foo.tgz').extract
446
446
  (File.stat('target/hello').mode & 0777).should == 0777
447
447
  end
448
+
449
+ it 'should preserve file permissions when merging zip files' do
450
+ # with JRuby it's important to use absolute paths with File.chmod()
451
+ # http://jira.codehaus.org/browse/JRUBY-3300
452
+ hello = File.expand_path('src/main/bin/hello')
453
+ write hello, 'echo hi'
454
+ File.chmod(0777, hello)
455
+ fail("Failed to set permission on #{hello}") unless (File.stat(hello).mode & 0777) == 0777
456
+
457
+ foo = zip('foo.zip')
458
+ foo.include('src/main/bin/*').invoke
459
+ bar = tar('bar.tgz')
460
+ bar.merge(foo)
461
+ bar.invoke
462
+ unzip('target' => 'bar.tgz').extract
463
+ (File.stat('target/hello').mode & 0777).should == 0777
464
+ end
448
465
  end
449
466
 
450
467
  end
@@ -567,6 +584,23 @@ describe "ZipTask" do
567
584
  unzip('target' => 'foo.zip').extract
568
585
  (File.stat('target/hello').mode & 0777).should == 0777
569
586
  end
587
+
588
+ it 'should preserve file permissions when merging zip files' do
589
+ # with JRuby it's important to use absolute paths with File.chmod()
590
+ # http://jira.codehaus.org/browse/JRUBY-3300
591
+ hello = File.expand_path('src/main/bin/hello')
592
+ write hello, 'echo hi'
593
+ File.chmod(0777, hello)
594
+ fail("Failed to set permission on #{hello}") unless (File.stat(hello).mode & 0777) == 0777
595
+
596
+ foo = zip('foo.zip')
597
+ foo.include('src/main/bin/*').invoke
598
+ bar = zip('bar.zip')
599
+ bar.merge(foo)
600
+ bar.invoke
601
+ unzip('target' => 'bar.zip').extract
602
+ (File.stat('target/hello').mode & 0777).should == 0777
603
+ end
570
604
  end
571
605
 
572
606
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buildr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.20
4
+ version: 1.4.21
5
5
  platform: java
6
6
  authors:
7
7
  - Apache Buildr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-26 00:00:00.000000000 Z
11
+ date: 2014-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -126,16 +126,16 @@ dependencies:
126
126
  name: atoulme-Antwrap
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ~>
129
+ - - '='
130
130
  - !ruby/object:Gem::Version
131
- version: 0.7.4
131
+ version: 0.7.5
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ~>
136
+ - - '='
137
137
  - !ruby/object:Gem::Version
138
- version: 0.7.4
138
+ version: 0.7.5
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: diff-lcs
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -238,44 +238,44 @@ dependencies:
238
238
  name: jruby-openssl
239
239
  requirement: !ruby/object:Gem::Requirement
240
240
  requirements:
241
- - - ~>
241
+ - - "~>"
242
242
  - !ruby/object:Gem::Version
243
243
  version: 0.8.2
244
244
  type: :runtime
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
- - - ~>
248
+ - - "~>"
249
249
  - !ruby/object:Gem::Version
250
250
  version: 0.8.2
251
251
  - !ruby/object:Gem::Dependency
252
252
  name: bundler
253
253
  requirement: !ruby/object:Gem::Requirement
254
254
  requirements:
255
- - - ! '>='
255
+ - - ">="
256
256
  - !ruby/object:Gem::Version
257
257
  version: '0'
258
258
  type: :runtime
259
259
  prerelease: false
260
260
  version_requirements: !ruby/object:Gem::Requirement
261
261
  requirements:
262
- - - ! '>='
262
+ - - ">="
263
263
  - !ruby/object:Gem::Version
264
264
  version: '0'
265
265
  - !ruby/object:Gem::Dependency
266
266
  name: orderedhash
267
267
  requirement: !ruby/object:Gem::Requirement
268
268
  requirements:
269
- - - ! '>='
269
+ - - '='
270
270
  - !ruby/object:Gem::Version
271
- version: '0'
271
+ version: 0.0.6
272
272
  type: :runtime
273
273
  prerelease: false
274
274
  version_requirements: !ruby/object:Gem::Requirement
275
275
  requirements:
276
- - - ! '>='
276
+ - - '='
277
277
  - !ruby/object:Gem::Version
278
- version: '0'
278
+ version: 0.0.6
279
279
  - !ruby/object:Gem::Dependency
280
280
  name: rspec-retry
281
281
  requirement: !ruby/object:Gem::Requirement
@@ -346,18 +346,12 @@ dependencies:
346
346
  - - '='
347
347
  - !ruby/object:Gem::Version
348
348
  version: 1.2.1
349
- description: ! 'Apache Buildr is a build system for Java-based applications, including
350
- support
351
-
349
+ description: |
350
+ Apache Buildr is a build system for Java-based applications, including support
352
351
  for Scala, Groovy and a growing number of JVM languages and tools. We wanted
353
-
354
- something that''s simple and intuitive to use, so we only need to tell it what
355
-
352
+ something that's simple and intuitive to use, so we only need to tell it what
356
353
  to do, and it takes care of the rest. But also something we can easily extend
357
-
358
- for those one-off tasks, with a language that''s a joy to use.
359
-
360
- '
354
+ for those one-off tasks, with a language that's a joy to use.
361
355
  email: users@buildr.apache.org
362
356
  executables:
363
357
  - buildr
@@ -368,6 +362,13 @@ extra_rdoc_files:
368
362
  - LICENSE
369
363
  - NOTICE
370
364
  files:
365
+ - CHANGELOG
366
+ - LICENSE
367
+ - NOTICE
368
+ - README.rdoc
369
+ - Rakefile
370
+ - _buildr
371
+ - _jbuildr
371
372
  - addon/buildr/antlr.rb
372
373
  - addon/buildr/bnd.rb
373
374
  - addon/buildr/checkstyle-report.xsl
@@ -411,6 +412,8 @@ files:
411
412
  - addon/buildr/wsgen.rb
412
413
  - addon/buildr/xmlbeans.rb
413
414
  - bin/buildr
415
+ - buildr.buildfile
416
+ - buildr.gemspec
414
417
  - doc/_config.yml
415
418
  - doc/_layouts/default.html
416
419
  - doc/_layouts/preface.html
@@ -450,8 +453,9 @@ files:
450
453
  - doc/settings_profiles.textile
451
454
  - doc/testing.textile
452
455
  - etc/KEYS
453
- - lib/buildr/clojure/shell.rb
456
+ - lib/buildr.rb
454
457
  - lib/buildr/clojure.rb
458
+ - lib/buildr/clojure/shell.rb
455
459
  - lib/buildr/core/application.rb
456
460
  - lib/buildr/core/assets.rb
457
461
  - lib/buildr/core/build.rb
@@ -475,11 +479,11 @@ files:
475
479
  - lib/buildr/core/test.rb
476
480
  - lib/buildr/core/transports.rb
477
481
  - lib/buildr/core/util.rb
482
+ - lib/buildr/groovy.rb
478
483
  - lib/buildr/groovy/bdd.rb
479
484
  - lib/buildr/groovy/compiler.rb
480
485
  - lib/buildr/groovy/doc.rb
481
486
  - lib/buildr/groovy/shell.rb
482
- - lib/buildr/groovy.rb
483
487
  - lib/buildr/ide/eclipse.rb
484
488
  - lib/buildr/ide/idea.rb
485
489
  - lib/buildr/java/ant.rb
@@ -517,6 +521,7 @@ files:
517
521
  - lib/buildr/resources/failed.png
518
522
  - lib/buildr/resources/icons-license.txt
519
523
  - lib/buildr/run.rb
524
+ - lib/buildr/scala.rb
520
525
  - lib/buildr/scala/bdd.rb
521
526
  - lib/buildr/scala/compiler.rb
522
527
  - lib/buildr/scala/doc.rb
@@ -526,10 +531,8 @@ files:
526
531
  - lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.java
527
532
  - lib/buildr/scala/shell.rb
528
533
  - lib/buildr/scala/tests.rb
529
- - lib/buildr/scala.rb
530
534
  - lib/buildr/shell.rb
531
535
  - lib/buildr/version.rb
532
- - lib/buildr.rb
533
536
  - rakelib/all-in-one.rake
534
537
  - rakelib/checks.rake
535
538
  - rakelib/doc.rake
@@ -593,42 +596,34 @@ files:
593
596
  - spec/spec_helpers.rb
594
597
  - spec/version_requirement_spec.rb
595
598
  - spec/xpath_matchers.rb
596
- - buildr.gemspec
597
- - buildr.buildfile
598
- - LICENSE
599
- - NOTICE
600
- - CHANGELOG
601
- - README.rdoc
602
- - Rakefile
603
- - _buildr
604
- - _jbuildr
605
599
  homepage: http://buildr.apache.org/
606
- licenses: []
600
+ licenses:
601
+ - Apache-2.0
607
602
  metadata: {}
608
603
  post_install_message: To get started run buildr --help
609
604
  rdoc_options:
610
- - --title
605
+ - "--title"
611
606
  - Buildr
612
- - --main
607
+ - "--main"
613
608
  - README.rdoc
614
- - --webcvs
609
+ - "--webcvs"
615
610
  - https://github.com/apache/buildr
616
611
  require_paths:
617
612
  - lib
618
613
  - addon
619
614
  required_ruby_version: !ruby/object:Gem::Requirement
620
615
  requirements:
621
- - - ! '>='
616
+ - - ">="
622
617
  - !ruby/object:Gem::Version
623
618
  version: '0'
624
619
  required_rubygems_version: !ruby/object:Gem::Requirement
625
620
  requirements:
626
- - - ! '>='
621
+ - - ">="
627
622
  - !ruby/object:Gem::Version
628
623
  version: 1.8.6
629
624
  requirements: []
630
625
  rubyforge_project: buildr
631
- rubygems_version: 2.0.3
626
+ rubygems_version: 2.2.2
632
627
  signing_key:
633
628
  specification_version: 4
634
629
  summary: Build like you code