Author: mbenson
Date: Wed Oct 12 17:02:39 2016
New Revision: 1764490

URL: http://svn.apache.org/viewvc?rev=1764490&view=rev
Log:
fail the build if any expected notices were missing; specifically this will 
guard against upgrading the ASM version without upgrading the corresponding 
license file to be bundled

Modified:
    commons/proper/weaver/trunk/pom.xml

Modified: commons/proper/weaver/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/weaver/trunk/pom.xml?rev=1764490&r1=1764489&r2=1764490&view=diff
==============================================================================
--- commons/proper/weaver/trunk/pom.xml (original)
+++ commons/proper/weaver/trunk/pom.xml Wed Oct 12 17:02:39 2016
@@ -138,6 +138,9 @@ under the License.
                   <attribute name="name" />
                   <attribute name="addto" />
                   <sequential>
+                    <augment id="@{addto}-sought">
+                      <string value="@{name}" />
+                    </augment>
                     <union id="@{name}-ws" />
                     <step dir="${project.basedir}" name="@{name}" 
addto="@{addto}" ws="@{name}-ws" />
                   </sequential>
@@ -186,10 +189,23 @@ under the License.
                 </truth>
                 <sequential unless:true="${pom-only}">
                   <union id="notices" />
+                  <union id="notices-sought" />
                   <seek name="LICENSE.txt" addto="notices" />
                   <seek name="NOTICE.txt" addto="notices" />
                   <seek name="LICENSE-asm${asm.version}.txt" addto="notices" />
 
+                  <resourcecount refid="notices-sought" 
property="notices.sought" />
+                  <condition property="found-all-notices">
+                    <resourcecount refid="notices" when="eq" 
count="${notices.sought}" />
+                  </condition>
+                  <sequential unless:set="found-all-notices">
+                    <echo>Notices sought:</echo>
+                    <pathconvert refid="notices-sought" 
pathsep="${line.separator}" />
+                    <echo>Notices found:</echo>
+                    <pathconvert refid="notices" pathsep="${line.separator}" />
+                    <fail message="Some notices not found." />
+                  </sequential>
+
                   <mkdir 
dir="${project.build.directory}/generated-resources/notices/META-INF" />
                   <copy verbose="true" 
todir="${project.build.directory}/generated-resources/notices/META-INF">
                     <resources refid="notices" />


Reply via email to