lib/buildr/openjpa.rb in buildr-1.0.0 vs lib/buildr/openjpa.rb in buildr-1.1.0
- old
+ new
@@ -13,10 +13,12 @@
"javax.persistence:persistence-api:jar:1.0",
"org.apache.geronimo.specs:geronimo-j2ee-connector_1.5_spec:jar:1.0",
"org.apache.geronimo.specs:geronimo-jta_1.0.1B_spec:jar:1.0",
"net.sourceforge.serp:serp:jar:1.11.0" ]
+ Java.rjb.classpath << REQUIRES
+
class << self
def enhance(options)
rake_check_options options, :classpath, :properties, :output
artifacts = Buildr.artifacts(options[:classpath]).each { |a| a.invoke }.map(&:to_s) + [options[:output].to_s]
@@ -32,31 +34,26 @@
end
end
def mapping_tool(options)
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"
- # Hopefully this will work in a future release.
-=begin
- artifacts = Buildr.artifacts(options[:classpath]).each{ |a| a.invoke }.map(&:to_s) + requires
+ artifacts = Buildr.artifacts(options[:classpath]).each{ |a| a.invoke }.map(&:to_s)
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, :ignoreErrors=>"true" do
config :propertiesFile=>properties
classpath :path=>artifacts.join(File::PATH_SEPARATOR)
end
end
-=end
end
private
def requires()
- @required ||= Buildr.artifacts(REQUIRES).each { |artifact| artifact.invoke }.map(&:to_s)
+ @requires ||= Buildr.artifacts(REQUIRES).each { |artifact| artifact.invoke }.map(&:to_s)
end
end
def open_jpa_enhance(options = nil)