mcconnell 2004/04/18 04:13:19 Added: . maven.xml Log: Move merlin's maven.xml to top level so we get the filtering stuff across acomposition and activation. This file will be revisited shortly (i.a. Niclas - don't touch!) ;-) Revision Changes Path 1.1 avalon/maven.xml Index: maven.xml =================================================================== <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE project [ <!ENTITY % index SYSTEM "file:index.ent"> %index; ]> <project default="avalon:install" xmlns:maven="jelly:maven" xmlns:j="jelly:core" xmlns:util="jelly:util" xmlns:ant="jelly:ant"> <!-- ============================================================================== switches ============================================================================== --> <ant:property name="merlin.snapshot" value="true"/> <!-- ============================================================================== dependent properties ============================================================================== --> <ant:property name="avalon.util.plugin.version" value="&avalon-util-plugin-version;"/> <ant:property name="merlin.cli.version" value="&merlin-cli-version;"/> <ant:property name="merlin.plugin.version" value="&merlin-plugin-version;"/> <ant:property name="merlin.impl.version" value="&merlin-impl-version;"/> <ant:property name="meta.plugin.version" value="&avalon-meta-plugin-version;"/> <ant:property name="repository.cli.version" value="&avalon-repository-cli-version;"/> <!-- ============================================================================== derived properties ============================================================================== --> <ant:property name="avalon.plugin.jar" value="avalon-util-plugin-${avalon.util.plugin.version}.jar"/> <ant:property name="meta.plugin.jar" value="avalon-meta-plugin-${meta.plugin.version}.jar"/> <ant:property name="merlin.cli.jar" value="merlin-cli-${merlin.cli.version}.jar"/> <ant:property name="merlin.plugin.jar" value="merlin-plugin-${merlin.plugin.version}.jar"/> <!-- ============================================================================== structural properties ============================================================================== --> <ant:property file="project.properties"/> <ant:property name="merlin.build.inst" value="merlin"/> <ant:property name="merlin.build.inst.dir" value="${maven.build.dir}/${merlin.build.inst}"/> <ant:property name="maven.jar.manifest.extensions.add" value="false"/> <ant:property name="maven.checkstyle.format" value="avalon"/> <ant:property name="pom.organization.identifier" value="ASF"/> <ant:property name="pom.specificationVersion" value="&merlin-spec;"/> <ant:property name="maven.license.licenseFile" value="${basedir}/LICENSE.txt"/> <maven:snapshot project="${pom}"/> <!-- ============================================================================== resolve merlin home environment variables ============================================================================== --> <ant:property environment="env"/> <ant:property name="merlinEnvironment" value="${env.MERLIN_HOME}"/> <j:if test="${merlinEnvironment != ''}"> <ant:property name="merlin.home" value="${merlinEnvironment}"/> </j:if> <ant:property name="merlin.home" value="${user.home}/.merlin"/> <!-- ============================================================================== build the merlin distribution ============================================================================== --> <goal name="avalon:dist"> <attainGoal name="avalon:install"/> <attainGoal name="avalon:site"/> <!-- <attainGoal name="avalon:tutorials"/> --> <attainGoal name="avalon:package"/> </goal> <preGoal name="java:jar-resources"> <ant:filter token="AVALON-LOGGING-LOGKIT-SPEC" value="&avalon-logging-logkit-artifact-spec;"/> <ant:filter token="MERLIN_IMPLEMENTATION" value="artifact:merlin/merlin-impl#${merlin.impl.version}"/> <ant:filter token="LOGGING_IMPLEMENTATION" value="&avalon-logging-logkit-artifact;"/> <ant:filter token="STANDARD_RUNTIME" value="&avalon-activation-artifact;"/> </preGoal> <!-- ============================================================================== build the merlin system ============================================================================== --> <goal name="avalon:build" description="Build Merlin." prereqs="avalon:build-main,avalon:build-kernel,avalon:build-plugin,avalon:build-externals"/> <goal name="avalon:build-main" description="Build Merlin."> <maven:reactor basedir="${basedir}" includes="extension/**/project.xml,composition/**/project.xml,activation/**/project.xml,kernel/api/project.xml,kernel/impl/project.xml" banner="Installing:" goals="jar:install" ignoreFailures="false" postProcessing="true" /> <j:forEach var="child" items="${reactorProjects}"> <j:set var="dir" value="${maven.build.dir}/merlin/system"/> <j:set var="path" value="${dir}/${child.groupId}/jars/${child.artifactId}-${child.currentVersion}.jar"/> <ant:copy todir="${dir}/${child.groupId}/jars" preserveLastModified="true"> <ant:fileset dir="${child.file.parentFile}/target"> <ant:include name="${child.artifactId}-${child.currentVersion}.jar"/> <ant:include name="${child.artifactId}-${child.currentVersion}.jar.meta"/> </ant:fileset> </ant:copy> <checksum file="${path}" fileext=".md5" /> <j:if test="${maven_gpg_exe != null}"> <ant:exec executable="${maven_gpg_exe}"> <ant:arg value="-a"/> <ant:arg value="--yes"/> <ant:arg value="-b"/> <ant:arg value="${path}"/> </ant:exec> </j:if> <j:set var="deps" value="${child.dependencies}"/> <j:forEach var="dep" items="${deps}"> <ant:copy todir="${maven.build.dir}/merlin/system" preserveLastModified="true"> <ant:fileset dir="${maven.repo.local}"> <ant:include name="${dep.getArtifactDirectory()}/${dep.getType()}s/${dep.getArtifact()}"/> </ant:fileset> </ant:copy> </j:forEach> </j:forEach> </goal> <goal name="avalon:build-kernel"> <maven:reactor basedir="${basedir}" includes="kernel/unit/project.xml,kernel/cli/project.xml" goals="jar:install" banner="Installing:" ignoreFailures="false" postProcessing="true" /> <j:forEach var="child" items="${reactorProjects}"> <j:set var="dir" value="${maven.build.dir}/merlin/system"/> <j:set var="path" value="${dir}/${child.groupId}/jars/${child.artifactId}-${child.currentVersion}.jar"/> <ant:copy todir="${dir}/${child.groupId}/jars" preserveLastModified="true"> <ant:fileset dir="${child.file.parentFile}/target"> <ant:include name="${child.artifactId}-${child.currentVersion}.jar"/> <ant:include name="${child.artifactId}-${child.currentVersion}.jar.meta"/> </ant:fileset> </ant:copy> <checksum file="${path}" fileext=".md5" /> <j:if test="${maven_gpg_exe != null}"> <ant:exec executable="${maven_gpg_exe}"> <ant:arg value="-a"/> <ant:arg value="--yes"/> <ant:arg value="-b"/> <ant:arg value="${path}"/> </ant:exec> </j:if> <!-- FIXME update the cli scripts to reference cli under the merlin.system repo --> <j:if test="${child.artifactId == 'merlin-cli'}"> <ant:copy todir="${maven.build.dir}/merlin/bin/lib" preserveLastModified="true"> <ant:fileset dir="${child.file.parentFile}/target"> <ant:include name="${child.artifactId}-${child.currentVersion}.jar"/> </ant:fileset> </ant:copy> </j:if> </j:forEach> </goal> <goal name="avalon:build-plugin"> <maven:reactor basedir="${basedir}" includes="kernel/plugin/project.xml" goals="plugin:install" banner="Installing:" ignoreFailures="false" postProcessing="true" /> <j:forEach var="child" items="${reactorProjects}"> <j:set var="dir" value="${maven.build.dir}/merlin/system"/> <j:set var="path" value="${dir}/${child.groupId}/jars/${child.artifactId}-${child.currentVersion}.jar"/> <ant:copy todir="${dir}/${child.groupId}/jars" preserveLastModified="true"> <ant:fileset dir="${child.file.parentFile}/target"> <ant:include name="${child.artifactId}-${child.currentVersion}.jar"/> <ant:include name="${child.artifactId}-${child.currentVersion}.jar.meta"/> </ant:fileset> </ant:copy> <checksum file="${path}" fileext=".md5" /> <j:if test="${maven_gpg_exe != null}"> <ant:exec executable="${maven_gpg_exe}"> <ant:arg value="-a"/> <ant:arg value="--yes"/> <ant:arg value="-b"/> <ant:arg value="${path}"/> </ant:exec> </j:if> <ant:copy todir="${maven.build.dir}/merlin/plugins/" preserveLastModified="true"> <ant:fileset dir="${child.file.parentFile}/target"> <ant:include name="${child.artifactId}-${child.currentVersion}.jar"/> </ant:fileset> </ant:copy> </j:forEach> <ant:copy file="${maven.plugin.dir}/${meta.plugin.jar}" toDir="${maven.build.dir}/merlin/plugins"/> <ant:copy file="${maven.plugin.dir}/${avalon.plugin.jar}" toDir="${maven.build.dir}/merlin/plugins"/> </goal> <goal name="avalon:build-externals" description="Build Externals."> <maven:reactor basedir="${basedir}" includes="external.xml" banner="Installing:" ignoreFailures="false" postProcessing="true" /> <j:forEach var="child" items="${reactorProjects}"> <echo>${child}</echo> <j:set var="deps" value="${child.dependencies}"/> <j:forEach var="dep" items="${deps}"> <echo>${maven.repo.local}/${dep.getArtifactDirectory()}/${dep.getType()}s/${dep.getArtifact()}</echo> <ant:copy todir="${maven.build.dir}/merlin/system" preserveLastModified="true"> <ant:fileset dir="${maven.repo.local}"> <ant:include name="${dep.getArtifactDirectory()}/${dep.getType()}s/${dep.getArtifact()}"/> <ant:include name="${dep.getArtifactDirectory()}/${dep.getType()}s/${dep.getArtifact()}.meta"/> </ant:fileset> </ant:copy> </j:forEach> </j:forEach> </goal> <!-- ============================================================================== build the merlin installation ============================================================================== --> <goal name="avalon:install" description="Build the Merlin distribution." prereqs="avalon:build,avalon:xinstall"/> <goal name="avalon:xinstall"> <!-- add supporting resources --> <ant:copy toDir="${merlin.build.inst.dir}"> <fileset dir="${basedir}"> <include name="INSTALL.TXT"/> </fileset> <filterset> <filter token="MERLIN_PLUGIN_JAR" value="${merlin.plugin.jar}"/> <filter token="META_PLUGIN_JAR" value="${meta.plugin.jar}"/> <filter token="VERSION" value="${pom.currentVersion}"/> </filterset> </ant:copy> <ant:copy toDir="${merlin.build.inst.dir}"> <fileset dir="${basedir}/platform/src"> <include name="bin/**/*"/> <exclude name="bin/**/*.jar"/> <exclude name="bin/**/*.exe"/> <exclude name="bin/**/*.dll"/> </fileset> <fileset dir="${basedir}/kernel/cli/src"> <include name="bin/**/*"/> <exclude name="bin/**/*.jar"/> <exclude name="bin/**/*.exe"/> <exclude name="bin/**/*.dll"/> </fileset> <fileset dir="${basedir}"> <include name="README.TXT"/> </fileset> <filterset> <filter token="VERSION" value="${pom.currentVersion}"/> <filter token="MERLIN_CLI_JAR" value="${merlin.cli.jar}"/> <filter token="MERLIN_CLI_VERSION" value="${merlin.cli.version}"/> <filter token="AVALON_CLI_VERSION" value="${repository.cli.version}"/> </filterset> </ant:copy> <ant:copy toDir="${merlin.build.inst.dir}"> <fileset dir="${basedir}/platform/src"> <include name="bin/**/*.jar"/> <include name="bin/**/*.exe"/> <include name="bin/**/*.dll"/> <include name="config/**/*"/> </fileset> <fileset dir="${basedir}"> <include name="LICENSE.txt"/> </fileset> </ant:copy> <ant:fixcrlf eol="crlf" srcdir="${merlin.build.inst.dir}/bin"> <include name="README.TXT"/> </ant:fixcrlf> <ant:fixcrlf eol="crlf" srcdir="${merlin.build.dir}"> <include name="INSTALL.TXT"/> </ant:fixcrlf> <ant:fixcrlf eol="crlf" srcdir="${merlin.build.inst.dir}/bin"> <include name="merlin.bat"/> <include name="merlinx.bat"/> <include name="README.TXT"/> <include name="LICENSE.TXT"/> </ant:fixcrlf> <ant:fixcrlf eol="crlf" srcdir="${merlin.build.inst.dir}/bin/nt"> <include name="InstallService-NT.bat"/> <include name="UninstallService-NT.bat"/> <include name="TANUKISOFTWARE_LICENSE.txt"/> <include name="wrapper.conf"/> </ant:fixcrlf> <ant:fixcrlf eol="lf" srcdir="${merlin.build.inst.dir}/bin"> <include name="*.sh"/> </ant:fixcrlf> <ant:chmod file="${merlin.build.inst.dir}/bin/merlin" perm="ugo+rx"/> <ant:chmod file="${merlin.build.inst.dir}/bin/merlinx" perm="ugo+rx"/> <ant:chmod file="${merlin.build.inst.dir}/bin/internal-cygwin.sh" perm="ugo+rx"/> <ant:chmod file="${merlin.build.inst.dir}/bin/internal-unix.sh" perm="ugo+rx"/> <ant:chmod file="${merlin.build.inst.dir}/bin/merlin.sh" perm="ugo+rx"/> <ant:chmod file="${merlin.build.inst.dir}/bin/merlinx.sh" perm="ugo+rx"/> <ant:chmod file="${merlin.build.inst.dir}/bin/merlin-server.sh" perm="ugo+rx"/> </goal> <!-- ============================================================================== prepare the merlin installation package ============================================================================== --> <goal name="avalon:package"> <ant:delete> <fileset dir="${maven.build.dir}"> <include name="*.zip"/> <include name="*.tar"/> <include name="*.tar.gz"/> <include name="*.md5"/> <include name="*.asc"/> </fileset> </ant:delete> <j:choose> <j:when test="${merlin.snapshot}"> <maven:snapshot project="${pom}"/> <j:set var="timestamp" value="${snapshotSignature.substring(7,15)}"/> <j:set var="package.name" value="${maven.final.name}-dist-${timestamp}"/> <j:set var="tutorial.name" value="${maven.final.name}-tutorial-${timestamp}"/> <echo>Snapshot Packaging: ${timestamp}</echo> </j:when> <j:otherwise> <j:set var="package.name" value="${maven.final.name}-dist"/> <j:set var="tutorial.name" value="${maven.final.name}-tutorial"/> <echo>Release Packaging: ${pom.currentVersion}</echo> </j:otherwise> </j:choose> <ant:echo>Building zip distribution: ${package.name}</ant:echo> <ant:zip zipfile="${maven.build.dir}/${package.name}.zip"> <zipfileset dir="${merlin.build.inst.dir}" prefix="merlin"/> <fileset dir="${basedir}"> <include name="INSTALL.TXT"/> </fileset> <fileset dir="${maven.build.dir}"> <include name="docs/**"/> </fileset> </ant:zip> <checksum file="${maven.build.dir}/${package.name}.zip" fileext=".md5" /> <j:if test="${maven_gpg_exe != null}"> <ant:exec executable="${maven_gpg_exe}"> <ant:arg value="-a"/> <ant:arg value="-b"/> <ant:arg value="${maven.build.dir}/${package.name}.zip"/> </ant:exec> </j:if> <ant:echo>Building tar distribution: ${package.name}</ant:echo> <ant:tar longfile="gnu" tarfile="${maven.build.dir}/${package.name}.tar"> <tarfileset dir="${merlin.build.inst.dir}" prefix="merlin"/> <fileset dir="${basedir}"> <include name="INSTALL.TXT"/> </fileset> <fileset dir="${maven.build.dir}"> <include name="docs/**"/> </fileset> </ant:tar> <ant:gzip zipfile="${maven.build.dir}/${package.name}.tar.gz" src="${maven.build.dir}/${package.name}.tar"/> <ant:delete file="${maven.build.dir}/${package.name}.tar"/> <checksum file="${maven.build.dir}/${package.name}.tar.gz" fileext=".md5" /> <j:if test="${maven_gpg_exe != null}"> <ant:exec executable="${maven_gpg_exe}"> <ant:arg value="-a"/> <ant:arg value="-b"/> <ant:arg value="${maven.build.dir}/${package.name}.tar.gz"/> </ant:exec> </j:if> <!-- <ant:echo>Building tutorial kit: ${tutorial.name}</ant:echo> <ant:zip zipfile="${maven.build.dir}/${tutorial.name}.zip"> <zipfileset dir="${basedir}/target/tutorials" prefix="tutorial"/> </ant:zip> <checksum file="${maven.build.dir}/${tutorial.name}.zip" fileext=".md5" /> <j:if test="${maven_gpg_exe != null}"> <ant:exec executable="${maven_gpg_exe}"> <ant:arg value="-a"/> <ant:arg value="-b"/> <ant:arg value="${maven.build.dir}/${tutorial.name}.zip"/> </ant:exec> </j:if> <ant:tar longfile="gnu" tarfile="${maven.build.dir}/${tutorial.name}.tar"> <tarfileset dir="${basedir}/target/tutorials" prefix="tutorial"/> </ant:tar> <ant:gzip zipfile="${maven.build.dir}/${tutorial.name}.tar.gz" src="${maven.build.dir}/${tutorial.name}.tar"/> <ant:delete file="${maven.build.dir}/${tutorial.name}.tar"/> <checksum file="${maven.build.dir}/${tutorial.name}.tar.gz" fileext=".md5" /> <j:if test="${maven_gpg_exe != null}"> <ant:exec executable="${maven_gpg_exe}"> <ant:arg value="-a"/> <ant:arg value="-b"/> <ant:arg value="${maven.build.dir}/${tutorial.name}.tar.gz"/> </ant:exec> </j:if> --> </goal> <!-- ============================================================================== Generation of the documentation for project ============================================================================== --> <goal name="avalon:site" description="Build the Merlin site" prereqs="xavalon:css-copy,license,xjavadoc,site"/> <goal name="xavalon:css-copy"> <ant:mkdir dir="${merlin.build.inst.dir}/docs/style"/> <ant:copy toDir="${merlin.build.inst.dir}/docs/style"> <fileset dir="${basedir}/platform/etc"> <include name="maven.css"/> <include name="tigris.css"/> </fileset> </ant:copy> </goal> <!-- ============================================================================== build the consolidated javadoc ============================================================================== --> <goal name="xjavadoc"> <maven:reactor basedir="${basedir}" includes="activation/**/project.xml,composition/**/project.xml,kernel/**/project.xml" excludes="**/target/**,**/test/project.xml" banner="Site Prep:" ignoreFailures="false" postProcessing="true" /> <ant:path id="template.classpath"> <j:forEach var="child" items="${reactorProjects}"> <j:set var="deps" value="${child.dependencies}"/> <j:forEach var="dep" items="${deps}"> <ant:pathelement path="${maven.repo.local}/${dep.getArtifactDirectory()}/jars/${dep.getArtifact()}"/> </j:forEach> </j:forEach> </ant:path> <ant:mkdir dir="${merlin.build.inst.dir}/docs/api" /> <ant:property name="copyright" value="Copyright &copy; ${year} ${pom.organization.name}. All Rights Reserved." /> <ant:property name="title" value="${pom.name} ${pom.currentVersion} API"/> <ant:javadoc destdir="${merlin.build.inst.dir}/docs/api" doctitle="<h1>${title}</h1>" noindex="false" author="true" use="true" windowtitle="${title}" bottom="${copyright}" additionalparam="-breakiterator -J-Xmx128m " packagenames="*,org.*"> <classpath> <path refid="template.classpath"/> </classpath> <j:forEach var="child" items="${reactorProjects}"> <sourcepath path="${child.file.parentFile}/src/java"/> </j:forEach> <j:forEach var="packageGroup" items="${pom.packageGroups}"> <group title="${packageGroup.title}" packages="${packageGroup.packages}"/> </j:forEach> <link href="${sun.j2se.link}" /> <link href="${avalon.framework.link}" /> <link href="${avalon.meta.link}" /> <link href="${avalon.repository.link}" /> <link href="${avalon.util.link}" /> <link href="${avalon.logkit.link}" /> <link href="${avalon.logging.link}" /> <!--<link href="${avalon.lifecycle.link}" />--> <link href="${excalibur.configuration.link}" /> <util:tokenize var="listOfTags" delim=" ">${maven.javadoc.customtags}</util:tokenize> <j:forEach var="someTag" items="${listOfTags}"> <j:set var="nameVar" value="${someTag}.name"/> <j:set var="name" value="${context.findVariable(nameVar)}"/> <j:set var="descriptionVar" value="${someTag}.description"/> <j:set var="description" value="${context.findVariable(descriptionVar)}"/> <j:set var="enabledVar" value="${someTag}.enabled"/> <j:set var="enabled" value="${context.findVariable(enabledVar)}"/> <j:set var="scopeVar" value="${someTag}.scope"/> <j:set var="scope" value="${context.findVariable(scopeVar)}"/> <ant:tag name="${name}" description="${description}" enabled="${enabled}" scope="${scope}"/> </j:forEach> </ant:javadoc> </goal> <!-- ============================================================================== veriify the the tutorials are buildable and generate a clean build defintion (note: the xgen target is defined in the platform/tutorials/maven.xml file) ============================================================================== --> <!-- <goal name="avalon:tutorials" prereqs="avalon:validate"> <ant:copy todir="${basedir}/target/tutorials"> <fileset dir="${basedir}/platform/tutorials"> <include name="**/README.TXT"/> <include name="master.xml"/> <include name="**/maven.xml"/> <exclude name="maven.xml"/> </fileset> </ant:copy> <ant:copy toFile="${basedir}/target/tutorials/maven.xml" file="${basedir}/platform/tutorials/maven-template.xml"/> </goal> --> <goal name="avalon:validate" description="Generate a clean tutorial package." > <maven:reactor basedir="${basedir}" includes="platform/tutorials/**/project.xml" excludes="**/target/**,**/mixed/**,**/jmx/**,**/security/**" goals="xgen" banner="Generation:" ignoreFailures="false" postProcessing="true" /> <!-- copy the generated target/package directory to the local target/tutorials directory --> <j:set var="tutorialsDir" value="${basedir}/platform/tutorials"/> <j:set var="tutorialsLen" value="${tutorialsDir.length()}"/> <j:forEach var="child" items="${reactorProjects}"> <j:set var="pkgPath" value="${child.file.parentFile.path}"/> <j:set var="pkgLen" value="${pkgPath.length()}"/> <j:set var="packageName" value="${pkgPath.substring( tutorialsLen )}"/> <ant:copy toDir="${basedir}/target/tutorials${packageName}"> <fileset dir="${child.file.parentFile}/target/package"/> </ant:copy> </j:forEach> </goal> <!-- ============================================================================== update the runtime installation ============================================================================== --> <goal name="avalon:update"> <attainGoal name="avalon:install"/> <attainGoal name="avalon:replicate"/> </goal> <!-- ============================================================================== update a local merlin installation ============================================================================== --> <goal name="avalon:replicate"> <echo>1</echo> <mkdir dir="${merlin.home}"/> <copy toDir="${merlin.home}"> <fileset dir="${merlin.build.inst.dir}"/> </copy> </goal> <!-- ============================================================================== utility to clean the subprojects and local target ============================================================================== --> <goal name="avalon:clean" prereqs="clean"> <maven:reactor basedir="${basedir}" includes="**/project.xml" excludes="project.xml,**/target/**" goals="clean:clean" banner="Cleaning subproject:" ignoreFailures="true"/> </goal> </project>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]