licenses.build.xml Maven / Gradle / Ivy
<?xml version="1.0" encoding="UTF-8"?> <project> <target name="default"> <!-- console --> <antcall target="licenses"> <param name="artifactListFile" value="${baseDir}/artifacts/console.txt"/> <param name="targetDir" value="${project.build.directory}/console/docs/licenses/${brand.prefix}/console"/> </antcall> </target> <target name="licenses"> <mkdir dir="${targetDir}"/> <copy file="${artifactListFile}" tofile="${targetDir}/artifacts.xml" overwrite="true"/> <replaceregexp file="${targetDir}/artifacts.xml" match="([^:]*):([^:]*):([^:]*)" replace="<artifact><g>\1</g><a>\2</a><v>\3</v></artifact>" byline="true"/> <replaceregexp file="${targetDir}/artifacts.xml" match="([^:]*):([^:]*)" replace="<artifact><p>\1</p><v>\2</v></artifact>" byline="true"/> <replaceregexp file="${targetDir}/artifacts.xml" match="(.*)" replace="<artifacts>\1</artifacts>" byline="false" flags="ms"/> <xslt in="${targetDir}/artifacts.xml" out="${targetDir}/licenses.xml" style="${baseDir}/licenses-xml.xsl"> <param name="license_database" expression="license-database.xml"/> </xslt> <xslt in="${targetDir}/licenses.xml" out="${targetDir}/licenses.html" style="${baseDir}/licenses-html.xsl"/> <xslt in="${targetDir}/licenses.xml" out="${targetDir}/licenses-list-raw.txt" style="${baseDir}/licenses-list.xsl"/> <loadfile srcfile="${targetDir}/licenses-list-raw.txt" property="licensesList"> <filterchain> <sortfilter/> <uniqfilter/> <tokenfilter> <filetokenizer/> <replacestring from="
" to=","/> </tokenfilter> </filterchain> </loadfile> <echo message="${licensesList}" file="${targetDir}/licenses-list.txt" append="false"/> <copy todir="${targetDir}" failonerror="true"> <fileset dir="${baseDir}/texts" includes="${licensesList}"/> <fileset dir="${baseDir}" includes="licenses.css"/> </copy> <delete> <fileset dir="${targetDir}" includes="artifacts.xml"/> <fileset dir="${targetDir}" includes="licenses-list.txt"/> <fileset dir="${targetDir}" includes="licenses-list-raw.txt"/> </delete> </target> <target name="licenses-xml"> <mkdir dir="${outDir}"/> <exec executable="${node}"> <arg value="${binDir}/license-reporter"/> <arg value="save"/> <arg value="--xml"/> <arg value="licenses-console.xml"/> <arg value="--silent"/> <arg value="--full-dependency-tree"/> <arg value="--output-dir"/> <arg value="${outDir}"/> </exec> </target> </project>