Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

221 lines (194 sloc) 9.6 kB
<project name="build-com.buglabs.dragonfly" default="build">
<property name="build.level" value="integration" />
<import file="common.xml" />
<fail unless="bug-osgi.tag" message="'bug-osgi.tag' must be defined." />
<property name="git.bin" location="/usr/bin/git" />
<property name="project.feature" value="com.buglabs.dragonfly.feature" />
<property name="meta.project" value="com.buglabs.dragonfly" />
<property name="eclipse.dir" value="/opt/jenkins/build-deps/com.eclipse.sdk" />
<property name="eclipse.default.file" value="${eclipse.dir}/eclipse-lin.tar.gz" />
<property name="felix.download.url" value="http://www.eng.lsu.edu/mirrors/apache/felix/" />
<property name="knapsack.download.url" value="https://leafcutter.ci.cloudbees.com/job/knapsack/57/artifact/knapsack.jar" />
<property name="tmp.dir" location="/tmp/dragonly_build_tmp" />
<property name="felix.version" value="3.2.2" />
<property name="felix.log.version" value="1.0.1" />
<property name="publishDir" location="/tmp" />
<!-- ===================================================================== -->
<!-- Build properties fetch.dependencies -->
<!-- Depending on how this script is executed build properties are either generated or inhereted from calling script -->
<!-- ===================================================================== -->
<if>
<not>
<isset property="full.sdk.build.id" />
</not>
<then>
<echo message="[Build type]: Running individual component build..." />
<tstamp />
<property name="timestamp" value="${DSTAMP}${TSTAMP}" />
<property name="build.id" value="v${timestamp}_${build.letter}" />
<property name="build.label" value="${sdk.version}.${build.id}" />
<property name="meta.project.version" value="${build.id}" />
</then>
<else>
<echo message="[Build type]: Running full SDK component build..." />
<property name="build.id" value="${full.sdk.build.id}" />
<property name="build.label" value="${sdk.version}.${build.id}" />
<property name="meta.project.version" value="${build.id}" />
</else>
</if>
<!-- Checkout the correct branch/tag of the base project -->
<target name="checkout.branch">
<echo message="Checking out version: ${dragonfly.tag}" />
<exec executable="${git.bin}" dir="${checkout.dir}">
<arg value="checkout" />
<arg value="-f" />
<arg value="${dragonfly.tag}" />
</exec>
</target>
<target name="fetch.dependencies">
<copy todir="${base.build.dir}">
<fileset dir="${checkout.dir}">
<exclude name="build" />
</fileset>
</copy>
<echo message="Checking out projects from git and preparing directories..." />
<exec executable="${git.bin}" dir="${checkout.dir}">
<arg value="clone" />
<arg value="git://github.com/buglabs/bug-osgi.git" />
</exec>
<echo message="Checking out version: ${bug-osgi.tag}" />
<exec executable="${git.bin}" dir="${checkout.dir}/bug-osgi">
<arg value="checkout" />
<arg value="-f" />
<arg value="${bug-osgi.tag}" />
</exec>
<copy todir="${base.build.dir}">
<fileset dir="${checkout.dir}/bug-osgi">
</fileset>
</copy>
<!-- get Felix jars -->
<echo message="Downloading Felix artifacts from ${felix.download.url}" />
<mkdir dir="${checkout.dir}/com.buglabs.dragonfly.felix/framework" />
<exec dir="${checkout.dir}/com.buglabs.dragonfly.felix/framework" executable="wget">
<arg line="${knapsack.download.url}" />
</exec>
<!-- Add the BUG API Version to the Dragonfly Plugin Manifest -->
<manifest file="${checkout.dir}/com.buglabs.dragonfly/META-INF/MANIFEST.MF" mode="update">
<attribute name="BUG-API-Version" value="${bug.version}" />
</manifest>
<mkdir dir="${checkout.dir}/${project.feature}/build" />
<mkdir dir="${checkout.dir}/${project.feature}/build/plugins" />
<mkdir dir="${checkout.dir}/${project.feature}/build/features" />
<!-- copy dragonfly plugin dependencies into the PDE build -->
<copy todir="${base.build.dir}/${project.feature}/build/plugins">
<fileset dir="${checkout.dir}" excludes="**/${project.feature}/**,**/bug-osgi/**" />
<fileset dir="${checkout.dir}/bug-osgi/" includes="com.buglabs.common/*,com.buglabs.bug.dragonfly/*,com.buglabs.util.nmea/*,com.buglabs.bug.ws/*" />
</copy>
<copy todir="${base.build.dir}/${project.feature}/build/features/${project.feature}">
<fileset dir="${checkout.dir}/${project.feature}" excludes="**/build/**" />
</copy>
</target>
<target name="build" depends="clean,mkdirs,checkout.branch,fetch.dependencies,build-bug-osgi">
<echo message="#########################" />
<echo message="Building Dragonfly SDK..." />
<echo message="#########################" />
<if>
<and>
<isset property="eclipse.file" />
<available file="${eclipse.file}" type="file" />
</and>
<then>
<echo message="${eclipse.file} exists, copying..." />
<copy tofile="${checkout.dir}/com.eclipse.sdk/eclipse-lin.tar.gz">
<fileset file="${eclipse.file}" />
</copy>
</then>
<elseif>
<available file="${eclipse.default.file}" type="file" />
<then>
<echo message="${eclipse.default.file} exists, copying..." />
<copy tofile="${checkout.dir}/com.eclipse.sdk/eclipse-lin.tar.gz">
<fileset file="${eclipse.default.file}" />
</copy>
</then>
</elseif>
<else>
<echo message="Unable to find ${eclipse.file} or ${eclipse.default.file}, please add files or update the eclipse.file property" />
</else>
</if>
<exec dir="${checkout.dir}/com.eclipse.sdk" executable="tar">
<arg line="xfzv eclipse-lin.tar.gz" />
</exec>
<copy todir="${checkout.dir}/com.eclipse.sdk/eclipse/plugins" file="${dist.dir}/knapsack.jar">
</copy>
<copy todir="${checkout.dir}/com.eclipse.sdk/eclipse/plugins" file="${dist.dir}/commons-io-2.0.1.jar">
</copy>
<copy todir="${checkout.dir}/com.eclipse.sdk/eclipse/plugins" file="${dist.dir}/Sprinkles.jar">
</copy>
<copy todir="${checkout.dir}/com.eclipse.sdk/eclipse/plugins">
<fileset dir="${dist.dir}/" includes="com.buglabs.*.jar" />
</copy>
<!-- Call the target that does everything -->
<ant antfile="build.xml" target="bundles.all" dir="${base.build.dir}/${project.feature}">
<property name="eclipse.home" location="${root.dir}/com.eclipse.sdk/eclipse">
</property>
<property name="base" location="${root.dir}/com.eclipse.sdk/">
</property>
<property name="publishDir" location="${eclipse.dist.dir}">
</property>
</ant>
</target>
<target name="build-bug-osgi">
<echo message="Executing bug-osgi build: ${checkout.dir}/bug-osgi/com.buglabs.osgi.build/com.buglabs.osgi.xml" />
<ant antfile="${checkout.dir}/bug-osgi/com.buglabs.osgi.build/com.buglabs.osgi.xml" target="clean">
<property name="base.build.dir" value="${script.dir}" />
<property name="checkout.dir" value="${checkout.dir}/bug-osgi/" />
<property name="distDirectory" value="${dist.dir}" />
<property name="full.version" value="3.0.1.${meta.project.version}" />
</ant>
<ant antfile="${checkout.dir}/bug-osgi/com.buglabs.osgi.build/com.buglabs.osgi.xml" target="fetch.dependencies">
<property name="base.build.dir" value="${script.dir}" />
<property name="checkout.dir" value="${checkout.dir}/bug-osgi/" />
<property name="distDirectory" value="${dist.dir}" />
<property name="full.version" value="3.0.1.${meta.project.version}" />
</ant>
<ant antfile="${checkout.dir}/bug-osgi/com.buglabs.osgi.build/com.buglabs.osgi.xml" target="jar">
<property name="base.build.dir" value="${script.dir}" />
<property name="checkout.dir" value="${checkout.dir}/bug-osgi/" />
<property name="distDirectory" value="${dist.dir}" />
<property name="full.version" value="3.0.1.${meta.project.version}" />
</ant>
<ant antfile="${checkout.dir}/com.buglabs.bug.simulator/build.xml" target="clean">
<property name="base.build.dir" value="${script.dir}" />
<property name="checkout.dir" value="${checkout.dir}/" />
<property name="basedir" value="${checkout.dir}/com.buglabs.bug.simulator" />
<property name="distDirectory" value="${dist.dir}" />
<property name="full.version" value="3.0.1.${meta.project.version}" />
<property name="manifest.location" location="${checkout.dir}/com.buglabs.bug.simulator/META-INF/MANIFEST.MF" />
</ant>
<ant antfile="${checkout.dir}/com.buglabs.bug.simulator/build.xml" target="build.jars">
<property name="base.build.dir" value="${script.dir}" />
<property name="checkout.dir" value="${checkout.dir}/" />
<property name="basedir" value="${checkout.dir}/com.buglabs.bug.simulator" />
<property name="distDirectory" value="${dist.dir}" />
<property name="full.version" value="3.0.1.${meta.project.version}" />
<property name="manifest.location" location="${checkout.dir}/com.buglabs.bug.simulator/META-INF/MANIFEST.MF" />
</ant>
</target>
<target name="clean" description="Delete temporary directories">
<echo message="Deleting previous checkout directories..." />
<delete dir="${dist.dir}" />
<delete dir="${base.build.dir}" />
<delete dir="${checkout.dir}/com.eclipse.sdk" />
<delete dir="${checkout.dir}/bug-osgi" />
<delete dir="${checkout.dir}/com.buglabs.dragonfly.felix/framework" />
<delete dir="${checkout.dir}/com.buglabs.dragonfly.felix/bundle" />
<delete dir="${checkout.dir}/com.buglabs.dragonfly.feature/build" />
</target>
<target name="mkdirs" description="Create temporary directories">
<mkdir dir="${checkout.dir}" />
<mkdir dir="${base.build.dir}" />
<mkdir dir="${checkout.dir}/com.eclipse.sdk" />
<mkdir dir="${eclipse.dist.dir}" />
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.