Permalink
Browse files

Use Gem::PackageTask consistently also on JavaExtensionTask

  • Loading branch information...
1 parent d9078a8 commit 83d8702cff14fbcee14b36109e1e43ae9d91df92 @luislavena luislavena committed Jun 8, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/rake/javaextensiontask.rb
View
7 lib/rake/javaextensiontask.rb
@@ -134,9 +134,10 @@ def define_java_platform_tasks
if @gem_spec && !Rake::Task.task_defined?("java:#{@gem_spec.name}")
task "java:#{@gem_spec.name}" do |t|
-
- # FIXME: truly duplicate the Gem::Specification
+ # FIXME: workaround Gem::Specification limitation around cache_file:
+ # http://github.com/rubygems/rubygems/issues/78
spec = gem_spec.dup
+ spec.instance_variable_set(:"@cache_file", nil) if spec.respond_to?(:cache_file)
# adjust to specified platform
spec.platform = Gem::Platform.new('java')
@@ -161,7 +162,7 @@ def define_java_platform_tasks
end
# Generate a package for this gem
- gem_package = Rake::GemPackageTask.new(spec) do |pkg|
+ Gem::PackageTask.new(spec) do |pkg|
pkg.need_zip = false
pkg.need_tar = false
end

0 comments on commit 83d8702

Please sign in to comment.