lib/buildr4osgi/eclipse/p2.rb in buildr4osgi-0.9.4 vs lib/buildr4osgi/eclipse/p2.rb in buildr4osgi-0.9.5

- old
+ new

@@ -35,25 +35,28 @@ def initialize(*args) #:nodoc: super enhance do |p2_task| - fail "The p2 task needs to be associated with a site " unless site - p2_task.enhance [site] + if @site.nil? + @site = project.package(:site) + end + fail "The p2 task needs to be associated with a site " if @site.nil? + p2_task.enhance [@site] #add a prerequisite to the list of prerequisites, gives a chance #for other prerequisites to be placed before this block is executed. p2_task.enhance do targetP2Repo = File.join(project.base_dir, "target", "p2repository") mkpath targetP2Repo - Buildr::unzip(targetP2Repo=>project.package(:site).to_s).extract + Buildr::unzip(targetP2Repo=>@site.to_s).extract eclipseSDK = Buildr::artifact("org.eclipse:eclipse-SDK:zip:3.6M3-win32") eclipseSDK.invoke Buildr::unzip(File.dirname(eclipseSDK.to_s) => eclipseSDK.to_s).extract launcherPlugin = Dir.glob("#{File.dirname(eclipseSDK.to_s)}/eclipse/plugins/org.eclipse.equinox.launcher_*")[0] - cmdline <<-CMD + cmdline = <<-CMD java -jar #{launcherPlugin} -application org.eclipse.equinox.p2.publisher.UpdateSitePublisher -metadataRepository file:#{targetP2Repo} -artifactRepository file:#{targetP2Repo} -metadataRepositoryName #{project.name}_#{project.version} -artifactRepositoryName #{project.name}_#{project.version} @@ -61,10 +64,10 @@ -configs gtk.linux.x86 -publishArtifacts -clean -consoleLog CMD info "Invoking P2's metadata generation: #{cmdline}" - system cmdline + system cmdline.gsub(/\n/, "").gsub(/\s+/, " ") include targetP2Repo, :as => "." end end end