Reference 3Licenses JARs

<path id="3licenses.classpath">
 <fileset dir="${externals.dir}/3licenses">
  <include name="*.jar" />
 </fileset>
</path>

Reference the 3Licenses JAR's ANT Tasks

 <taskdef resource="com/appsecinc/ant/3licenses.properties" classpathref="3licenses.classpath" />

Create a Target to Gather Licenses

 <target name="gather-licenses">
  <collect-licenses src="${externals.dir}" todir="${artifacts.dir}/licenses" maxDepth="3" 
    xslfile="${externals.dir}/3licenses/manifest.xsl" />
 </target>

This collects licenses into ${artifacts.dir}/licenses. You can open manifest.xml to see a summary. Try ant gather-licenses.

Excluding Directories

You can exclude external directories from the generated manifest, useful for excluded licenses of build tools that aren't published with the product.

 <target name="gather-licenses">
  <collect-licenses src="${externals.dir}" todir="${artifacts.dir}/licenses" maxDepth="3" 
    xslfile="${externals.dir}/3licenses/manifest.xsl">
   <externals>
    <external src="antelope" include="false" />
    <external src="junit" include="false" />
    <external src="wix" include="false" />
   </externals>
  </collect-licenses>
 </target>

Last edited Nov 5, 2010 at 4:07 PM by dblock, version 5

Comments

No comments yet.