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/15 13:28:31 UTC

svn commit: r1865222 - in /commons/scripts: examples/ examples/io.skel examples/lang.skel examples/net.skel pomskel.rb

Author: sebb
Date: Thu Aug 15 13:28:31 2019
New Revision: 1865222

URL: http://svn.apache.org/viewvc?rev=1865222&view=rev
Log:
pom skeleton extractor and examples

Added:
    commons/scripts/examples/
    commons/scripts/examples/io.skel
    commons/scripts/examples/lang.skel
    commons/scripts/examples/net.skel
    commons/scripts/pomskel.rb   (with props)

Added: commons/scripts/examples/io.skel
URL: http://svn.apache.org/viewvc/commons/scripts/examples/io.skel?rev=1865222&view=auto
==============================================================================
--- commons/scripts/examples/io.skel (added)
+++ commons/scripts/examples/io.skel Thu Aug 15 13:28:31 2019
@@ -0,0 +1,31 @@
+<project>
+  <parent>
+    <groupId/>
+    <artifactId/>
+    <version/>
+  </parent>
+  <modelVersion/>
+  <groupId/>
+  <artifactId/>
+  <version/>
+  <name/>
+  <inceptionYear/>
+  <description/>
+  <url/>
+  <issueManagement>...</issueManagement>
+  <distributionManagement>...</distributionManagement>
+  <scm>...</scm>
+  <developers>...</developers>
+  <contributors>...</contributors>
+  <dependencies>...</dependencies>
+  <properties>...</properties>
+  <build>
+    <defaultGoal/>
+    <pluginManagement>...</pluginManagement>
+    <plugins>...</plugins>
+  </build>
+  <reporting>
+    <plugins>...</plugins>
+  </reporting>
+  <profiles>...</profiles>
+</project>

Added: commons/scripts/examples/lang.skel
URL: http://svn.apache.org/viewvc/commons/scripts/examples/lang.skel?rev=1865222&view=auto
==============================================================================
--- commons/scripts/examples/lang.skel (added)
+++ commons/scripts/examples/lang.skel Thu Aug 15 13:28:31 2019
@@ -0,0 +1,30 @@
+<project>
+  <parent>
+    <groupId/>
+    <artifactId/>
+    <version/>
+  </parent>
+  <modelVersion/>
+  <artifactId/>
+  <version/>
+  <name/>
+  <inceptionYear/>
+  <description/>
+  <url/>
+  <issueManagement>...</issueManagement>
+  <scm>...</scm>
+  <developers>...</developers>
+  <contributors>...</contributors>
+  <dependencies>...</dependencies>
+  <distributionManagement>...</distributionManagement>
+  <properties>...</properties>
+  <build>
+    <defaultGoal/>
+    <pluginManagement>...</pluginManagement>
+    <plugins>...</plugins>
+  </build>
+  <reporting>
+    <plugins>...</plugins>
+  </reporting>
+  <profiles>...</profiles>
+</project>

Added: commons/scripts/examples/net.skel
URL: http://svn.apache.org/viewvc/commons/scripts/examples/net.skel?rev=1865222&view=auto
==============================================================================
--- commons/scripts/examples/net.skel (added)
+++ commons/scripts/examples/net.skel Thu Aug 15 13:28:31 2019
@@ -0,0 +1,29 @@
+<project>
+  <modelVersion/>
+  <parent>
+    <groupId/>
+    <artifactId/>
+    <version/>
+  </parent>
+  <groupId/>
+  <artifactId/>
+  <version/>
+  <name/>
+  <description/>
+  <url/>
+  <inceptionYear/>
+  <developers>...</developers>
+  <contributors>...</contributors>
+  <scm>...</scm>
+  <issueManagement>...</issueManagement>
+  <distributionManagement>...</distributionManagement>
+  <properties>...</properties>
+  <dependencies>...</dependencies>
+  <build>
+    <pluginManagement>...</pluginManagement>
+    <plugins>...</plugins>
+  </build>
+  <reporting>
+    <plugins>...</plugins>
+  </reporting>
+</project>

Added: commons/scripts/pomskel.rb
URL: http://svn.apache.org/viewvc/commons/scripts/pomskel.rb?rev=1865222&view=auto
==============================================================================
--- commons/scripts/pomskel.rb (added)
+++ commons/scripts/pomskel.rb Thu Aug 15 13:28:31 2019
@@ -0,0 +1,49 @@
+#!/usr/bin/env ruby
+
+# @(#) generate skeleton listing of a POM file
+
+require 'nokogiri'
+
+IGNORE=%w(comment) # don't show
+# don't show children
+PRUNE=%w(
+    contributors 
+    dependencies 
+    developers 
+    distributionManagement
+    issueManagement
+    pluginManagement
+    plugins
+    profiles
+    properties 
+    scm 
+)
+
+def textonly?(node)
+    return node.children.count == 1 && node.children.first.name == 'text'
+end
+
+def show(node, depth)
+    name = node.name
+    if textonly? node # empty
+        puts "#{depth}<#{name}/>"
+        return
+    end
+    if PRUNE.include? name
+        puts "#{depth}<#{name}>...</#{name}>"
+        return
+    end
+    return if IGNORE.include? name
+
+    puts "#{depth}<#{name}>"
+    node.children.each do |child|
+      show(child,depth+'  ')
+    end
+    puts "#{depth}</#{name}>"
+end
+
+doc = Nokogiri::XML(ARGF) do |config|
+  config.options = Nokogiri::XML::ParseOptions::NOBLANKS
+end
+
+show(doc.root,'')

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

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