You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2019/08/17 23:05:57 UTC

svn commit: r1865374 - /commons/scripts/pomline.rb

Author: sebb
Date: Sat Aug 17 23:05:57 2019
New Revision: 1865374

URL: http://svn.apache.org/viewvc?rev=1865374&view=rev
Log:
Show outline of pom compared with targe

Added:
    commons/scripts/pomline.rb   (with props)

Added: commons/scripts/pomline.rb
URL: http://svn.apache.org/viewvc/commons/scripts/pomline.rb?rev=1865374&view=auto
==============================================================================
--- commons/scripts/pomline.rb (added)
+++ commons/scripts/pomline.rb Sat Aug 17 23:05:57 2019
@@ -0,0 +1,63 @@
+#!/usr/bin/env ruby
+
+# @(#) generate outline listing of a POM file showing target section order
+
+require 'nokogiri'
+
+# target order
+ORDER=%w(
+    modelVersion
+    parent
+    groupId
+    artifactId
+    version
+    packaging
+    name
+    description
+    url
+    inceptionYear
+    organization
+    licenses
+    properties
+    mailingLists
+    prerequisites
+    modules
+    scm
+    issueManagement
+    ciManagement
+    distributionManagement
+    dependencyManagement
+    dependencies
+    repositories
+    pluginRepositories
+    build
+    reporting
+    profiles
+    developers
+    contributors
+)
+
+doc = Nokogiri::XML(ARGF) do |config|
+  config.options = Nokogiri::XML::ParseOptions::NOBLANKS
+end
+
+lasti = 0
+j=0
+
+doc.root.children.each do |child|
+    n = child.name
+    next if n == 'comment'
+    i = ORDER.index(n)
+    unless i
+    puts n
+    next
+    end
+    m = ''
+    if i < lasti
+        m=' ?'
+        j+=1 
+    end
+    puts "%2d #{n}%s" % [i, m]
+    lasti = i
+end
+puts "Found #{j} errors"

Propchange: commons/scripts/pomline.rb
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/scripts/pomline.rb
------------------------------------------------------------------------------
    svn:executable = *