blob: cf364cf9196e9e36ac7bb3952438655b0d4fa22d [file] [log] [blame]
<project name="javax.persistence-api" basedir="." default="info">
<target name="info" depends="init">
<!-- IMPL properties -->
<property name="IMPL_NAMESPACE" value="org.eclipse.persistence"/>
<property name="IMPL_VERSION" value="2.1.0"/>
<echo message="Metadata as defined by: 'https://wikis.oracle.com/display/GlassFish/Maven+Versioning+Rules':"/>
<echo message=" "/>
<echo message="API_PACKAGE: ${API_PACKAGE}"/>
<echo message="SPEC_VERSION: ${SPEC_VERSION}"/>
<echo message="SPEC_IMPL_VERSION: ${SPEC_IMPL_VERSION}"/>
<echo message=" "/>
<echo message="IMPL_NAMESPACE: ${IMPL_NAMESPACE}"/>
<echo message="IMPL_VERSION: ${IMPL_VERSION}"/>
<echo message=" "/>
<echo message="API jar file: ${API_PACKAGE}-api.jar"/>
<echo message=" OSGi Bundle-SymbolicName: ${API_PACKAGE}-api"/>
<echo message=" OSGi bundle specversion: ${SPEC_VERSION}"/>
<echo message=" OSGi Bundle-Version: ${SPEC_IMPL_VERSION}"/>
<echo message=" Maven group ID, artifact ID: ${API_PACKAGE}:${API_PACKAGE}-api"/>
<echo message=" Maven version: ${SPEC_IMPL_VERSION}"/>
<echo message=" Maven API jar file: ${API_PACKAGE}-api-${SPEC_IMPL_VERSION}.jar"/>
<echo message=" Maven API javadoc file: ${API_PACKAGE}-api-${SPEC_IMPL_VERSION}-javadoc.jar"/>
<echo message=" Maven API source file: ${API_PACKAGE}-api-${SPEC_IMPL_VERSION}-sources.jar"/>
<echo message=" jar Extension-Name: ${API_PACKAGE}"/>
<echo message=" jar Specification-Version: ${SPEC_VERSION}"/>
<echo message=" jar Implementation-Version: ${SPEC_IMPL_VERSION}"/>
<echo message=" "/>
<echo message="Implementation jar file: ${API_PACKAGE}.jar"/>
<echo message=" OSGi Bundle-SymbolicName: ${IMPL_NAMESPACE}.${API_PACKAGE}"/>
<echo message=" OSGi bundle specversion: ${SPEC_VERSION}"/>
<echo message=" OSGi Bundle-Version: ${IMPL_VERSION}"/>
<echo message=" Maven group ID, artifact ID: ${IMPL_NAMESPACE}:${API_PACKAGE}"/>
<echo message=" Maven version: ${IMPL_VERSION}"/>
<echo message=" Maven impl jar file: ${API_PACKAGE}-${IMPL_VERSION}.jar"/>
<echo message=" jar Extension-Name: ${API_PACKAGE}"/>
<echo message=" jar Specification-Version: ${SPEC_VERSION}"/>
<echo message=" jar Implementation-Version: ${IMPL_VERSION}"/>
<echo message=" "/>
<echo message=" "/>
<echo message="Note: The qualifier was omitted from these rules. I believe the API Bundle-Version"/>
<echo message=" should really be something like: ${SPEC_IMPL_VERSION}.${API_QUALIFIER}"/>
<echo message=" "/>
<echo message="Note2: Tycho expects 'Bundle-Version' to be the Maven 'Version' coordinate (IMPL_VERSION) followed by '.qualifier'"/>
<echo message=" which it then substitutes for a generated qualifier at build time. For example: ${persistence.version}"/>
<echo message=" "/>
<echo message="Note3: Tycho requires ArtifactID to be ${Bundle-SymbolicName}"/>
<echo message=" "/>
<echo message="Note4: P2/Equinox requires the bundle jarname to be: ${Bundle-SymbolicName}_${Bundle-Version}.jar"/>
<echo message=" While renaming the jar shipped in glassfish is possible, it would be confusing to users."/>
<echo message=" Also, the metadata in the manifest couldn't be simply 'renamed'."/>
<echo message="Therefore:"/>
<echo message=" IMPL bundle filename: ${API_PACKAGE}_${persistence.version}.jar"/>
<echo message=" IMPL Bundle-SymbolicName: ${API_PACKAGE}"/>
<echo message=" IMPL Bundle-Version: ${persistence.version}"/>
<echo message=" which is preferable (both historically, and due to jarname length) to changing 'IMPL ArtifactId' to"/>
<echo message=" match 'IMPL Bundle-SymbolicName' and thus yield:"/>
<echo message=" IMPL bundle filename: ${IMPL_NAMESPACE}.${API_PACKAGE}_${persistence.version}.jar"/>
<echo message=" IMPL Bundle-SymbolicName: ${IMPL_NAMESPACE}.${API_PACKAGE}"/>
<echo message=" IMPL Bundle-Version: ${persistence.version}"/>
<echo message=" IMPL Mvn GroupId:ArtifactId: ${IMPL_NAMESPACE}:${IMPL_NAMESPACE}.${API_PACKAGE}"/>
<echo message=" "/>
<echo message="Note5: Eclipse has source bundle standard of: ${Bundle-SymbolicName}.source_${Bundle-Version}.jar"/>
<echo message="Therefore: ${API_PACKAGE}.source_${persistence.version}.jar"/>
<echo message=" "/>
<echo message="Note6: There is no Eclipse requirement for javadoc bundles. However, Maven Central does require javadoc for each artifact"/>
<echo message=" so unless Maven implements specific naming requirements, it would make sense to stick to a similar formula to use"/>
<echo message=" IMPL javadoc jarname: ${Bundle-SymbolicName}.javadoc_${Bundle-Version}.jar"/>
<echo message=" rather than ${API_Package}-${IMPL_Version}-javadoc.jar"/>
<echo message="Therefore: ${API_PACKAGE}.javadoc_${persistence.version}.jar"/>
<echo message=" "/>
<echo message="Metadata proposal taking into account Eclipse Standards:"/>
<echo message=" "/>
<echo message="API_PACKAGE: ${API_PACKAGE}"/>
<echo message="SPEC_VERSION: ${SPEC_VERSION}"/>
<echo message="SPEC_IMPL_VERSION: ${SPEC_IMPL_VERSION}"/>
<echo message="API_QUALIFIER (guess): ${API_QUALIFIER}"/>
<echo message=" "/>
<echo message="IMPL_NAMESPACE: ${IMPL_NAMESPACE}"/>
<echo message="IMPL_VERSION: ${IMPL_VERSION}"/>
<echo message=" "/>
<echo message="API jar file: ${API_JAR}"/>
<echo message=" OSGi Bundle-SymbolicName: ${API_PACKAGE}-api"/>
<echo message=" OSGi bundle specversion: ${SPEC_VERSION}"/>
<echo message=" OSGi Bundle-Version: ${SPEC_IMPL_VERSION}"/>
<echo message=" OSGi PackageExport: ${OSGi_PackageExport}"/>
<echo message=" Maven group ID, artifact ID: ${API_PACKAGE}:${API_PACKAGE}-api"/>
<echo message=" Maven version: ${SPEC_IMPL_VERSION}"/>
<echo message=" Maven API jar file: ${API_PACKAGE}-api-${SPEC_IMPL_VERSION}.jar"/>
<echo message=" Maven API javadoc file: ${API_PACKAGE}-api-${SPEC_IMPL_VERSION}-javadoc.jar"/>
<echo message=" Maven API source file: ${API_PACKAGE}-api-${SPEC_IMPL_VERSION}-sources.jar"/>
<echo message=" jar Extension-Name: ${API_PACKAGE}"/>
<echo message=" jar Specification-Version: ${SPEC_VERSION}"/>
<echo message=" jar Implementation-Version: ${SPEC_IMPL_VERSION}"/>
<echo message=" "/>
<echo message="Implementation jar file: ${API_PACKAGE}_${persistence.version}.jar"/>
<echo message=" OSGi Bundle-SymbolicName: ${API_PACKAGE}"/>
<echo message=" OSGi bundle specversion: ${SPEC_VERSION}"/>
<echo message=" OSGi Bundle-Version: ${persistence.version}"/>
<echo message=" OSGi IMPL source file: ${API_PACKAGE}.source_${persistence.version}.jar"/>
<echo message=" OSGi IMPL javadoc file: ${API_PACKAGE}.javadoc_${persistence.version}.jar"/>
<echo message=" Maven group ID, artifact ID: ${IMPL_NAMESPACE}:${API_PACKAGE}"/>
<echo message=" Maven version: ${IMPL_VERSION}"/>
<echo message=" Maven IMPL jar file: ${API_PACKAGE}-${IMPL_VERSION}.jar"/>
<echo message=" Maven IMPL source file: ${API_PACKAGE}-${IMPL_VERSION}-sources.jar"/>
<echo message=" Maven IMPL javadoc file: ${API_PACKAGE}-${IMPL_VERSION}-javadoc.jar"/>
<echo message=" jar Extension-Name: ${API_PACKAGE}"/>
<echo message=" jar Specification-Version: ${SPEC_IMPL_VERSION}"/>
<echo message=" jar Implementation-Version: ${IMPL_VERSION}"/>
<echo message=" "/>
</target>
<target name="init">
<!-- API properties -->
<tstamp>
<format property="build.date" pattern="yyyyMMdd"/>
<format property="build.time" pattern="HHmm"/>
</tstamp>
<property name="API_PACKAGE" value="javax.persistence"/>
<property name="SPEC_VERSION" value="2.1"/>
<property name="SPEC_IMPL_VERSION" value="2.1.0"/>
<property name="API_QUALIFIER" value="b10"/>
<property name="API_JAR" value="${API_PACKAGE}-api.jar"/>
<property name="API_javadoc_file" value="${API_PACKAGE}-api-javadoc.jar"/>
<property name="API_source_file" value="${API_PACKAGE}-api-sources.jar"/>
<property name="OSGi_SymbolicName" value="${API_PACKAGE}-api"/>
<property name="OSGi_BundleName" value="Java Persistence API 2.1"/>
<property name="OSGi_specversion" value="${SPEC_VERSION}"/>
<property name="OSGi_Bundle-Version" value="${SPEC_IMPL_VERSION}"/>
<property name="OSGi_Bundle-Vendor" value="Eclipse.org - EclipseLink Project"/>
<property name="OSGi_PackageExport" value="${SPEC_IMPL_VERSION}"/>
<property name="jar_Extension-Name" value="${API_PACKAGE}"/>
<property name="jar_Specification-Version" value="${SPEC_VERSION}"/>
<property name="jar_Specification-Vendor" value="Oracle"/>
<property name="jar_Implementation-Version" value="${SPEC_IMPL_VERSION}"/>
<property name="jar_Implementation-Vendor" value="Eclipse.org - EclipseLink Project"/>
<property name="Maven_group_ID" value="${API_PACKAGE}"/>
<property name="Maven_artifact_ID" value="${API_PACKAGE}-api"/>
<property name="Maven_version" value="${SPEC_IMPL_VERSION}"/>
<property name="Maven_API_filename" value="${API_PACKAGE}-api-${SPEC_IMPL_VERSION}.jar"/>
<property name="Maven_API_javadoc_file" value="${API_PACKAGE}-api-${SPEC_IMPL_VERSION}-javadoc.jar"/>
<property name="Maven_API_source_file" value="${API_PACKAGE}-api-${SPEC_IMPL_VERSION}-sources.jar"/>
<dirname property="build.location_temp" file="${ant.file.javax.persistence-api}"/>
<pathconvert targetos="unix" property="build.location">
<path>
<pathelement location="${build.location_temp}"/>
</path>
</pathconvert>
<property name="build.2.base.dir" value="${build.location}/.."/>
<property name="build.2.plugins.dir" value="${build.location}/target"/>
<property name="build.2.classes.dir" value="${build.location}/target/classes"/>
<property name="build.2.APIjavadoc.dir" value="${build.location}/target/APIjavadoc"/>
<property name="build.2.src.dir" value="${build.location}/src"/>
<property name="releng.loc" value="${build.location}/../eclipselink.releng"/>
<condition property="build.2.releng.dir" value="${releng.loc}">
<available file="${releng.loc}" type="dir"/>
</condition>
<fail message="releng repo not found. Clone at '${releng.loc}' and retry." unless="build.2.releng.dir"/>
<!-- Custom task definitions -->
<property name="custom.tasks.lib" value="${build.2.releng.dir}/ant_customizations.jar"/>
<property name="custom.echo.task.class" value="org.eclipse.persistence.buildtools.ant.taskdefs.Say"/>
<property name="custom.selectbundle.task.class" value="org.eclipse.persistence.buildtools.ant.taskdefs.SelectBundle"/>
<property name="custom.stripqualifier.task.class" value="org.eclipse.persistence.buildtools.ant.taskdefs.StripQualifier"/>
<echo message="custom.tasks.lib ='${custom.tasks.lib}'"/>
<echo message="custom.echo.task.class ='${custom.echo.task.class}'"/>
<echo message="custom.selectbundle.task.class ='${custom.selectbundle.task.class}'"/>
<echo message="custom.stripqualifier.task.class ='${custom.stripqualifier.task.class}'"/>
<echo message=" ---"/>
<taskdef name="say" classname="${custom.echo.task.class}" classpath="${custom.tasks.lib}"/>
<taskdef name="selectbundle" classname="${custom.selectbundle.task.class}" classpath="${custom.tasks.lib}"/>
<taskdef name="stripQualifier" classname="${custom.stripqualifier.task.class}" classpath="${custom.tasks.lib}"/>
<property name="persistence.prefix" value="${API_PACKAGE}"/>
<property name="persistence.criteria" value="[2.0.100,2.2.0)"/>
<selectbundle basename="${persistence.prefix}" directory="${build.2.plugins.dir}"
criterion="${persistence.criteria}" property="persistence.version" versiononly="true"
/>
<fail message="${persistence.prefix} bundle not found. run mvn, then retry to generate api" unless="persistence.version"/>
<stripQualifier input="${persistence.version}" property="IMPL_VERSION"/>
<say message="Found ${persistence.prefix}_${persistence.version}.jar" if="persistence.version"/>
</target>
<target name="build" depends="init, package-jar, package-src, build-javadoc, package-javadoc"/>
<target name="build-javadoc">
<!-- the following property needs to be here because the "qualifier" is generated at runtime -->
<property name="javadoc.title" value="Java Persistence ${SPEC_VERSION} API Reference"/>
<delete dir="${build.2.APIjavadoc.dir}" failonerror="false"/>
<javadoc
maxmemory="384m"
Verbose="false"
packagenames="${API_PACKAGE}.**"
destdir="${build.2.APIjavadoc.dir}"
useexternalfile="yes"
additionalparam="-breakiterator -quiet"
windowtitle="${javadoc.title}"
>
<classpath>
<path id="javadoc.path">
<pathelement path="${build.2.plugins.dir}/${API_JAR}"/>
</path>
</classpath>
<tag name ="author" enabled="true" description="Author:" />
<tag name ="since" scope="all" description="Since:" />
<tag name ="SBGen" scope="all" description="SBGen:" />
<tag name ="bug" enabled="true" description="Related Bugs:" />
<doctitle><![CDATA[${javadoc.title}]]></doctitle>
<header><![CDATA[${javadoc.title}]]></header>
<fileset dir="${build.2.src.dir}" defaultexcludes="yes">
<include name="javax/persistence/**/*.java"/>
</fileset>
</javadoc>
</target>
<target name="package-jar" depends="init">
<delete file="${build.2.plugins.dir}/${API_JAR}" failonerror="false"/>
<jar jarfile="${build.2.plugins.dir}/${API_JAR}" duplicate="preserve">
<manifest>
<attribute name="Export-Package" value="javax.persistence;jpa=&quot;${OSGi_specversion}&quot;;version=&quot;${OSGi_PackageExport}&quot;,javax.persistence.criteria;jpa=&quot;${OSGi_specversion}&quot;;version=&quot;${OSGi_PackageExport}&quot;,javax.persistence.metamodel;jpa=&quot;${OSGi_specversion}&quot;;version=&quot;${OSGi_PackageExport}&quot;,javax.persistence.spi;jpa=&quot;${OSGi_specversion}&quot;;version=&quot;${OSGi_PackageExport}&quot;"/>
<attribute name="Implementation-Version" value="${SPEC_IMPL_VERSION}"/>
<attribute name="Bundle-ClassPath" value="."/>
<attribute name="Specification-Vendor" value="${jar_Specification-Vendor}"/>
<attribute name="Bundle-Name" value="${OSGi_BundleName}"/>
<attribute name="Bundle-RequiredExecutionEnvironment" value="JavaSE-1.6"/>
<attribute name="Implementation-Vendor" value="${jar_Implementation-Vendor}"/>
<attribute name="Bundle-Vendor" value="${OSGi_Bundle-Vendor}"/>
<attribute name="Bundle-Version" value="${OSGi_Bundle-Version}"/>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Import-Package" value="javax.sql;resolution:=optional"/>
<attribute name="Specification-Version" value="${SPEC_VERSION}"/>
<attribute name="Bundle-SymbolicName" value="${OSGi_SymbolicName}"/>
<attribute name="Extension-Name" value="${jar_Extension-Name}"/>
</manifest>
<fileset dir="${build.2.classes.dir}" includes="javax/persistence/**/*.class"/>
<fileset dir="${build.2.src.dir}" includes="javax/persistence/**/*.xsd"/>
</jar>
</target>
<target name="package-src" depends="init">
<delete file="${build.2.plugins.dir}/${API_source_file}" failonerror="false"/>
<jar jarfile="${build.2.plugins.dir}/${API_source_file}" duplicate="preserve">
<manifest>
<attribute name="Implementation-Version" value="${SPEC_IMPL_VERSION}"/>
<attribute name="Specification-Vendor" value="${jar_Specification-Vendor}"/>
<attribute name="Bundle-Name" value="${OSGi_BundleName} Source"/>
<attribute name="Implementation-Vendor" value="${jar_Implementation-Vendor}"/>
<attribute name="Bundle-Vendor" value="${OSGi_Bundle-Vendor}"/>
<attribute name="Bundle-Version" value="${OSGi_Bundle-Version}"/>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Specification-Version" value="${SPEC_VERSION}"/>
<attribute name="Bundle-SymbolicName" value="${OSGi_SymbolicName}.source"/>
<attribute name="Extension-Name" value="${jar_Extension-Name}"/>
</manifest>
<fileset dir="${build.2.src.dir}" includes="javax/persistence/**"/>
</jar>
</target>
<target name="package-javadoc" depends="init">
<delete file="${build.2.plugins.dir}/${API_javadoc_file}" failonerror="false"/>
<jar jarfile="${build.2.plugins.dir}/${API_javadoc_file}" duplicate="preserve">
<manifest>
<attribute name="Implementation-Version" value="${SPEC_IMPL_VERSION}"/>
<attribute name="Specification-Vendor" value="${jar_Specification-Vendor}"/>
<attribute name="Bundle-Name" value="${OSGi_BundleName} Javadoc"/>
<attribute name="Implementation-Vendor" value="${jar_Implementation-Vendor}"/>
<attribute name="Bundle-Vendor" value="${OSGi_Bundle-Vendor}"/>
<attribute name="Bundle-Version" value="${OSGi_Bundle-Version}"/>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Specification-Version" value="${SPEC_VERSION}"/>
<attribute name="Bundle-SymbolicName" value="${OSGi_SymbolicName}.javadoc"/>
<attribute name="Extension-Name" value="${jar_Extension-Name}"/>
</manifest>
<fileset dir="${build.2.APIjavadoc.dir}" includes="**"/>
</jar>
</target>
</project>