Skip to content

Commit

Permalink
dev: format JAR_DEPENDENCIES to one-dep-per-line
Browse files Browse the repository at this point in the history
to try to minimize merge conflicts going forward
  • Loading branch information
flavorjones committed Aug 26, 2022
1 parent 340ffaf commit 7231488
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
19 changes: 18 additions & 1 deletion lib/nokogiri/jruby/nokogiri_jars.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 11 additions & 1 deletion rakelib/extensions.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7231488

Please sign in to comment.