rjack-tarpit 1.2.1 → 1.2.2

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 +6 -0
  2. data/README.rdoc +2 -2
  3. data/Rakefile +0 -15
  4. data/lib/rjack-tarpit.rb +20 -7
  5. metadata +3 -3
data/History.rdoc CHANGED
@@ -1,3 +1,9 @@
1
+ === 1.2.2 (2010-7-8)
2
+ * Actually, use both Gem.configuration['gem'] and [command] in gem
3
+ command tasks (i.e. .gemrc with install: args)
4
+ * Perform a 'mvn install' with rake :install task, checking for
5
+ changes since last .tarpit-install.
6
+
1
7
  === 1.2.1 (2010-4-21)
2
8
  * Also require 'rubygems/command_manager' for gem tasks (ruby)
3
9
  * Really use Gem.configuration['gem'] in gem command tasks.
data/README.rdoc CHANGED
@@ -29,10 +29,10 @@ source with maven:
29
29
  require 'mygem/version'
30
30
 
31
31
  require 'rubygems'
32
- gem 'rjack-tarpit', '~> 1.2.1'
32
+ gem 'rjack-tarpit', '~> 1.2.2'
33
33
  require 'rjack-tarpit'
34
34
 
35
- t = RJack::TarPit.new( 'mygem', MyGem::VERSION, :no_assembly, :java_package )
35
+ t = RJack::TarPit.new( 'mygem', MyGem::VERSION, :java_platform )
36
36
 
37
37
  t.specify do |h|
38
38
  h.developer( "David Kellum", "dek-oss@gravitext.com" )
data/Rakefile CHANGED
@@ -1,19 +1,4 @@
1
1
  # -*- ruby -*-
2
- #--
3
- # Copyright (C) 2009 David Kellum
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License"); you
6
- # may not use this file except in compliance with the License. You
7
- # 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,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14
- # implied. See the License for the specific language governing
15
- # permissions and limitations under the License.
16
- #++
17
2
 
18
3
  $LOAD_PATH << './lib'
19
4
  require 'rubygems'
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.1'
24
+ VERSION = '1.2.2'
25
25
 
26
26
  # Construct new task generator by gem name, version, and flags. A descendant
27
27
  # of BaseStrategy is returned.
@@ -79,6 +79,9 @@ module RJack
79
79
  @hoe_specifier = :unset
80
80
  @rdoc_diagram = false
81
81
  @spec = nil
82
+
83
+ @install_request =
84
+ Rake.application.top_level_tasks.include?( "install" )
82
85
  end
83
86
 
84
87
  # Return a default jar name built from name and version
@@ -181,12 +184,14 @@ module RJack
181
184
 
182
185
  # File touched to record the time of last successful 'mvn
183
186
  # package' run.
184
- MVN_STATE_FILE = 'target/.tarpit'
187
+ MVN_STATE_FILE = 'target/.tarpit'
188
+ MVN_STATE_FILE_INSTALL = 'target/.tarpit-install'
185
189
 
186
190
  # Define a file task tracking calls to "mvn package"
187
191
  def define_maven_package_task
188
192
  file MVN_STATE_FILE => maven_dependencies do
189
- sh( 'mvn package' ) do |ok,res|
193
+ mvn = [ 'mvn', @install_request ? 'install' : 'package' ].join(' ')
194
+ sh( mvn ) do |ok,res|
190
195
  if ok
191
196
  touch( MVN_STATE_FILE )
192
197
  else
@@ -194,6 +199,12 @@ module RJack
194
199
  end
195
200
  end
196
201
  end
202
+
203
+ file MVN_STATE_FILE_INSTALL => MVN_STATE_FILE do
204
+ touch( MVN_STATE_FILE_INSTALL )
205
+ end
206
+ task :install => MVN_STATE_FILE_INSTALL
207
+
197
208
  end
198
209
 
199
210
  # Define file tasks for all jar symlinks and other misc. maven
@@ -257,8 +268,7 @@ module RJack
257
268
  require 'rubygems'
258
269
  require 'rubygems/command_manager'
259
270
  cm = Gem::CommandManager.instance
260
- cm.run( gem_config( 'install',
261
- '--local', '--no-ri', '-V', gem_file ) )
271
+ cm.run( gem_config( 'install', '--local', '-V', gem_file ) )
262
272
  end
263
273
  end
264
274
 
@@ -273,8 +283,11 @@ module RJack
273
283
  end
274
284
 
275
285
  def gem_config( command, *args )
276
- cargs = Gem.configuration[ 'gem' ]
277
- cargs = cargs.is_a?( String ) ? cargs.split( ' ' ) : cargs.to_a
286
+ cargs = [ 'gem', command ].map do |cmd|
287
+ conf = Gem.configuration[ cmd ]
288
+ conf.is_a?( String ) ? conf.split( ' ' ) : conf.to_a
289
+ end
290
+ cargs.flatten!
278
291
  [ command ] + cargs + args
279
292
  end
280
293
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 2
8
- - 1
9
- version: 1.2.1
8
+ - 2
9
+ version: 1.2.2
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-04-21 00:00:00 -07:00
17
+ date: 2010-07-08 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency