buildr 1.4.20-x86-mswin32 → 1.4.21-x86-mswin32

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: x86-mswin32
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
@@ -114,28 +114,28 @@ dependencies:
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 1.4.9
117
+ version: 1.5.1
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 1.4.9
124
+ version: 1.5.1
125
125
  - !ruby/object:Gem::Dependency
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,42 +238,42 @@ dependencies:
238
238
  name: bundler
239
239
  requirement: !ruby/object:Gem::Requirement
240
240
  requirements:
241
- - - ! '>='
241
+ - - ">="
242
242
  - !ruby/object:Gem::Version
243
243
  version: '0'
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'
251
251
  - !ruby/object:Gem::Dependency
252
252
  name: orderedhash
253
253
  requirement: !ruby/object:Gem::Requirement
254
254
  requirements:
255
- - - ! '>='
255
+ - - '='
256
256
  - !ruby/object:Gem::Version
257
- version: '0'
257
+ version: 0.0.6
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
- version: '0'
264
+ version: 0.0.6
265
265
  - !ruby/object:Gem::Dependency
266
266
  name: win32console1.3.2
267
267
  requirement: !ruby/object:Gem::Requirement
268
268
  requirements:
269
- - - ! '>='
269
+ - - ">="
270
270
  - !ruby/object:Gem::Version
271
271
  version: '0'
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
278
  version: '0'
279
279
  - !ruby/object:Gem::Dependency
@@ -402,18 +402,12 @@ dependencies:
402
402
  - - '='
403
403
  - !ruby/object:Gem::Version
404
404
  version: 1.2.1
405
- description: ! 'Apache Buildr is a build system for Java-based applications, including
406
- support
407
-
405
+ description: |
406
+ Apache Buildr is a build system for Java-based applications, including support
408
407
  for Scala, Groovy and a growing number of JVM languages and tools. We wanted
409
-
410
- something that''s simple and intuitive to use, so we only need to tell it what
411
-
408
+ something that's simple and intuitive to use, so we only need to tell it what
412
409
  to do, and it takes care of the rest. But also something we can easily extend
413
-
414
- for those one-off tasks, with a language that''s a joy to use.
415
-
416
- '
410
+ for those one-off tasks, with a language that's a joy to use.
417
411
  email: users@buildr.apache.org
418
412
  executables:
419
413
  - buildr
@@ -424,6 +418,13 @@ extra_rdoc_files:
424
418
  - LICENSE
425
419
  - NOTICE
426
420
  files:
421
+ - CHANGELOG
422
+ - LICENSE
423
+ - NOTICE
424
+ - README.rdoc
425
+ - Rakefile
426
+ - _buildr
427
+ - _jbuildr
427
428
  - addon/buildr/antlr.rb
428
429
  - addon/buildr/bnd.rb
429
430
  - addon/buildr/checkstyle-report.xsl
@@ -467,6 +468,8 @@ files:
467
468
  - addon/buildr/wsgen.rb
468
469
  - addon/buildr/xmlbeans.rb
469
470
  - bin/buildr
471
+ - buildr.buildfile
472
+ - buildr.gemspec
470
473
  - doc/_config.yml
471
474
  - doc/_layouts/default.html
472
475
  - doc/_layouts/preface.html
@@ -506,8 +509,9 @@ files:
506
509
  - doc/settings_profiles.textile
507
510
  - doc/testing.textile
508
511
  - etc/KEYS
509
- - lib/buildr/clojure/shell.rb
512
+ - lib/buildr.rb
510
513
  - lib/buildr/clojure.rb
514
+ - lib/buildr/clojure/shell.rb
511
515
  - lib/buildr/core/application.rb
512
516
  - lib/buildr/core/assets.rb
513
517
  - lib/buildr/core/build.rb
@@ -531,11 +535,11 @@ files:
531
535
  - lib/buildr/core/test.rb
532
536
  - lib/buildr/core/transports.rb
533
537
  - lib/buildr/core/util.rb
538
+ - lib/buildr/groovy.rb
534
539
  - lib/buildr/groovy/bdd.rb
535
540
  - lib/buildr/groovy/compiler.rb
536
541
  - lib/buildr/groovy/doc.rb
537
542
  - lib/buildr/groovy/shell.rb
538
- - lib/buildr/groovy.rb
539
543
  - lib/buildr/ide/eclipse.rb
540
544
  - lib/buildr/ide/idea.rb
541
545
  - lib/buildr/java/ant.rb
@@ -573,6 +577,7 @@ files:
573
577
  - lib/buildr/resources/failed.png
574
578
  - lib/buildr/resources/icons-license.txt
575
579
  - lib/buildr/run.rb
580
+ - lib/buildr/scala.rb
576
581
  - lib/buildr/scala/bdd.rb
577
582
  - lib/buildr/scala/compiler.rb
578
583
  - lib/buildr/scala/doc.rb
@@ -582,10 +587,8 @@ files:
582
587
  - lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.java
583
588
  - lib/buildr/scala/shell.rb
584
589
  - lib/buildr/scala/tests.rb
585
- - lib/buildr/scala.rb
586
590
  - lib/buildr/shell.rb
587
591
  - lib/buildr/version.rb
588
- - lib/buildr.rb
589
592
  - rakelib/all-in-one.rake
590
593
  - rakelib/checks.rake
591
594
  - rakelib/doc.rake
@@ -649,42 +652,34 @@ files:
649
652
  - spec/spec_helpers.rb
650
653
  - spec/version_requirement_spec.rb
651
654
  - spec/xpath_matchers.rb
652
- - buildr.gemspec
653
- - buildr.buildfile
654
- - LICENSE
655
- - NOTICE
656
- - CHANGELOG
657
- - README.rdoc
658
- - Rakefile
659
- - _buildr
660
- - _jbuildr
661
655
  homepage: http://buildr.apache.org/
662
- licenses: []
656
+ licenses:
657
+ - Apache-2.0
663
658
  metadata: {}
664
659
  post_install_message: To get started run buildr --help
665
660
  rdoc_options:
666
- - --title
661
+ - "--title"
667
662
  - Buildr
668
- - --main
663
+ - "--main"
669
664
  - README.rdoc
670
- - --webcvs
665
+ - "--webcvs"
671
666
  - https://github.com/apache/buildr
672
667
  require_paths:
673
668
  - lib
674
669
  - addon
675
670
  required_ruby_version: !ruby/object:Gem::Requirement
676
671
  requirements:
677
- - - ! '>='
672
+ - - ">="
678
673
  - !ruby/object:Gem::Version
679
674
  version: '0'
680
675
  required_rubygems_version: !ruby/object:Gem::Requirement
681
676
  requirements:
682
- - - ! '>='
677
+ - - ">="
683
678
  - !ruby/object:Gem::Version
684
679
  version: 1.8.6
685
680
  requirements: []
686
681
  rubyforge_project: buildr
687
- rubygems_version: 2.0.3
682
+ rubygems_version: 2.2.2
688
683
  signing_key:
689
684
  specification_version: 4
690
685
  summary: Build like you code