blob: 96c202723ce35bf10bfd26bfa195eb6f95ac8c08 [file] [log] [blame]
<?xml version="1.0"?>
<!--
/***********************************************************************************************************************
* Copyright (c) 2008, 2011 Attensity Europe GmbH and brox IT Solutions GmbH. All rights reserved. This program and
* the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies
* this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: Ralf Rausch (brox IT Solutions GmbH) - initial creator
* Juergen Schumacher (Attensity Europe GmbH) - maintenance
**********************************************************************************************************************/
-->
<project name="Eclipse build" default="all" basedir=".">
<property name="build.dir" location="/opt/public/rt/smila" />
<property name="workspace.dir" location="${build.dir}/workspace" />
<property name="core.dir" location="${workspace.dir}/core" />
<property name="examples.dir" location="${workspace.dir}/examples" />
<property name="lib.dir" location="${build.dir}/libs" />
<property name="publish.dir" location="${build.dir}/nightly" />
<property name="javadoc.publish.dir" location="${build.dir}/javadoc" />
<property name="svn.trunk" value="https://dev.eclipse.org/svnroot/rt/org.eclipse.smila/trunk" />
<property name="svn.core" value="${svn.trunk}/core" />
<property name="svn.examples" value="${svn.trunk}/examples" />
<property name="source.zip" value="${workspace.dir}/SMILA-core-source.zip" />
<property name="examples.zip" value="${workspace.dir}/SMILA-integrator-examples.zip" />
<!-- =================================================================== -->
<!-- TASK DEFS -->
<!-- =================================================================== -->
<path id="svnant.dir">
<fileset dir="${lib.dir}/svnant">
<include name="**/*.jar" />
</fileset>
</path>
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.dir" />
<svnSetting id="svn.settings" svnkit="true" />
<path id="ant-contrib.lib">
<fileset dir="${lib.dir}/ant-contrib">
<include name="*.jar" />
</fileset>
</path>
<taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="ant-contrib.lib" />
<target name="clean">
</target>
<target name="all" depends="export, pack-sources, build, javadoc, publish" />
<target name="export">
<!-- =================================================================== -->
<!-- Export SMILA core and examples from eclipse svn -->
<!-- =================================================================== -->
<echo message="Exporting ${svn.core} ..." />
<svn refid="svn.settings">
<export srcUrl="${svn.core}" destPath="${core.dir}" force="true" />
</svn>
<echo message="Exporting ${svn.examples} ..." />
<svn refid="svn.settings">
<export srcUrl="${svn.examples}" destPath="${examples.dir}" force="true" />
</svn>
</target>
<target name="pack-sources">
<if>
<available file="${core.dir}" />
<then>
<zip destfile="${source.zip}" basedir="${core.dir}" />
</then>
</if>
<if>
<available file="${examples.dir}" />
<then>
<zip destfile="${examples.zip}" basedir="${examples.dir}" />
</then>
</if>
</target>
<target name="build">
<!-- =================================================================== -->
<!-- Build SMILA application without testing -->
<!-- =================================================================== -->
<copy file="${core.dir}/SMILA.builder/build.properties.template" tofile="${core.dir}/SMILA.builder/build.properties" />
<antcall target="run-builder">
<param name="target" value="final-application" />
</antcall>
</target>
<target name="javadoc">
<antcall target="run-builder">
<param name="target" value="javadoc" />
</antcall>
</target>
<target name="run-builder">
<ant antfile="${core.dir}/SMILA.builder/make.xml" target="${target}"
dir="${core.dir}/SMILA.builder" inheritAll="false">
<property name="buildDirectory" value="${core.dir}/eclipse.build" />
<property name="eclipse.home" value="${build.dir}/platform/eclipse-SDK-3.7.2-linux-gtk-x86_64" />
<property name="eclipse.running" value="true" />
<property name="os" value="win32" />
<property name="ws" value="win32" />
<property name="arch" value="x86" />
<property name="builder" value="${core.dir}/SMILA.builder" />
<property name="lib.dir" value="${lib.dir}" />
<property name="basedir" value="${core.dir}/SMILA.builder" />
</ant>
</target>
<target name="publish">
<!-- =================================================================== -->
<!-- Get latest revision number -->
<!-- =================================================================== -->
<svn refid="svn.settings">
<info target="${svn.core}" />
</svn>
<echo>Revision found: ${svn.info.lastRev}</echo>
<!-- =================================================================== -->
<!-- Copy binaries to download folder -->
<!-- =================================================================== -->
<property name="BINARY.WIN" value="${core.dir}/eclipse.build/Application/SMILA-win32.win32.x86.zip" />
<property name="BINARY.WIN64" value="${core.dir}/eclipse.build/Application/SMILA-win32.win32.x86_64.zip" />
<property name="BINARY.LNX" value="${core.dir}/eclipse.build/Application/SMILA-linux.gtk.x86.zip" />
<property name="BINARY.LNX64" value="${core.dir}/eclipse.build/Application/SMILA-linux.gtk.x86_64.zip" />
<property name="BINARY.MOX" value="${core.dir}/eclipse.build/Application/SMILA-macosx.cocoa.x86_64.zip" />
<if>
<and>
<available file="${BINARY.WIN}" />
<available file="${BINARY.WIN64}" />
<available file="${BINARY.LNX}" />
<available file="${BINARY.LNX64}" />
<available file="${BINARY.MOX}" />
</and>
<then>
<echo> Binaries are available.</echo>
<delete>
<fileset dir="${publish.dir}" includes="**/*.zip" />
</delete>
<copy file="${BINARY.WIN}" tofile="${publish.dir}/SMILA-r${svn.info.lastRev}-win32.win32.x86.zip" />
<copy file="${BINARY.WIN64}" tofile="${publish.dir}/SMILA-r${svn.info.lastRev}-win32.win32.x86_64.zip" />
<copy file="${BINARY.LNX}" tofile="${publish.dir}/SMILA-r${svn.info.lastRev}-linux.gtk.x86.zip" />
<copy file="${BINARY.LNX64}" tofile="${publish.dir}/SMILA-r${svn.info.lastRev}-linux.gtk.x86_64.zip" />
<copy file="${BINARY.MOX}" tofile="${publish.dir}/SMILA-r${svn.info.lastRev}-macosx.cocoa.x86_64.zip" />
</then>
<else>
<echo> Binaries are not available!</echo>
</else>
</if>
<if>
<available file="${core.dir}/eclipse.build/javadoc/index.html" />
<then>
<echo> Javadocs are available.</echo>
<delete dir="${javadoc.publish.dir}/current" failonerror="false" />
<copy todir="${javadoc.publish.dir}/current">
<fileset dir="${core.dir}/eclipse.build/javadoc" />
</copy>
</then>
<else>
<echo> Javadocs are not available!</echo>
</else>
</if>
<if>
<available file="${source.zip}" />
<then>
<echo> Sources are available.</echo>
<copy file="${source.zip}" tofile="${publish.dir}/SMILA-r${svn.info.lastRev}-core-source.zip" />
</then>
<else>
<echo> Sources are not available!</echo>
</else>
</if>
<if>
<available file="${examples.zip}" />
<then>
<echo> Examples are available.</echo>
<copy file="${examples.zip}" tofile="${publish.dir}/SMILA-r${svn.info.lastRev}-integrator-examples.zip" />
</then>
<else>
<echo> Examples are not available!</echo>
</else>
</if>
</target>
</project>