| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| |
| Copyright 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. |
| --> |
| |
| <!-- $Rev: 158417 $ $Date: 2005-03-20 23:25:45 -0800 (Sun, 20 Mar 2005) $ --> |
| |
| <project |
| xmlns:j="jelly:core" |
| xmlns:artifact="artifact" |
| xmlns:ant="jelly:ant" |
| xmlns:define="jelly:define" |
| xmlns:m="jelly:maven" |
| xmlns:velocity="jelly:velocity" |
| xmlns:assemble="geronimo:assembly" |
| > |
| |
| <define:taglib uri="geronimo:assembly"> |
| <define:jellybean name="installConfig" className="org.apache.geronimo.plugin.assembly.RepoConfigInstaller" |
| method="execute"/> |
| <define:jellybean name="repoCopier" className="org.apache.geronimo.plugin.assembly.RepoCopier" |
| method="execute"/> |
| </define:taglib> |
| |
| <goal name="assemble:assemble-prepare"> |
| <ant:mkdir dir="${geronimo.assembly.dest}"/> |
| <ant:copy todir="${geronimo.assembly.dest}"> |
| <ant:fileset dir="${geronimo.assembly.src}"/> |
| </ant:copy> |
| <ant:mkdir dir="${geronimo.assembly.dest}/var/config"/> |
| <velocity:merge basedir="${geronimo.assembly.src}/var/config" template="config.xml" |
| name="${geronimo.assembly.dest}/var/config/config.xml"/> |
| <velocity:merge basedir="${geronimo.assembly.src}/var/config" template="config.xml" |
| name="${geronimo.assembly.dest}/var/config/config.xml.original"/> |
| <velocity:merge basedir="${geronimo.assembly.src}/var/config" template="offline-deployer-list" |
| name="${geronimo.assembly.dest}/var/config/offline-deployer-list"/> |
| </goal> |
| |
| <goal name="assemble:assemble-lib"> |
| <ant:mkdir dir="${geronimo.assembly.dest}/lib"/> |
| <ant:copy todir="${geronimo.assembly.dest}/lib" flatten="true"> |
| <ant:fileset dir="${maven.repo.local}"> |
| <j:set var="hasLib" value="false"/> |
| <j:forEach var="artifact" items="${pom.artifacts}"> |
| <j:set var="dependency" value="${artifact.dependency}"/> |
| <j:if test="${dependency.getProperty('geronimo.assemble') == 'library'}"> |
| <ant:include |
| name="${dependency.getArtifactDirectory()}/${dependency.getType()}s/${dependency.getArtifact()}"/> |
| <j:set var="hasLib" value="true"/> |
| </j:if> |
| </j:forEach> |
| <j:if test="${hasLib == 'false'}"> |
| <ant:exclude name="**/*"/> |
| </j:if> |
| </ant:fileset> |
| </ant:copy> |
| <ant:mkdir dir="${geronimo.assembly.dest}/lib/endorsed"/> |
| <ant:copy todir="${geronimo.assembly.dest}/lib/endorsed" flatten="true"> |
| <ant:fileset dir="${maven.repo.local}"> |
| <j:set var="hasEndorsed" value="false"/> |
| |
| <j:forEach var="artifact" items="${pom.artifacts}"> |
| <j:set var="dependency" value="${artifact.dependency}"/> |
| <j:if test="${dependency.getProperty('geronimo.assemble') == 'endorsed'}"> |
| <ant:include |
| name="${dependency.getArtifactDirectory()}/${dependency.getType()}s/${dependency.getArtifact()}"/> |
| <j:set var="hasEndorsed" value="true"/> |
| </j:if> |
| </j:forEach> |
| <j:if test="${hasEndorsed == 'false'}"> |
| <ant:exclude name="**/*"/> |
| </j:if> |
| </ant:fileset> |
| </ant:copy> |
| <ant:mkdir dir="${geronimo.assembly.dest}/lib/ext"/> |
| <ant:copy todir="${geronimo.assembly.dest}/lib/ext" flatten="true"> |
| <ant:fileset dir="${maven.repo.local}"> |
| <j:set var="hasExtension" value="false"/> |
| <j:forEach var="artifact" items="${pom.artifacts}"> |
| <j:set var="dependency" value="${artifact.dependency}"/> |
| <j:if test="${dependency.getProperty('geronimo.assemble') == 'extension'}"> |
| <ant:include |
| name="${dependency.getArtifactDirectory()}/${dependency.getType()}s/${dependency.getArtifact()}"/> |
| <j:set var="hasExtension" value="true"/> |
| </j:if> |
| </j:forEach> |
| <j:if test="${hasExtension == 'false'}"> |
| <ant:exclude name="**/*"/> |
| </j:if> |
| </ant:fileset> |
| </ant:copy> |
| </goal> |
| |
| <goal name="assemble:assemble-repository"> |
| <ant:mkdir dir="${geronimo.assembly.dest}/repository"/> |
| <j:forEach var="artifact" items="${pom.artifacts}"> |
| <j:set var="dependency" value="${artifact.dependency}"/> |
| <j:if test="${dependency.getProperty('geronimo.assemble') == 'repository' || dependency.getProperty('geronimo.assemble') == 'library' || dependency.getProperty('geronimo.assemble') == 'endorsed' || dependency.getProperty('geronimo.assemble') == 'extension'}"> |
| <assemble:repoCopier |
| targetRepositoryFile="${geronimo.assembly.dest}/repository" |
| sourceRepositoryFile="${maven.repo.local}" |
| groupId="${dependency.getGroupId()}" |
| artifactId="${dependency.getArtifactId()}" |
| version="${dependency.getVersion()}" |
| type="${dependency.getType()}" |
| /> |
| </j:if> |
| </j:forEach> |
| </goal> |
| |
| <goal name="assemble:assemble-unpack"> |
| <ant:mkdir dir="${geronimo.assembly.dest}"/> |
| <j:set var="excludeManifest" value="false"/> |
| <ant:unjar dest="${geronimo.assembly.dest}"> |
| <ant:fileset dir="${maven.repo.local}"> |
| <j:set var="hasUnpack" value="false"/> |
| <j:forEach var="artifact" items="${pom.artifacts}"> |
| <j:set var="dependency" value="${artifact.dependency}"/> |
| <j:if test="${dependency.getProperty('geronimo.assemble') == 'unpack'}"> |
| <ant:include |
| name="${dependency.getArtifactDirectory()}/${dependency.getType()}s/${dependency.getArtifact()}"/> |
| <j:set var="hasUnpack" value="true"/> |
| <j:if test="${dependency.getProperty('geronimo.assemble.unpack.exclude.manifest') == 'true'}"> |
| <j:set var="excludeManifest" value="true"/> |
| </j:if> |
| </j:if> |
| </j:forEach> |
| <j:if test="${hasUnpack == 'false'}"> |
| <ant:exclude name="**/*"/> |
| </j:if> |
| </ant:fileset> |
| <j:if test="${excludeManifest == 'true'}"> |
| <ant:patternset> |
| <!-- this exclude leaves an empty META-INF directory |
| that we delete below --> |
| <ant:exclude name="META-INF/MANIFEST.MF"/> |
| </ant:patternset> |
| </j:if> |
| </ant:unjar> |
| <j:if test="${excludeManifest == 'true'}"> |
| <ant:delete dir="${geronimo.assembly.dest}/META-INF"/> |
| </j:if> |
| <ant:chmod dir="${geronimo.assembly.dest}/bin" perm="ugo+x" includes="*.sh"/> |
| </goal> |
| |
| <goal name="assemble:assemble-schemas"> |
| <!-- this is not ideal--> |
| <ant:mkdir dir="${geronimo.assembly.dest}/schema"/> |
| <ant:mkdir dir="${maven.build.dir}/schema"/> |
| <ant:unjar dest="${maven.build.dir}/schema"> |
| <ant:patternset> |
| <ant:include name="schemaorg_apache_xmlbeans/src/**/*.xsd"/> |
| <!-- we put the dtds in, not xmlbeans --> |
| <ant:include name="schemaorg_apache_xmlbeans/src/**/*.dtd"/> |
| </ant:patternset> |
| <ant:fileset dir="${geronimo.assembly.dest}/repository"> |
| <ant:include name="geronimo/geronimo*-builder/*/*.jar"/> |
| <ant:include name="geronimo/geronimo-j2ee-schema/*/*.jar"/> |
| <ant:include name="openejb/openejb*-builder/*/*.jar"/> |
| </ant:fileset> |
| </ant:unjar> |
| <ant:copy todir="${geronimo.assembly.dest}/schema" flatten="true"> |
| <ant:fileset dir="${maven.build.dir}/schema"> |
| <ant:include name="**/*.xsd"/> |
| <ant:include name="**/*.dtd"/> |
| </ant:fileset> |
| </ant:copy> |
| </goal> |
| |
| |
| <!-- todo automatically add libraries listed in an executable's MCP in the right place, relative to it --> |
| <goal name="assemble:assemble-configurations"> |
| <ant:mkdir dir="${geronimo.assembly.dest}/repository"/> |
| <j:forEach var="artifact" items="${pom.artifacts}"> |
| <j:set var="dependency" value="${artifact.dependency}"/> |
| <j:if test="${dependency.type == 'car'}"> |
| <j:if test="${dependency.getProperty('geronimo.assemble') == 'install'}"> |
| <assemble:installConfig |
| targetRoot="${geronimo.assembly.dest}" |
| targetConfigStore="config-store" |
| targetRepository="repository" |
| sourceRepository="${maven.repo.local}" |
| explicitResolutionLocation="${geronimo.assembly.explicit.versions}" |
| artifact="${dependency.getGroupId()}/${dependency.getArtifactId()}/${dependency.getVersion()}/${dependency.getType()}"/> |
| </j:if> |
| |
| <!-- handle executable configs --> |
| <j:if test="${dependency.getProperty('geronimo.assemble.executable') != null}"> |
| <j:set var="exe" |
| value="${geronimo.assembly.dest}/${dependency.getProperty('geronimo.assemble.executable')}"/> |
| <ant:copy tofile="${exe}" file="${artifact.file}"/> |
| <ant:chmod file="${exe}" perm="ugo+rx"/> |
| </j:if> |
| </j:if> |
| </j:forEach> |
| </goal> |
| |
| <goal name="assemble:assemble-configurations-to-repo"> |
| <ant:mkdir dir="${geronimo.assembly.dest}/repository"/> |
| <j:forEach var="artifact" items="${pom.artifacts}"> |
| <j:set var="dependency" value="${artifact.dependency}"/> |
| <j:if test="${dependency.type == 'car'}"> |
| <j:if test="${dependency.getProperty('geronimo.assemble') == 'install'}"> |
| <assemble:installConfig |
| targetRoot="${geronimo.assembly.dest}" |
| targetConfigStore="config-store" |
| targetRepository="repository" |
| sourceRepository="${maven.repo.local}" |
| explicitResolutionLocation="${geronimo.assembly.explicit.versions}" |
| artifact="${dependency.getGroupId()}/${dependency.getArtifactId()}/${dependency.getVersion()}/${dependency.getType()}"/> |
| </j:if> |
| |
| <!-- handle executable configs --> |
| <j:if test="${dependency.getProperty('geronimo.assemble.executable') != null}"> |
| <j:set var="exe" |
| value="${geronimo.assembly.dest}/${dependency.getProperty('geronimo.assemble.executable')}"/> |
| <ant:copy tofile="${exe}" file="${artifact.file}"/> |
| <ant:chmod file="${exe}" perm="ugo+rx"/> |
| </j:if> |
| </j:if> |
| </j:forEach> |
| </goal> |
| |
| <goal name="assemble:assemble" prereqs="assemble:assemble-prepare" description="Assemble a Geronimo installation"> |
| <attainGoal name="assemble:assemble-repository"/> |
| <attainGoal name="assemble:assemble-lib"/> |
| <attainGoal name="assemble:assemble-unpack"/> |
| <attainGoal name="assemble:assemble-configurations"/> |
| <attainGoal name="assemble:assemble-schemas"/> |
| </goal> |
| |
| <goal name="assemble:assemble-to-repo" prereqs="assemble:assemble-prepare" |
| description="Assemble a Geronimo installation"> |
| <attainGoal name="assemble:assemble-repository"/> |
| <attainGoal name="assemble:assemble-lib"/> |
| <attainGoal name="assemble:assemble-unpack"/> |
| <attainGoal name="assemble:assemble-configurations-to-repo"/> |
| <attainGoal name="assemble:assemble-installer-helpers"/> |
| <attainGoal name="assemble:assemble-schemas"/> |
| </goal> |
| <goal name="assemble:assemble-installer-helpers"> |
| <ant:copy todir="${geronimo.assembly.dest}/var/temp"> |
| <ant:fileset |
| file="${maven.repo.local}/geronimo/plugins/geronimo-assembly-plugin-${geronimo_assembly_plugin_version}.jar"/> |
| </ant:copy> |
| <ant:copy todir="${geronimo.assembly.dest}/var/temp"> |
| <ant:fileset |
| file="${maven.repo.local}/geronimo/jars/geronimo-installer-processing-${pom.currentVersion}.jar"/> |
| </ant:copy> |
| <ant:mkdir dir="${geronimo.assembly.dest}/var/config"/> |
| <j:file name="${geronimo.assembly.dest}/var/config/configure.xml" outputMode="xml" escapeText="false" |
| trim="true" prettyPrint="false"> |
| <!-- used only for install. This file may be removed. --> |
| <configurations> |
| <j:set var="DS" value="$"/> |
| <j:set var="LB" value="{"/> |
| <j:set var="RB" value="}"/> |
| <j:forEach var="artifact" items="${pom.artifacts}"> |
| <!-- One for each configuration --> |
| <j:set var="dependency" value="${artifact.dependency}"/> |
| <j:if test="${dependency.type == 'car'}"> |
| |
| <configuration> |
| <j:if test="${dependency.getProperty('geronimo.assemble') == 'install'}"> |
| <j:set var="PACK" value="${dependency.getProperty('geronimo.pack')}"/> |
| <artifact>${dependency.getGroupId()}/${dependency.getArtifactId()}/${dependency.getVersion()}/${dependency.getType()}</artifact> |
| <selected>${DS}${LB}${PACK}${RB}</selected> |
| </j:if> |
| <!-- handle executable configs --> |
| <j:if test="${dependency.getProperty('geronimo.assemble.executable') != null}"> |
| <j:set var="exe" value="${dependency.getProperty('geronimo.assemble.executable')}"/> |
| <executable>${exe}</executable> |
| </j:if> |
| </configuration> |
| |
| </j:if> |
| </j:forEach> |
| </configurations> |
| </j:file> |
| </goal> |
| |
| <goal name="assemble:jar-assembly" prereqs="assemble:assemble"> |
| <ant:jar jarfile="${maven.build.dir}/${maven.final.name}.jar" basedir="${geronimo.assembly.dest}"/> |
| </goal> |
| |
| <goal name="assemble:package-assembly" prereqs="assemble:assemble" description="Build the binary distribution."> |
| <!-- Create a tar.gz file |
| Explicitly set execute permission on script files so builds on windows are consistent with unix --> |
| |
| <!-- Establish patternset used by later fixcrlf processing --> |
| <ant:fileset dir="${geronimo.assembly.dest}"> |
| <!-- Patterns for text based files. We don't touch *.bat as svn |
| should have eol-style set property to CRLF and *.sh we |
| force to have LF line endings (handle building on windows). --> |
| <ant:patternset id="geronimo.fixcrlf.patternset"> |
| <ant:include name="**/*.dtd"/> |
| <ant:include name="**/*.ent"/> |
| <ant:include name="**/*.htm"/> |
| <ant:include name="**/*.html"/> |
| <ant:include name="**/*.java"/> |
| <ant:include name="**/*.js"/> |
| <ant:include name="**/*.jsp"/> |
| <ant:include name="**/*.properties"/> |
| <ant:include name="**/*.sql"/> |
| <ant:include name="**/*.txt"/> |
| <ant:include name="**/*.wsdl"/> |
| <ant:include name="**/*.xml"/> |
| <ant:include name="**/*.xsd"/> |
| <ant:include name="**/*.xsl"/> |
| <ant:include name="STATUS"/> |
| </ant:patternset> |
| </ant:fileset> |
| |
| <!-- ensure shell scripts have LF end of lines for both the |
| tar.gz and zip file --> |
| <ant:fixcrlf srcdir="${geronimo.assembly.dest}" eol="lf"> |
| <ant:include name="**/*.sh"/> |
| </ant:fixcrlf> |
| |
| <!-- Create a zip file --> |
| <j:if test="${context.getVariable('geronimo.assembly.zip') == 'true'}"> |
| <ant:echo>Preparing CRLF line endings in text based files for zip |
| distribution</ant:echo> |
| <!-- The zip distribution shall have CRLF line |
| endings and is targeted at Windows platforms. Non-Windows platforms |
| should use the tar distribution, as it contains extra file attributes |
| such as permissions. Since we cannot assume we are running on a Windows |
| platform, we fix line endings in the zip distribution to be CRLF's. --> |
| <ant:fixcrlf srcdir="${geronimo.assembly.dest}" eol="crlf"> |
| <patternset refid="geronimo.fixcrlf.patternset"/> |
| </ant:fixcrlf> |
| |
| <ant:zip zipfile="${maven.build.dir}/${maven.final.name}.zip"> |
| <ant:zipfileset dir="${geronimo.assembly.dest}/.."> |
| <ant:include name="${geronimo.assembly.name}/**"/> |
| <ant:exclude name="${geronimo.assembly.name}/var/log/*.log"/> |
| </ant:zipfileset> |
| </ant:zip> |
| <checksum file="${maven.build.dir}/${maven.final.name}.zip" algorithm="MD5" fileext=".md5"/> |
| <checksum file="${maven.build.dir}/${maven.final.name}.zip" algorithm="SHA" fileext=".sha"/> |
| </j:if> |
| |
| |
| <j:if test="${context.getVariable('geronimo.assembly.tar') == 'true'}"> |
| <ant:echo>Preparing LF line endings in text based files for tar.gz distribution</ant:echo> |
| |
| <ant:fixcrlf srcdir="${geronimo.assembly.dest}" eol="lf"> |
| <patternset refid="geronimo.fixcrlf.patternset"/> |
| <ant:include name="**/*.sh"/> |
| </ant:fixcrlf> |
| |
| <ant:tar longfile="gnu" compression="gzip" tarfile="${maven.build.dir}/${maven.final.name}.tar.gz"> |
| <ant:tarfileset dir="${geronimo.assembly.dest}/.."> |
| <ant:include name="${geronimo.assembly.name}/**"/> |
| <ant:exclude name="${geronimo.assembly.name}/var/log/*.log"/> |
| <ant:exclude name="${geronimo.assembly.name}/bin/*.sh"/> |
| </ant:tarfileset> |
| <ant:tarfileset dir="${geronimo.assembly.dest}/.." mode="755"> |
| <ant:include name="${geronimo.assembly.name}/bin/*.sh"/> |
| </ant:tarfileset> |
| </ant:tar> |
| <checksum file="${maven.build.dir}/${maven.final.name}.tar.gz" algorithm="MD5" fileext=".md5"/> |
| <checksum file="${maven.build.dir}/${maven.final.name}.tar.gz" algorithm="SHA" fileext=".sha"/> |
| </j:if> |
| |
| <!-- Ensure the files in the assembly directory are left with LF endings |
| for Geronimo developers who may run Geronimo from there. --> |
| <j:if test="${context.getVariable('geronimo.assembly.zip') == 'true'}"> |
| <j:if test="${context.getVariable('geronimo.assembly.tar') != 'true'}"> |
| <ant:fixcrlf srcdir="${geronimo.assembly.dest}" eol="lf"> |
| <patternset refid="geronimo.fixcrlf.patternset"/> |
| </ant:fixcrlf> |
| </j:if> |
| </j:if> |
| </goal> |
| |
| <!-- Maven artifict tags are broken so we must copy by hand --> |
| <goal name="assemble:install" description="Deploy a binary distribution" prereqs="clean,assemble:package-assembly"> |
| <j:if test="${context.getVariable('geronimo.assembly.tar') == 'true'}"> |
| <ant:mkdir dir="${maven.repo.local}/${pom.groupId}/distributions"/> |
| <ant:copy file="${maven.build.dir}/${maven.final.name}.tar.gz" |
| todir="${maven.repo.local}/${pom.groupId}/distributions"/> |
| <!-- <artifact:install--> |
| <!-- artifact="${maven.build.dir}/${maven.final.name}.tar.gz"--> |
| <!-- type="distribution-targz"--> |
| <!-- project="${pom}"--> |
| </j:if> |
| |
| <j:if test="${context.getVariable('geronimo.assembly.zip') == 'true'}"> |
| <ant:mkdir dir="${maven.repo.local}/${pom.groupId}/distributions"/> |
| <ant:copy file="${maven.build.dir}/${maven.final.name}.zip" |
| todir="${maven.repo.local}/${pom.groupId}/distributions"/> |
| <!-- <artifact:install--> |
| <!-- artifact="${maven.build.dir}/${maven.final.name}.zip"--> |
| <!-- type="distribution-zip"--> |
| <!-- project="${pom}"--> |
| </j:if> |
| </goal> |
| |
| <!-- ================================================================== --> |
| <!-- D E P L O Y D I S T R I B U T I O N --> |
| <!-- ================================================================== --> |
| |
| <!-- <goal name="geronimo:deploy-assembly" description="Deploy a binary distribution" prereqs="geronimo:package-assembly">--> |
| <!-- <j:if test="${context.getVariable('geronimo.assembly.tar') == 'true'}">--> |
| <!-- <artifact:deploy--> |
| <!-- artifact="${maven.build.dir}/${maven.final.name}.tar.gz"--> |
| <!-- type="distribution-targz"--> |
| <!-- project="${pom}"--> |
| <!-- typeHandler="${distTypeHandler}"/>--> |
| <!-- </j:if>--> |
| <!----> |
| <!-- <j:if test="${context.getVariable('geronimo.assembly.zip') == 'true'}">--> |
| <!-- <artifact:deploy--> |
| <!-- artifact="${maven.build.dir}/${maven.final.name}.zip"--> |
| <!-- type="distribution-zip"--> |
| <!-- project="${pom}"--> |
| <!-- typeHandler="${distTypeHandler}"/>--> |
| <!-- </j:if>--> |
| <!-- </goal>--> |
| |
| <!-- <goal name="geronimo:install-assembly" prereqs="geronimo:jar-assembly" description="Install an assembled Geronimo installation into the local repository">--> |
| <!-- <artifact:install artifact="${maven.build.dir}/${maven.final.name}.jar" project="${pom}"/>--> |
| <!-- </goal>--> |
| |
| <!-- |
| <goal name="geronimo:deploy-assembly" prereqs="geronimo:assemble" description="Deploy an assembled Geronimo installation into the remote repository"> |
| <artifact:deploy artifact="${maven.build.dir}/${maven.final.name}.jar" project="${pom}"/> |
| </goal> |
| --> |
| </project> |