blob: 009e83d4ca3984f86fc53a8a6100d219add5544a [file] [log] [blame]
<!--
******************************************************************************
* Copyright (c) 2016 Oracle
* 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:
* Konstantin Komissarchik - initial implementation and ongoing maintenance
******************************************************************************
-->
<project name="sapphire" default="full-build">
<dirname property="root.dir" file="${ant.file.sapphire}"/>
<property name="build.dir" value="${root.dir}/build"/>
<property name="releng.dir" value="${root.dir}/releng"/>
<loadproperties>
<url url="https://www.eclipse.org/sapphire/corundum.properties"/>
</loadproperties>
<delete dir="releng/corundum" quiet="true"/>
<get src="${corundum-1}" dest="releng/corundum.zip" usetimestamp="true"/>
<unzip src="releng/corundum.zip" dest="releng/corundum"/>
<import file="releng/corundum/corundum.xml"/>
<import>
<fileset dir="releng/corundum/extensions/eclipse.org" includes="*.xml"/>
</import>
<macrodef name="pre-finalize-repository">
<sequential>
<echo message="Mirroring ASM..."/>
<with-target name="${configuration.recommended}">
<find-eclipse-bundle property=".asm.bundle" eclipse="${.target}" bundle="org.objectweb.asm"/>
<copy file="${.asm.bundle}" todir="${build.dir}/repository/plugins"/>
<var name=".asm.bundle" unset="true"/>
</with-target>
</sequential>
</macrodef>
<macrodef name="post-build-packages">
<sequential>
<!-- Samples -->
<zip destfile="${build.dir}/packages/sapphire-samples-${version}.zip">
<fileset dir="${root.dir}/plugins/org.eclipse.sapphire.samples">
<exclude name=".apt_generated/**/*"/>
<exclude name=".resources/**/*"/>
<exclude name="bin/**/*"/>
</fileset>
</zip>
<!-- Documentation -->
<echo message="Building and loading Sapphire Releng Ant tasks..."/>
<delete dir="${releng.dir}/tasks/bin" quiet="true"/>
<mkdir dir="${releng.dir}/tasks/bin"/>
<javac debug="true" destdir="${releng.dir}/tasks/bin" classpath="${ant.home}/lib/ant.jar" includeAntRuntime="false" source="1.8" target="1.8">
<src path="${releng.dir}/tasks/src"/>
</javac>
<taskdef resource="org/eclipse/sapphire/releng/library.xml">
<classpath>
<pathelement location="${releng.dir}/tasks/bin"/>
<pathelement location="${releng.dir}/tasks/src"/>
</classpath>
</taskdef>
<delete dir="${build.dir}/documentation" quiet="true"/>
<mkdir dir="${build.dir}/documentation"/>
<install-eclipse dest="${build.dir}/documentation/eclipse" extensions="${iu.sapphire.doc.export}"/>
<stop-help-server eclipse="${build.dir}/documentation/eclipse"/>
<parallel failonany="true">
<start-help-server eclipse="${build.dir}/documentation/eclipse" port="65332"/>
<sequential>
<sleep seconds="30"/>
<export-documentation server="http://127.0.0.1:65332" dest="${build.dir}/documentation/exported"/>
<stop-help-server eclipse="${build.dir}/documentation/eclipse"/>
</sequential>
</parallel>
<zip destfile="${build.dir}/packages/sapphire-documentation-${version}.zip">
<fileset dir="${build.dir}/documentation/exported" includes="**/*"/>
</zip>
<delete dir="${build.dir}/documentation" quiet="true"/>
</sequential>
</macrodef>
<macrodef name="start-help-server">
<attribute name="eclipse"/>
<attribute name="port"/>
<sequential>
<echo message="Starting Eclipse help server on port @{port}..."/>
<find-eclipse-executable-folder eclipse="@{eclipse}" property=".eclipse.executable.folder"/>
<find-eclipse-bundle property=".help.base.bundle" eclipse="@{eclipse}" bundle="org.eclipse.help.base"/>
<java classname="org.eclipse.help.standalone.Help" classpath="${.help.base.bundle}" fork="true" dir="${.eclipse.executable.folder}">
<arg value="-command"/>
<arg value="start"/>
<arg value="-port"/>
<arg value="@{port}"/>
</java>
<var name=".eclipse.executable.folder" unset="true"/>
<var name=".help.base.bundle" unset="true"/>
</sequential>
</macrodef>
<macrodef name="stop-help-server">
<attribute name="eclipse"/>
<sequential>
<echo message="Stopping Eclipse help server..."/>
<find-eclipse-executable-folder eclipse="@{eclipse}" property=".eclipse.executable.folder"/>
<find-eclipse-bundle property=".help.base.bundle" eclipse="@{eclipse}" bundle="org.eclipse.help.base"/>
<java classname="org.eclipse.help.standalone.Help" classpath="${.help.base.bundle}" fork="true" dir="${.eclipse.executable.folder}">
<arg value="-command"/>
<arg value="shutdown"/>
</java>
<var name=".eclipse.executable.folder" unset="true"/>
<var name=".help.base.bundle" unset="true"/>
</sequential>
</macrodef>
</project>