| <?xml version="1.0" encoding="ISO-8859-1"?> | |
| <!DOCTYPE project [ | |
| <!-- | |
| Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. | |
| This program and the accompanying materials are made available under the | |
| terms of the Eclipse Public License v. 2.0, which is available at | |
| http://www.eclipse.org/legal/epl-2.0. | |
| This Source Code may also be made available under the following Secondary | |
| Licenses when the conditions for such availability set forth in the | |
| Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | |
| version 2 with the GNU Classpath Exception, which is available at | |
| https://www.gnu.org/software/classpath/license.html. | |
| SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | |
| --> | |
| <!ENTITY commonBuild SYSTEM "./../../config/common.xml"> | |
| <!ENTITY commonVersioning SYSTEM "../versioning-common.xml"> | |
| <!ENTITY basicScenarios SYSTEM "../basic-scenarios.xml"> | |
| ]> | |
| <project name="simple-versioned-ear" default="usage" basedir="."> | |
| &commonBuild; | |
| &commonVersioning; | |
| &basicScenarios; | |
| <!-- | |
| versionInfos: the property file included in the war archives, this | |
| file contains a version identifier as a property and is used by the | |
| servlet to display the version informations. | |
| --> | |
| <property name="testPackage" value="versionedAppClient"/> | |
| <property name="gfDDFile" value="glassfish-application.xml"/> | |
| <property name="gfDDDir" value="META-INF"/> | |
| <loadproperties srcFile="../build.properties"/> | |
| <!-- link: the context root of the servlet --> | |
| <property name="link" value="/${untaggedName}"/> | |
| <!-- untaggedName: the name of the application, its the version's prefix --> | |
| <property name="untaggedName" value="simple-versioned-ear"/> | |
| <!-- packaging: the file archive's extention --> | |
| <property name="packaging" value="ear"/> | |
| <!-- the module embedded in the EAR archive --> | |
| <property name="moduleUntaggedName" value="simple-versioned-servlet"/> | |
| <property name="modulePackaging" value="war"/> | |
| <property name="moduleBuildDir" value="../${moduleUntaggedName}"/> | |
| <target name="process.servletName" depends="process.versionExpression"> | |
| <condition property="servletAppName" value="${moduleUntaggedName}:${versionExpression}" else="${moduleUntaggedName}"> | |
| <not> | |
| <equals arg1="${versionExpression}" arg2=""/> | |
| </not> | |
| </condition> | |
| </target> | |
| <target name="prepare" depends="init"> | |
| <mkdir dir="${build}"/> | |
| </target> | |
| <!-- assemble: package the ear archive --> | |
| <target name="assemble" depends="prepare,process.servletName"> | |
| <property name="moduleUntaggedArchive" value="${build}/${moduleUntaggedName}.${modulePackaging}"/> | |
| <delete file="${moduleUntaggedArchive}" failonerror="false"/> | |
| <ant dir="${moduleBuildDir}" target="create.version" inheritAll="false"> | |
| <property name="versionExpression" value="${versionExpression}"/> | |
| <property name="xmlVersionIdentifier" value=""/> | |
| </ant> | |
| <move file="${build}/${servletAppName}.${modulePackaging}" tofile="${moduleUntaggedArchive}" failonerror="false"/> | |
| <property name="xmlFile" value="${gfDDDir}/${gfDDFile}"/> | |
| <antcall target="generate.xml.identifier"/> | |
| <jar destfile="${archiveFile}"> | |
| <fileset dir="." includes="META-INF/*.xml" /> | |
| <fileset dir="${build}" includes="${moduleUntaggedName}.${modulePackaging}" /> | |
| </jar> | |
| <delete file="${moduleUntaggedArchive}" failonerror="false"/> | |
| </target> | |
| <!-- Currently, only the scenarios processing test.registred and test.notregistred are supported. --> | |
| <target name="main-all"> | |
| <antcall target="xml.version.information"/> | |
| <antcall target="clean.scenario"/> | |
| </target> | |
| </project> |