You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by lt...@apache.org on 2005/09/24 01:19:42 UTC

svn commit: r291220 - in /maven/maven-1/plugins/trunk/changes: plugin.jelly src/plugin-resources/xsd/ src/plugin-resources/xsd/changes.xsd xdocs/changes.xml xdocs/goals.xml xdocs/index.xml

Author: ltheussl
Date: Fri Sep 23 16:19:37 2005
New Revision: 291220

URL: http://svn.apache.org/viewcvs?rev=291220&view=rev
Log:
MPCHANGES-25: Validate changes.xml

Added:
    maven/maven-1/plugins/trunk/changes/src/plugin-resources/xsd/
    maven/maven-1/plugins/trunk/changes/src/plugin-resources/xsd/changes.xsd
Modified:
    maven/maven-1/plugins/trunk/changes/plugin.jelly
    maven/maven-1/plugins/trunk/changes/xdocs/changes.xml
    maven/maven-1/plugins/trunk/changes/xdocs/goals.xml
    maven/maven-1/plugins/trunk/changes/xdocs/index.xml

Modified: maven/maven-1/plugins/trunk/changes/plugin.jelly
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/changes/plugin.jelly?rev=291220&r1=291219&r2=291220&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/changes/plugin.jelly (original)
+++ maven/maven-1/plugins/trunk/changes/plugin.jelly Fri Sep 23 16:19:37 2005
@@ -24,6 +24,7 @@
   xmlns:define="jelly:define"
   xmlns:util="jelly:util"
   xmlns:c="changes:transform"
+  xmlns:plugin="plugin"
   xmlns:doc="doc">
 
   <goal name="maven-changes-plugin:register">
@@ -76,6 +77,24 @@
     <copy todir="${maven.docs.dest}/images" file="${plugin.resources}/images/rss.png"/>
     
   </goal>
+
+  <goal name="changes:validate"
+    description="Validates the changes.xml file">
+
+    <available
+        file="${maven.docs.src}/changes.xml"
+        property="changesFile.available"/>
+
+    <j:if test="${changesFile.available}">
+        <echo>schema=${plugin.resources}/xsd/changes.xsd</echo>
+        <echo>file=${maven.docs.src}/changes.xml</echo>
+        <plugin:validate-xml
+            schema="${plugin.resources}/xsd/changes.xsd"
+            file="${maven.docs.src}/changes.xml"/>
+    </j:if>
+
+  </goal>
+
 
   <define:taglib uri="changes:transform">
     <define:tag name="release-version">

Added: maven/maven-1/plugins/trunk/changes/src/plugin-resources/xsd/changes.xsd
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/changes/src/plugin-resources/xsd/changes.xsd?rev=291220&view=auto
==============================================================================
--- maven/maven-1/plugins/trunk/changes/src/plugin-resources/xsd/changes.xsd (added)
+++ maven/maven-1/plugins/trunk/changes/src/plugin-resources/xsd/changes.xsd Fri Sep 23 16:19:37 2005
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <xs:element name="document">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="properties"/>
+        <xs:element ref="body"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="properties">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="title"/>
+        <xs:element ref="author" minOccurs="0"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="title">
+    <xs:complexType>
+      <xs:simpleContent>
+        <xs:extension base="xs:string"/>
+    </xs:simpleContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="author">
+    <xs:complexType>
+      <xs:simpleContent>
+        <xs:extension base="xs:string">
+          <xs:attribute name="email" type="xs:string" use="optional"/>
+        </xs:extension>
+      </xs:simpleContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="body">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="release" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="release">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="action" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+      <xs:simpleContent>
+        <xs:extension base="xs:string">
+          <xs:attribute name="version" type="xs:string"/>
+          <xs:attribute name="date" type="xs:string"/>
+          <xs:attribute name="description" type="xs:string" use="optional"/>
+        </xs:extension>
+      </xs:simpleContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="action">
+    <xs:complexType>
+      <xs:attribute name="dev" type="xs:string"/>
+      <xs:attribute name="type" type="xs:string"/>
+      <xs:attribute name="issue" type="xs:string" use="optional"/>
+      <xs:attribute name="due-to" type="xs:string" use="optional"/>
+      <xs:attribute name="due-to-email" type="xs:string" use="optional"/>
+      <xs:sequence>
+        <xs:element ref="description"/>
+        <xs:element ref="fixes" minOccurs="0" maxOccurs="unbounded"/>
+        <xs:element ref="dueto" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="description"/>
+  <xs:element name="fixes">
+    <xs:complexType>
+      <xs:attribute name="issue" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="dueto">
+    <xs:complexType>
+      <xs:attribute name="name" type="xs:string"/>
+      <xs:attribute name="email" type="xs:string" use="optional"/>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>

Modified: maven/maven-1/plugins/trunk/changes/xdocs/changes.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/changes/xdocs/changes.xml?rev=291220&r1=291219&r2=291220&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/changes/xdocs/changes.xml (original)
+++ maven/maven-1/plugins/trunk/changes/xdocs/changes.xml Fri Sep 23 16:19:37 2005
@@ -25,6 +25,7 @@
   </properties>
   <body>
     <release version="1.6-SNAPSHOT" date="in SVN">
+      <action dev="ltheussl" type="add" issue="MPCHANGES-25">Validate <code>changes.xml</code>.</action>
       <action dev="ltheussl" type="add" issue="MPCHANGES-15"> Add multiple due-to/due-to-email support.</action>
       <action dev="ltheussl" type="add" issue="MPCHANGES-16"> Add multiple issue support.</action>
       <action dev="ltheussl" type="fix" issue="MPCHANGES-24">The encoding of changes.xml is not preserved after <code>scm:prepare-release</code>.</action>

Modified: maven/maven-1/plugins/trunk/changes/xdocs/goals.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/changes/xdocs/goals.xml?rev=291220&r1=291219&r2=291220&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/changes/xdocs/goals.xml (original)
+++ maven/maven-1/plugins/trunk/changes/xdocs/goals.xml Fri Sep 23 16:19:37 2005
@@ -43,7 +43,15 @@
             project releases.
           </td>
         </tr>
-
+        <tr>
+          <td>changes:validate</td>
+          <td>
+            Validates the <code>changes.xml</code> file. Note that this validates
+            against the new form of the <code>action</code> element as described
+            <a href="index.html#alternative">here</a>, i.e., the description
+            of the change has to be contained in a <code>description</code> element.
+          </td>
+        </tr>
       </table>
     </section>
  </body>

Modified: maven/maven-1/plugins/trunk/changes/xdocs/index.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/changes/xdocs/index.xml?rev=291220&r1=291219&r2=291220&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/changes/xdocs/index.xml (original)
+++ maven/maven-1/plugins/trunk/changes/xdocs/index.xml Fri Sep 23 16:19:37 2005
@@ -74,7 +74,7 @@
 </document>
 ]]></source>     
 
-      <p>
+      <p><a name="alternative"/>
         An alternative form of the <code>&lt;action&gt;</code> element
         allows you to specify several issues and/or several due-to
         elements:



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org