rjack-tarpit 1.2.3 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/History.rdoc +10 -0
  2. data/README.rdoc +1 -1
  3. data/Rakefile +7 -6
  4. data/lib/rjack-tarpit.rb +53 -17
  5. metadata +9 -23
data/History.rdoc CHANGED
@@ -1,3 +1,13 @@
1
+ === 1.3.0 (2011-2-5)
2
+ * Add new install_deps task to install missing or all gem
3
+ dev. dependencies.
4
+ * Use hard links for jars to avoid package problems with rubygems 1.4+
5
+ * Update to hoe 2.8.0 and drop now unnecessary explicit dependency on
6
+ rubyforge.
7
+ * Update rdoc dependency to >= 2.5.11, < 3.6 (3.5.2 works well.)
8
+ * Generate manifest only once per run.
9
+ * Fix git status check on tag (status --only flag no longer supported.)
10
+
1
11
  === 1.2.3 (2010-12-28)
2
12
  * Update rdoc dependency to >= 2.5.11, < 3.1 (3.0.1 works well.)
3
13
 
data/README.rdoc CHANGED
@@ -29,7 +29,7 @@ source with maven:
29
29
  require 'mygem/version'
30
30
 
31
31
  require 'rubygems'
32
- gem 'rjack-tarpit', '~> 1.2.3'
32
+ gem 'rjack-tarpit', '~> 1.3.0'
33
33
  require 'rjack-tarpit'
34
34
 
35
35
  t = RJack::TarPit.new( 'mygem', MyGem::VERSION, :java_platform )
data/Rakefile CHANGED
@@ -3,9 +3,12 @@
3
3
  $LOAD_PATH << './lib'
4
4
  require 'rubygems'
5
5
 
6
- # Use same hoe version for building gem plus this gem's dependency
7
- hoe_version = '~> 2.3.3'
8
- gem 'hoe', hoe_version
6
+ tarpit_deps = [ [ 'rdoc', '>= 2.5.11', '< 3.6' ],
7
+ [ 'hoe', '~> 2.8.0' ] ]
8
+
9
+ # gem them here, so we can build tarpit with tarpit_deps
10
+ tarpit_deps.each { |dep| gem( *dep ) }
11
+
9
12
  require 'rjack-tarpit'
10
13
 
11
14
  include RJack
@@ -14,9 +17,7 @@ t = TarPit.new( 'rjack-tarpit', TarPit::VERSION )
14
17
 
15
18
  t.specify do |h|
16
19
  h.developer( 'David Kellum', 'dek-oss@gravitext.com' )
17
- h.extra_deps += [ [ 'rdoc', '>= 2.5.11', '< 3.1' ],
18
- [ 'rubyforge', '~> 1.0.3' ],
19
- [ 'hoe', hoe_version ] ]
20
+ h.extra_deps += tarpit_deps
20
21
  h.rubyforge_name = 'rjack'
21
22
  h.remote_rdoc_dir = 'tarpit'
22
23
  end
data/lib/rjack-tarpit.rb CHANGED
@@ -21,7 +21,7 @@ module RJack
21
21
  # Provides glue for Rake, Hoe, and Maven by generating tasks.
22
22
  module TarPit
23
23
  # Module version
24
- VERSION = '1.2.3'
24
+ VERSION = '1.3.0'
25
25
 
26
26
  # Construct new task generator by gem name, version, and flags. A descendant
27
27
  # of BaseStrategy is returned.
@@ -216,7 +216,7 @@ module RJack
216
216
  dest = File.join( jar_dest, jar )
217
217
  file from => [ MVN_STATE_FILE ]
218
218
  file dest => [ from ] do
219
- ln_sf( File.join( '..', '..', from ), dest )
219
+ ln( from, dest, :force => true )
220
220
  end
221
221
  [ :gem, :test ].each { |t| task t => [ dest ] }
222
222
  end
@@ -244,10 +244,10 @@ module RJack
244
244
  tag = [ name, version ].join( '-' )
245
245
  dname = Rake.original_dir
246
246
  dname = '.' if Dir.getwd == dname
247
- sh( "git status --only #{dname}" ) do |ok,res|
248
- if ok #changes present
249
- raise "Commit these changes before tagging."
250
- end
247
+ delta = `git status --porcelain -- #{dname} 2>&1`.split(/^/)
248
+ if delta.length > 0
249
+ puts delta
250
+ raise "Commit these changes before tagging"
251
251
  end
252
252
  sh %{git tag -s -f -m "tag [#{tag}]" "#{tag}"}
