| <?xml version="1.0" encoding="UTF-8"?> |
| <project name="build-kernel" xmlns:ivy="antlib:org.apache.ivy.ant"> |
| |
| <path id="bundles"> |
| </path> |
| |
| <property file="${basedir}/../build.properties"/> |
| <property file="${basedir}/../build.versions"/> |
| <import file="${basedir}/../virgo-build/multi-bundle/default.xml"/> |
| <property name="kernel.basedir" value="${basedir}/kernel"/> |
| |
| <target name="kernel.package-resources-and-products" depends="ivy.init"> |
| <!-- prepare Kernel's resources - configurations and bundles that are not installed initially --> |
| <property name="kernel.resources" value="${kernel.target.dir}/kernel_resources"/> |
| |
| <ivy:resolve resolveId="copy.path" file="${kernel.basedir}/repository-ext-ivy.xml" transitive="true"/> |
| <ivy:retrieve resolveId="copy.path" pattern="${kernel.resources}/repository/ext/[artifact]_[revision].[ext]" conf="repository-ext" type="jar"/> |
| |
| <ivy:resolve resolveId="copy.path" file="${kernel.basedir}/pickup-ivy.xml" transitive="true"/> |
| <ivy:retrieve resolveId="copy.path" pattern="${kernel.resources}/pickup/[artifact]_[revision].[ext]" type="jar, war, wab" conf="pickup"/> |
| <ivy:retrieve resolveId="copy.path" pattern="${kernel.resources}/pickup/[artifact]_[revision].[ext]" type="plan" conf="pickup-plan"/> |
| <ivy:retrieve resolveId="copy.path" pattern="${kernel.resources}/repository/ext/[artifact]_[revision].[ext]" type="jar, war, wab" conf="pickup-plan"/> |
| |
| <mkdir dir="${kernel.resources}/configuration"/> |
| |
| <copy todir="${kernel.resources}/configuration" failonerror="false"> |
| <fileset dir="${kernel.basedir}/configuration" excludes="org.eclipse.virgo.kernel.userregion.properties"/> |
| </copy> |
| |
| <copy todir="${kernel.resources}" failonerror="false"> |
| <fileset dir="${kernel.basedir}/resources"/> |
| </copy> |
| |
| <copy todir="${kernel.resources}/repository/ext" failonerror="false"> |
| <fileset dir="${kernel.basedir}/repository/ext"/> |
| </copy> |
| |
| <copy todir="${kernel.resources}/repository/ext" failonerror="false"> |
| <fileset dir="${kernel.target.dir}/assembly/plugins"> |
| <include name="org.eclipse.virgo.kernel.agent.dm_*.jar"/> |
| </fileset> |
| </copy> |
| <!-- Prepare these two as part of the resources. They need a later installation, not with the other initial kernel region bundles. --> |
| <copy todir="${kernel.resources}/plugins" failonerror="false"> |
| <fileset dir="${kernel.target.dir}/assembly/plugins"> |
| <include name="org.eclipse.virgo.kernel.userregion_*.jar"/> |
| <include name="org.eclipse.virgo.shell.command_*.jar"/> |
| <!--include name="org.eclipse.virgo.kernel.osgicommand_*.jar"/--> |
| </fileset> |
| </copy> |
| |
| <move todir="${kernel.resources}/repository/ext" failonerror="false"> |
| <fileset dir="${kernel.target.dir}/assembly/plugins"> |
| <include name="org.eclipse.virgo.kernel.dmfragment_*.jar"/> |
| <include name="org.eclipse.virgo.kernel.deployer.dm_*.jar"/> |
| </fileset> |
| </move> |
| |
| <mkdir dir="${kernel.resources}/repository/usr"/> |
| |
| <property name="kernel.resources.location" value="${kernel.target.dir}/kernel_resources_zipped"/> |
| <zip destfile="${kernel.resources.location}/binary/kernel_resources"> |
| <zipfileset dir="${kernel.resources}"/> |
| </zip> |
| <delete dir="${kernel.resources}" quiet="true"/> |
| |
| <!-- Assemble and prepare for publishing the Kernel's specific resources --> |
| <property name="specific.resources" value="${kernel.target.dir}/specific_resources"/> |
| <mkdir dir="${specific.resources}/lib"/> |
| <mkdir dir="${specific.resources}/configuration"/> |
| |
| <copy todir="${specific.resources}/configuration" failonerror="false"> |
| <fileset dir="${kernel.basedir}/configuration"> |
| <include name="org.eclipse.virgo.kernel.userregion.properties"/> |
| </fileset> |
| <filterset> |
| <filter token="ASPECTJ.VERSION" value="${org.aspectj}"/> |
| <filter token="OSGI.SERVICES.VERSION" value="${org.eclipse.osgi.services}"/> |
| <filter token="EQUINOX.EVENT.VERSION" value="${org.eclipse.equinox.event}"/> |
| <filter token="EQUINOX.CONFIGADMIN.VERSION" value="${org.eclipse.equinox.cm}"/> |
| <filter token="EQUINOX.DS.VERSION" value="${org.eclipse.equinox.ds}"/> |
| <filter token="EQUINOX.UTIL.VERSION" value="${org.eclipse.equinox.util}"/> |
| <filter token="OSGI.ENTERPRISE.VERSION" value="${org.osgi.enterprise}"/> |
| <filter token="GEMINI.MANAGEMENT.VERSION" value="${org.eclipse.gemini.management}"/> |
| <filter token="KERNEL.VERSION" value="${org.eclipse.virgo.kernel}"/> |
| <filter token="MEDIC.VERSION" value="${org.eclipse.virgo.medic}"/> |
| <filter token="REPOSITORY.VERSION" value="${org.eclipse.virgo.repository}"/> |
| <filter token="SLF4J.VERSION" value="${org.slf4j.api}"/> |
| <filter token="SPRING.DM.VERSION" value="${org.eclipse.gemini.blueprint}"/> |
| <filter token="SPRING.VERSION" value="${org.springframework}"/> |
| <filter token="UTIL.VERSION" value="${org.eclipse.virgo.util}"/> |
| <filter token="FELIX.GOGO.RUNTIME.VERSION" value="${org.apache.felix.gogo.runtime}"/> |
| <filter token="FELIX.GOGO.COMMAND.VERSION" value="${org.apache.felix.gogo.command}"/> |
| <filter token="FELIX.GOGO.SHELL.VERSION" value="${org.apache.felix.gogo.shell}"/> |
| <filter token="MINA.CORE.VERSION" value="${org.apache.mina.core}"/> |
| <filter token="SSHD.CORE.VERSION" value="${org.apache.sshd.core}"/> |
| <filter token="EQUINOX.CONSOLE.VERSION" value="${org.eclipse.equinox.console}"/> |
| <filter token="EQUINOX.CONSOLE.SSH.VERSION" value="${org.eclipse.equinox.console.ssh}"/> |
| |
| </filterset> |
| </copy> |
| |
| <!-- get and reconfigure the serviceability.xml and .version --> |
| <unzip src="${p2.repository.dir}/binary/nano_specific_resources_1.0.0" dest="${specific.resources}"> |
| <globmapper from="nano_specific_resources/*" to="*"/> |
| </unzip> |
| <echo file="${specific.resources}/lib/.version" append="true" message="virgo.kernel.version=${bundle.version}
"/> |
| |
| <replaceregexp match="virgo-nano" replace="virgo-kernel" flags="g" file="${specific.resources}/configuration/serviceability.xml"/> |
| |
| <property name="specific.resources.location" value="${kernel.target.dir}/specific_resources_zipped"/> |
| <zip destfile="${specific.resources.location}/binary/kernel_specific_resources"> |
| <zipfileset dir="${specific.resources}"/> |
| </zip> |
| <delete dir="${specific.resources}" quiet="true"/> |
| |
| <!-- Publish --> |
| <mkdir dir="${artifacts.dir}"/> |
| <property name="p2.products.location" value="${kernel.basedir}/publish_resources/products"/> |
| |
| <antcall target="p2.publish-binary"> |
| <param name="repository" value="${p2.repository.dir}"/> |
| <param name="source" value="${kernel.resources.location}"/> |
| </antcall> |
| <echo message="Published the kernel resources to ${p2.repository.dir}."/> |
| |
| <antcall target="p2.publish-binary"> |
| <param name="repository" value="${p2.repository.dir}"/> |
| <param name="source" value="${specific.resources.location}"/> |
| </antcall> |
| <echo message="Published the kernel specific resources to ${p2.repository.dir}."/> |
| |
| <antcall target="p2.publish-product"> |
| <param name="repository" value="${p2.repository.dir}"/> |
| <param name="product.file.location" value="${p2.products.location}/kernel-base/kernel-base.product"/> |
| </antcall> |
| <echo message="Published kernel base product to ${p2.repository.dir}."/> |
| |
| <antcall target="p2.publish-product"> |
| <param name="repository" value="${p2.repository.dir}"/> |
| <param name="product.file.location" value="${p2.products.location}/kernel/kernel.product"/> |
| </antcall> |
| <echo message="Published kernel product to ${p2.repository.dir}."/> |
| </target> |
| |
| <target name="kernel.prepare-bundles-and-features" depends="ivy.init"> |
| <!-- Assemble the kernel bundles for publishing --> |
| <ivy:resolve resolveId="copy.path" file="${kernel.basedir}/plugins-ivy.xml" transitive="true"/> |
| <ivy:retrieve resolveId="copy.path" pattern="${kernel.target.dir}/assembly/plugins/[artifact]_[revision].[ext]" conf="plugins" type="jar"/> |
| <!-- Prepare the features for publishing --> |
| <copy todir="${kernel.target.dir}/assembly/features" failonerror="false"> |
| <fileset dir="${kernel.basedir}/publish_resources/features" excludes="keystore"/> |
| <filterset> |
| <filter token="REGION.VERSION" value="${org.eclipse.equinox.region}"/> |
| <filter token="KERNEL.VERSION" value="${org.eclipse.virgo.kernel}"/> |
| <filter token="REPOSITORY.VERSION" value="${org.eclipse.virgo.repository}"/> |
| <filter token="SPRING.VERSION" value="${org.springframework}"/> |
| <filter token="JAVAX.SERVLET.VERSION" value="${javax.servlet}"/> |
| <filter token="EQUINOX.HTTP.VERSION" value="${org.eclipse.equinox.http}"/> |
| <filter token="OSGI.ENTERPRISE.VERSION" value="${org.osgi.enterprise}"/> |
| <filter token="GEMINI.MANAGEMENT.VERSION" value="${org.eclipse.gemini.management}"/> |
| </filterset> |
| </copy> |
| </target> |
| |
| <target name="kernel.publish-bundles-and-features" depends="ivy.init"> |
| <antcall target="p2.generate-inf"> |
| <param name="source" value="${kernel.target.dir}/assembly/features"/> |
| </antcall> |
| |
| <!-- Publish --> |
| <mkdir dir="${artifacts.dir}"/> |
| <antcall target="p2.publish-bundles-features"> |
| <param name="repository" value="${p2.repository.dir}"/> |
| <param name="source" value="${kernel.target.dir}/assembly"/> |
| </antcall> |
| <echo message="Published bundles and features to ${p2.repository.dir}."/> |
| </target> |
| |
| <target name="kernel.clean-up" depends="ivy.init"> |
| <delete dir="${kernel.resources.location}" quiet="true"/> |
| <delete dir="${specific.resources.location}" quiet="true"/> |
| <delete dir="${kernel.target.dir}/assembly" quiet="true"/> |
| <delete dir="${kernel.target.dir}" quiet="true"/> |
| </target> |
| |
| <target name="kernel.package-distro" depends="ivy.init"> |
| <delete dir="${package.output.dir}" quiet="true"/> |
| <mkdir dir="${package.output.dir}"/> |
| <property name="vk.package.dir" value="${package.dir}/VK"/> |
| |
| <antcall target="p2.install-virgo-product"> |
| <param name="repository" value="${p2.repository.dir}"/> |
| <param name="destination" value="${vk.package.dir}/virgo-kernel-${bundle.version}"/> |
| <param name="product.iu" value="kernel.product"/> |
| </antcall> |
| <echo message="Installed Virgo Kernel for distribution purposes."/> |
| |
| <delete dir="${vk.package.dir}/virgo-kernel-${bundle.version}/Eclipse.app" quiet="true"/> |
| |
| <zip destfile="${artifacts.dir}/virgo-kernel-${bundle.version}.zip"> |
| <zipfileset dir="${vk.package.dir}" includes="virgo-kernel-${bundle.version}/bin/*.sh" filemode="755"/> |
| <zipfileset dir="${vk.package.dir}" includes="virgo-kernel-${bundle.version}/configuration/org.eclipse.virgo.kernel.jmxremote.access.properties" filemode="600"/> |
| <zipfileset dir="${vk.package.dir}"> |
| <exclude name="virgo-kernel-${bundle.version}/bin/*.sh"/> |
| <exclude name="virgo-kernel-${bundle.version}/configuration/org.eclipse.virgo.kernel.jmxremote.access.properties"/> |
| </zipfileset> |
| </zip> |
| </target> |
| |
| <target name="smoke-test-kernel" description="Runs a smoke test on the kernel packaged build"> |
| <path id="smoke.test.bundles"> |
| <pathelement location="${kernel.basedir}/org.eclipse.virgo.kernel.smoketest" /> |
| </path> |
| <antcall target="test.pre"/> |
| <all-bundles target="test-package" buildpathRef="smoke.test.bundles"> |
| <property name="package.output.file" value="${artifacts.dir}/virgo-kernel-${bundle.version}.zip"/> |
| <property name="package.basename" value="virgo-kernel-${bundle.version}"/> |
| </all-bundles> |
| <antcall target="test.post"/> |
| </target> |
| |
| </project> |