summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Manifest.txt1
-rw-r--r--Rakefile20
2 files changed, 19 insertions, 2 deletions
diff --git a/Manifest.txt b/Manifest.txt
index 3fe28db..5803f6d 100644
--- a/Manifest.txt
+++ b/Manifest.txt
@@ -67,7 +67,6 @@ lib/psych/visitors/visitor.rb
lib/psych/visitors/yaml_tree.rb
lib/psych/y.rb
lib/psych_jars.rb
-lib/psych.jar
test/psych/handlers/test_recorder.rb
test/psych/helper.rb
test/psych/json/test_stream.rb
diff --git a/Rakefile b/Rakefile
index 15c7b7c..133aa6a 100644
--- a/Rakefile
+++ b/Rakefile
@@ -64,7 +64,25 @@ $hoe = Hoe.spec 'psych' do
end
end
end
-$hoe.spec.files << 'lib/psych.jar'
+
+def gem_build_path
+ File.join 'pkg', $hoe.spec.full_name
+end
+
+def add_file_to_gem relative_path
+ target_path = File.join gem_build_path, relative_path
+ target_dir = File.dirname(target_path)
+ mkdir_p target_dir unless File.directory?(target_dir)
+ rm_f target_path
+ safe_ln relative_path, target_path
+ $hoe.spec.files.concat [relative_path]
+end
+
+if java?
+ task gem_build_path => [:compile] do
+ add_file_to_gem 'lib/psych.jar'
+ end
+end
Hoe.add_include_dirs('.:lib/psych')