blob: 068c4169b5a07ee0775eff7058b1ce663bc5d087 [file] [log] [blame]
<!--/*******************************************************************************
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Ant naming conventions:
* - regardless of the actual OS platform,'/' is the directory separator
* (Ant will convert as appropriate).
* - multi-word properties use periods '.'
* - multi-word targets use hyphens '-'
* - multi-word macros use underscores '_'
* - multi-word macro attributes are concatinated
* e.g. 'runpathref'
* - multi-word tasks (taskdef) names are concatinated
* e.g. 'validateconnection'
* - OS environment variables are in ALLCAPS and have 'env' as a prefix
* e.g. ${env.XXX}.
* - Ant properties are lower case.
*
* Contributors:
* egwin - initial API and implementation
#******************************************************************************/-->
<project name="org.eclipse.persistence.antlr" default="build">
<available file="../${ant.project.name}" type="dir" property="antlr.is.local"/>
<!-- Test to make sure that the calling script doesn't inherit the variable -->
<!-- (should be set locally, and be destroyed upon return) -->
<fail message="Not running from '${ant.project.name}' directory" unless="antlr.is.local"/>
<dirname property="antlr.build.location" file="${ant.file.org.eclipse.persistence.antlr}"/>
<echo message="antlr.build.location = '${antlr.build.location}'"/>
<property name="antlr.2.common.plugins.dir" value=".."/>
<property name="antlr.2.base.dir" value="../.."/>
<!-- versioning -->
<!-- These variables are set in autobuild.xml. A manual build gets defaults -->
<tstamp>
<format property="build.date" pattern="yyyyMMdd"/>
<format property="build.time" pattern="HHmm"/>
</tstamp>
<property name="release.version" value="1.1.4"/>
<property name="build.type" value="SNAPSHOT"/>
<property name="svn.revision" value="NA"/>
<property name="version.qualifier" value="qualifier"/>
<property name="version.string" value="${release.version}.${version.qualifier}"/>
<property name="release.designation" value="EclipseLink DeveloperBuild"/>
<property name="eclipselink.antlr.bndl.prefix" value="${ant.project.name}"/>
<property name="src.dir" value="src"/>
<property name="antlr.classes.dir" value="."/>
<property name="temp.dir" value="${antlr.classes.dir}/tmp"/>
<!-- build -->
<target name="build" depends="clean, generate-manifest, package" description="build antlr"/>
<!-- clean -->
<target name="clean" description="Clean the build">
<delete dir="temp.dir" quiet="true"/>
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="${antlr.2.common.plugins.dir}" includes="${ant.project.name}_*.jar, ${ant.project.name}.source_*.jar"/>
</delete>
</target>
<!-- package -->
<target name="package" description="jar OSGI bundle">
<jar jarfile="${antlr.2.common.plugins.dir}/${ant.project.name}_${version.string}.jar" manifest="${temp.dir}/MANIFEST.MF">
<fileset dir="${antlr.2.base.dir}">
<include name="about.html"/>
<include name="readme.html"/>
<include name="license.*"/>
</fileset>
<fileset dir="${antlr.classes.dir}">
<include name="org/eclipse/persistence/**/*.class"/>
</fileset>
</jar>
<jar jarfile="${antlr.2.common.plugins.dir}/${ant.project.name}.source_${version.string}.jar">
<manifest>
<attribute name="Specification-Vendor" value="${specification.vendor}"/>
<attribute name="Specification-Version" value="${release.version}"/>
<attribute name="Implementation-Vendor" value="${implementation.vendor}"/>
<attribute name="Implementation-Version" value="${version.string}"/>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Bundle-Name" value="EclipseLink ANTLR Source"/>
<attribute name="Bundle-SymbolicName" value="${ant.project.name}.source"/>
<attribute name="Bundle-Vendor" value="${implementation.vendor}"/>
<attribute name="Bundle-Version" value="${version.string}"/>
<attribute name="Eclipse-SourceBundle" value="${ant.project.name};version=&quot;${version.string}&quot;"/>
</manifest>
<fileset dir="${antlr.2.base.dir}">
<include name="about.html"/>
<include name="readme.html"/>
<include name="license.*"/>
</fileset>
<fileset dir="${src.dir}">
<include name="org/eclipse/persistence/**/*.java"/>
</fileset>
</jar>
</target>
<target name="generate-manifest" description="Generate the OSGi bundle manifest before jarring">
<delete file="${temp.dir}/MANIFEST.MF" quiet="true"/>
<mkdir dir="${temp.dir}"/>
<echo message="Manifest-Version: 1.0${line.separator}" file="${temp.dir}/MANIFEST.MF" append="false"/>
<echo message="Specification-Vendor: ${line.separator}" file="${temp.dir}/MANIFEST.MF" append="true"/>
<echo message="Specification-Version: ${line.separator}" file="${temp.dir}/MANIFEST.MF" append="true"/>
<echo message="Implementation-Vendor: ${implementation.vendor}${line.separator}" file="${temp.dir}/MANIFEST.MF" append="true"/>
<echo message="Implementation-Version: ${version.string}${line.separator}" file="${temp.dir}/MANIFEST.MF" append="true"/>
<echo message="Bundle-ManifestVersion: 2${line.separator}" file="${temp.dir}/MANIFEST.MF" append="true"/>
<echo message="Bundle-Name: EclipseLink ANTLR${line.separator}" file="${temp.dir}/MANIFEST.MF" append="true"/>
<echo message="Bundle-SymbolicName: ${ant.project.name}${line.separator}" file="${temp.dir}/MANIFEST.MF" append="true"/>
<echo message="Bundle-Vendor: ${implementation.vendor}${line.separator}" file="${temp.dir}/MANIFEST.MF" append="true"/>
<echo message="Bundle-Version: ${version.string}${line.separator}" file="${temp.dir}/MANIFEST.MF" append="true"/>
<echo message="Bundle-RequiredExecutionEnvironment: J2SE-1.5${line.separator}" file="${temp.dir}/MANIFEST.MF" append="true"/>
<echo message="Export-Package: org.eclipse.persistence.internal.libraries.antlr.runtime;version=&quot;${version.string}&quot;,${line.separator}" file="${temp.dir}/MANIFEST.MF" append="true"/>
<echo message=" org.eclipse.persistence.internal.libraries.antlr.runtime.tree;version=&quot;${version.string}&quot;${line.separator}" file="${temp.dir}/MANIFEST.MF" append="true"/>
<echo message="Bundle-ClassPath: .${line.separator}" file="${temp.dir}/MANIFEST.MF" append="true"/>
<echo message="HK2-Bundle-Name: org.eclipse.persistence:${ant.project.name}${line.separator}" file="${temp.dir}/MANIFEST.MF" append="true"/>
</target>
</project>