Rakefile in appengine-tools-0.0.14 vs Rakefile in appengine-tools-0.0.15.pre
- old
+ new
@@ -1,15 +1,19 @@
require 'rubygems'
require 'rake/gempackagetask'
require 'rubygems/specification'
require 'date'
require 'spec/rake/spectask'
+require 'appengine-sdk'
GEM = "appengine-tools"
-GEM_VERSION = "0.0.14"
+GEM_VERSION = "0.0.15.pre"
HOMEPAGE = "http://code.google.com/p/appengine-jruby"
+PLUGIN_SOURCE = 'src/com/google/appengine/jruby/JRubyYamlPlugin.java'
+JAR_FILE = 'lib/appengine-tools/app_yaml.jar'
+
spec = Gem::Specification.new do |s|
s.name = GEM
s.version = GEM_VERSION
s.platform = Gem::Platform::RUBY
s.has_rdoc = true
@@ -23,11 +27,11 @@
s.email = ["ribrdb@google.com", "woodie@google.com"]
s.homepage = HOMEPAGE
s.require_path = 'lib'
s.files = %w(COPYING LICENSE README.rdoc Rakefile) +
- Dir.glob("{lib,spec}/**/*.{rb,class}")
+ Dir.glob("{lib,spec}/**/*.{rb,class}") + [JAR_FILE]
s.executables = [ 'appcfg.rb', 'dev_appserver.rb' ]
s.add_dependency('appengine-rack')
s.add_dependency('appengine-sdk')
s.add_dependency('bundler08', ["~> 0.8.4"])
s.add_dependency('rubyzip')
@@ -53,6 +57,18 @@
desc "create a gemspec file"
task :make_spec do
File.open("#{GEM}.gemspec", "w") do |file|
file.puts spec.to_ruby
end
+end
+
+def sh!(*args)
+ sh(*args) do |ok, res|
+ raise "Error #{res} from `#{args.join ' '}`" unless ok
+ end
+end
+
+file JAR_FILE => PLUGIN_SOURCE do
+ path = AppEngine::SDK::TOOLS_JAR
+ sh! "javac -cp #{path} #{PLUGIN_SOURCE}"
+ sh! "jar cf #{JAR_FILE} META-INF -C src com"
end