253
253
  end
@@ -263,13 +263,46 @@ module RJack
263
263
  cm.run( gem_config( 'push', '-V', gem_file ) )
264
264
  end
265
265
 
266
- desc "gem install (default install dir)"
266
+ desc "gem(+maven) install"
267
267
  task :install => [ :gem ] do
268
268
  require 'rubygems'
269
269
  require 'rubygems/command_manager'
270
270
  cm = Gem::CommandManager.instance
271
- cm.run( gem_config( 'install', '--local', '-V', gem_file ) )
271
+ begin
272
+ cm.run( gem_config( 'install', '--local', '-V', gem_file ) )
273
+ rescue Gem::SystemExitException
274
+ #ignore
275
+ end
272
276
  end
277
+
278
+ desc "gem install missing/all dev dependencies"
279
+ task( :install_deps, :force ) do |t,args|
280
+ require 'rubygems'
281
+ require 'rubygems/command_manager'
282
+ force = ( args[:force] == 'force' )
283
+ ( @spec.extra_deps + @spec.extra_dev_deps ).each do |dep|
284
+ if force
285
+ gem_install_dep( dep )
286
+ else
287
+ begin
288
+ gem( *dep )
289
+ rescue Gem::LoadError => e
290
+ puts "Gem dep: " + e.to_s
291
+ gem_install_dep( dep )
292
+ end
293
+ end
294
+ end
295
+ end
296
+ end
297
+
298
+ def gem_install_dep( dep )
299
+ puts "Install: " + dep.inspect
300
+ cm = Gem::CommandManager.instance
301
+ c = [ 'install', '--remote', '-V', dep.first ]
302
+ c += dep[1..-1].map { |r| [ '-v', r ] }.flatten
303
+ cm.run( gem_config( *c ) )
304
+ rescue Gem::SystemExitException
305
+ #ignore
273
306
  end
274
307
 
275
308
  def gem_file
@@ -319,17 +352,20 @@ module RJack
319
352
 
320
353
  # Generate Manifest.txt
321
354
  def generate_manifest
322
- remove_dest_jars
355
+ unless @generated_manifest #only once
356
+ remove_dest_jars
323
357
 
324
- m = []
325
- if File.exist?( 'Manifest.static' )
326
- m += read_file_list( 'Manifest.static' )
327
- end
328
- m += clean_list( generated_files ).sort
329
- m += dest_jars
358
+ m = []
359
+ if File.exist?( 'Manifest.static' )
360
+ m += read_file_list( 'Manifest.static' )
361
+ end
362
+ m += clean_list( generated_files ).sort
363
+ m += dest_jars
330
364
 
331
- puts "TARPIT: Updating Manifest.txt"
332
- open( 'Manifest.txt', 'w' ) { |out| out.puts m }
365
+ puts "TARPIT: Updating Manifest.txt"
366
+ open( 'Manifest.txt', 'w' ) { |out| out.puts m }
367
+ @generated_manifest = true
368
+ end
333
369
  end
334
370
 
335
371
  # Remove jars in jar_dest by wildcard expression
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 1
7
- - 2
8
7
  - 3
9
- version: 1.2.3
8
+ - 0
9
+ version: 1.3.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - David Kellum
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-28 00:00:00 -08:00
17
+ date: 2011-02-05 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -33,38 +33,24 @@ dependencies:
33
33
  - !ruby/object:Gem::Version
34
34
  segments:
35
35
  - 3
36
- - 1
37
- version: "3.1"
36
+ - 6
37
+ version: "3.6"
38
38
  type: :runtime
39
39
  version_requirements: *id001
40
40
  - !ruby/object:Gem::Dependency
41
- name: rubyforge
41
+ name: hoe
42
42
  prerelease: false
43
43
  requirement: &id002 !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  segments:
48
- - 1
48
+ - 2
49
+ - 8
49
50
  - 0
50
- - 3
51
- version: 1.0.3
51
+ version: 2.8.0
52
52
  type: :runtime
53
53
  version_requirements: *id002
54
- - !ruby/object:Gem::Dependency
55
- name: hoe
56
- prerelease: false
57
- requirement: &id003 !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ~>
60
- - !ruby/object:Gem::Version
61
- segments:
62
- - 2
63
- - 3
64
- - 3
65
- version: 2.3.3
66
- type: :runtime
67
- version_requirements: *id003
68
54
  description: |-
69
55
  TarPit provides the glue for an unholy union of build tools. Namely:
70
56