lib/buildr/openjpa.rb in buildr-0.22.0 vs lib/buildr/openjpa.rb in buildr-1.0.0
- old
+ new
@@ -1,11 +1,11 @@
require "java/java"
module Buildr
module OpenJPA
- VERSION = "0.9.7-incubating-SNAPSHOT"
+ VERSION = "0.9.7-incubating"
REQUIRES = [ "org.apache.openjpa:openjpa-all:jar:#{VERSION}",
"commons-collections:commons-collections:jar:3.1",
"commons-dbcp:commons-dbcp:jar:1.2.1",
"commons-lang:commons-lang:jar:2.1",
@@ -16,12 +16,12 @@
"net.sourceforge.serp:serp:jar:1.11.0" ]
class << self
def enhance(options)
- fu_check_options options, :classpath, :properties, :output
- artifacts = Buildr.artifacts(options[:classpath] || []).each { |a| a.invoke }.map(&:to_s) + [options[:output].to_s]
+ rake_check_options options, :classpath, :properties, :output
+ artifacts = Buildr.artifacts(options[:classpath]).each { |a| a.invoke }.map(&:to_s) + [options[:output].to_s]
properties = file(options[:properties]).tap { |task| task.invoke }.to_s
Ant.executable("openjpa") do |ant|
ant.taskdef :name=>"enhancer", :classname=>"org.apache.openjpa.ant.PCEnhancerTask",
:classpath=>requires.join(File::PATH_SEPARATOR)
@@ -31,21 +31,21 @@
end
end
end
def mapping_tool(options)
- fu_check_options options, :classpath, :properties, :sql, :action
+ rake_check_options options, :classpath, :properties, :sql, :action
Java.java "org.apache.openjpa.jdbc.meta.MappingTool", "-p", options[:properties].to_s, "-sql", options[:sql],
"-sa", options[:action], :classpath=>Buildr.artifacts(options[:classpath], requires), :name=>"Mapping Tool"
-=begin
# Hopefully this will work in a future release.
- artifacts = Buildr.artifacts(options[:classpath] || []).each{ |a| a.invoke }.map(&:to_s) + requires
- properties = file(options[:properties]).tap { |task| task.invoke }.to_s
+=begin
+ artifacts = Buildr.artifacts(options[:classpath]).each{ |a| a.invoke }.map(&:to_s) + requires
+ properties = file(options[:properties].to_s).tap { |task| task.invoke }.to_s
Ant.executable("openjpa") do |ant|
ant.taskdef :name=>"mapping", :classname=>"org.apache.openjpa.jdbc.ant.MappingToolTask",
:classpath=>requires.join(File::PATH_SEPARATOR)
- ant.mapping :schemaAction=>options[:action], :sqlFile=>options[:sql].to_s do
+ ant.mapping :schemaAction=>options[:action], :sqlFile=>options[:sql].to_s, :ignoreErrors=>"true" do
config :propertiesFile=>properties
classpath :path=>artifacts.join(File::PATH_SEPARATOR)
end
end
=end