From 7231488dfd44015904c6009fa98fada59979f11a Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Fri, 26 Aug 2022 17:12:27 -0400 Subject: [PATCH] dev: format JAR_DEPENDENCIES to one-dep-per-line to try to minimize merge conflicts going forward --- lib/nokogiri/jruby/nokogiri_jars.rb | 19 ++++++++++++++++++- rakelib/extensions.rake | 12 +++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/lib/nokogiri/jruby/nokogiri_jars.rb b/lib/nokogiri/jruby/nokogiri_jars.rb index e45ae2f354d..261cfceccfe 100644 --- a/lib/nokogiri/jruby/nokogiri_jars.rb +++ b/lib/nokogiri/jruby/nokogiri_jars.rb @@ -41,7 +41,24 @@ # generated by the :vendor_jars rake task module Nokogiri - JAR_DEPENDENCIES = {"com.fasterxml.woodstox:woodstox-core"=>"6.2.6", "commons-codec:commons-codec"=>"1.15", "isorelax:isorelax"=>"20030108", "jakarta.activation:jakarta.activation-api"=>"1.2.2", "jakarta.xml.bind:jakarta.xml.bind-api"=>"2.3.3", "net.sf.saxon:Saxon-HE"=>"9.6.0-4", "net.sourceforge.htmlunit:neko-htmlunit"=>"2.63.0", "nu.validator:jing"=>"20200702VNU", "org.apache.santuario:xmlsec"=>"2.3.1", "org.codehaus.woodstox:stax2-api"=>"4.2.1", "org.nokogiri:nekodtd"=>"0.1.11.noko1", "org.slf4j:slf4j-api"=>"1.7.36", "xalan:serializer"=>"2.7.2", "xalan:xalan"=>"2.7.2", "xerces:xercesImpl"=>"2.12.2", "xml-apis:xml-apis"=>"1.4.01"}.freeze + JAR_DEPENDENCIES = { + "com.fasterxml.woodstox:woodstox-core" => "6.2.6", + "commons-codec:commons-codec" => "1.15", + "isorelax:isorelax" => "20030108", + "jakarta.activation:jakarta.activation-api" => "1.2.2", + "jakarta.xml.bind:jakarta.xml.bind-api" => "2.3.3", + "net.sf.saxon:Saxon-HE" => "9.6.0-4", + "net.sourceforge.htmlunit:neko-htmlunit" => "2.63.0", + "nu.validator:jing" => "20200702VNU", + "org.apache.santuario:xmlsec" => "2.3.1", + "org.codehaus.woodstox:stax2-api" => "4.2.1", + "org.nokogiri:nekodtd" => "0.1.11.noko1", + "org.slf4j:slf4j-api" => "1.7.36", + "xalan:serializer" => "2.7.2", + "xalan:xalan" => "2.7.2", + "xerces:xercesImpl" => "2.12.2", + "xml-apis:xml-apis" => "1.4.01", + }.freeze XERCES_VERSION = JAR_DEPENDENCIES["xerces:xercesImpl"] NEKO_VERSION = JAR_DEPENDENCIES["net.sourceforge.htmlunit:neko-htmlunit"] end diff --git a/rakelib/extensions.rake b/rakelib/extensions.rake index 4bb71f4689d..54a395e074e 100644 --- a/rakelib/extensions.rake +++ b/rakelib/extensions.rake @@ -381,19 +381,29 @@ if java? desc "Vendor java dependencies" task :vendor_jars do require "jars/installer" + FileUtils.rm(FileList["lib/nokogiri/jruby/*/**/*.jar"], verbose: true) + jars = Jars::Installer.vendor_jars!("lib/nokogiri/jruby") jar_dependencies = jars.sort_by(&:gav).each_with_object({}) do |a, d| g, a, v = a.gav.split(":") name = [g, a].join(":") d[name] = v end + + # output this to try to minimize git merge conflicts going forward + string_rep = "{\n" + jar_dependencies.each do |ga, v| + string_rep += " #{ga.inspect} => #{v.inspect},\n" + end + string_rep += " }" + File.open("lib/nokogiri/jruby/nokogiri_jars.rb", "a") do |f| f.puts f.puts <<~EOF # generated by the :vendor_jars rake task module Nokogiri - JAR_DEPENDENCIES = #{jar_dependencies}.freeze + JAR_DEPENDENCIES = #{string_rep}.freeze XERCES_VERSION = JAR_DEPENDENCIES["xerces:xercesImpl"] NEKO_VERSION = JAR_DEPENDENCIES["net.sourceforge.htmlunit:neko-htmlunit"] end