maxGraph/java/build.xml

193 lines
7.0 KiB
XML
Raw Normal View History

2012-05-21 20:32:26 +00:00
<!--
2017-06-27 11:43:19 +00:00
Copyright (c) 2008-2017 JGraph Ltd.
2012-05-21 20:32:26 +00:00
-->
<!-- ===================== Project Properties =========================== -->
<project name="mxgraph" default="all" basedir=".">
<property name="product.name" value="mxGraph"/>
2020-10-28 16:11:03 +00:00
<property name="product.version" value="4.2.2"/>
2012-05-21 20:32:26 +00:00
<property name="all.jar" value="mxgraph-all.jar"/>
<property name="core.jar" value="mxgraph-core.jar"/>
<property name="swing.jar" value="mxgraph-swing.jar"/>
<!-- ===================== Project Environment =========================== -->
<property name="source.home" value="${basedir}/src"/>
<property name="example.home" value="${basedir}/examples"/>
2016-09-07 12:29:15 +00:00
<property name="grapheditor.home" value="${basedir}/../javascript/examples/grapheditor/java/src"/>
2012-05-21 20:32:26 +00:00
<property name="test.home" value="${basedir}/test"/>
<!-- ==================== Compilation Options ==================== -->
<property name="compile.debug" value="false"/>
<property name="compile.deprecation" value="false"/>
<property name="compile.optimize" value="true"/>
<!-- ==================== All ==================== -->
<target name="all" depends="build"
description="Clean up and build the project"/>
<!-- ==================== Clean ==================== -->
<target name="clean" description="Deletes all generated files and directories">
<delete dir="${basedir}/classes"/>
2016-09-07 12:29:15 +00:00
<delete dir="${basedir}/example-classes"/>
2012-05-21 20:32:26 +00:00
<delete dir="${basedir}/docs"/>
<delete dir="${basedir}/lib"/>
</target>
<!-- ==================== Init ==================== -->
2013-05-23 16:14:48 +00:00
<target name="init" depends="clean" description="Initializes the build">
2012-05-21 20:32:26 +00:00
<tstamp/>
<mkdir dir="${basedir}/classes"/>
2016-09-07 12:29:15 +00:00
<mkdir dir="${basedir}/example-classes"/>
2012-05-21 20:32:26 +00:00
<mkdir dir="${basedir}/docs"/>
<mkdir dir="${basedir}/lib"/>
</target>
<!-- ==================== Compile ==================== -->
<target name="compile" depends="init" description="Compiles the source tree">
2017-06-27 11:43:19 +00:00
<javac target="1.7" source="1.7" srcdir="${source.home}"
2012-05-21 20:32:26 +00:00
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}"
destdir="${basedir}/classes">
<classpath>
<pathelement path="${basedir}/classes"/>
</classpath>
</javac>
</target>
<!-- ==================== Doc ==================== -->
<target name="doc" depends="compile" description="Generates the API specification (javadoc)">
<javadoc packagenames="com.mxgraph.*"
sourcepath="${source.home}"
classpath="${basedir}/classes"
destdir="${basedir}/docs"
use="true"
author="false"
version="false"
windowtitle="${product.name} ${product.version} API Specification"
doctitle="${product.name} ${product.version} API Specification">
<header><![CDATA[<p><b>${product.name} ${product.version}</b></p>]]></header>
2017-06-27 11:43:19 +00:00
<bottom><![CDATA[<font size=1>Copyright (c) 2010-2017 <a href="http://www.jgraph.com/"
target="_blank">Gaudenz Alder, JGraph Ltd</a>. All rights reserved.</font>]]></bottom>
<link href="http://docs.oracle.com/javase/7/docs/api/"/>
2012-05-21 20:32:26 +00:00
</javadoc>
</target>
<!-- ==================== Build ==================== -->
<target name="build" depends="doc" description="Builds all Java archives (JARs)">
<jar jarfile="${basedir}/lib/${all.jar}">
<manifest>
<attribute name="Vendor" value="JGraph Ltd"/>
<attribute name="Bundle-Version" value="${product.version}"/>
<attribute name="Bundle-SymbolicName" value="com.mxgraph"/>
<attribute name="Main-Class" value="com.mxgraph.view.mxGraph"/>
</manifest>
<fileset dir="${source.home}">
<exclude name="**/*.java"/>
</fileset>
<fileset dir="${basedir}/classes">
<include name="com/mxgraph/**"/>
</fileset>
</jar>
<jar jarfile="${basedir}/lib/${core.jar}">
<manifest>
<attribute name="Vendor" value="JGraph Ltd"/>
<attribute name="Bundle-Version" value="${product.version}"/>
<attribute name="Bundle-SymbolicName" value="com.mxgraph"/>
<attribute name="Main-Class" value="com.mxgraph.view.mxGraph"/>
</manifest>
<fileset dir="${source.home}">
<exclude name="com/mxgraph/swing/**"/>
<exclude name="**/*.java"/>
<include name="com/mxgraph/**"/>
</fileset>
<fileset dir="${basedir}/classes">
<exclude name="com/mxgraph/swing/**"/>
<include name="com/mxgraph/**"/>
</fileset>
</jar>
<jar jarfile="${basedir}/lib/${swing.jar}">
<manifest>
<attribute name="Vendor" value="JGraph Ltd"/>
<attribute name="Bundle-Version" value="${product.version}"/>
<attribute name="Bundle-SymbolicName" value="com.mxgraph"/>
</manifest>
<fileset dir="${source.home}">
<include name="com/mxgraph/swing/**"/>
<exclude name="**/*.java"/>
</fileset>
<fileset dir="${basedir}/classes">
<include name="com/mxgraph/swing/**"/>
</fileset>
</jar>
<delete dir="${basedir}/classes"/>
</target>
2016-09-07 12:29:15 +00:00
<!-- ==================== compile-examples ==================== -->
<target name="compile-examples" depends="compile" description="Compiles the examples">
2017-06-27 11:43:19 +00:00
<javac target="1.7" source="1.7"
2016-09-07 12:29:15 +00:00
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}"
destdir="${basedir}/example-classes">
<src path="${example.home}"/>
<src path="${grapheditor.home}"/>
<classpath>
<pathelement path="${basedir}/classes"/>
<pathelement path="${basedir}/example-classes"/>
2017-01-29 09:00:22 +00:00
<pathelement location="${basedir}/jars/mxPdf.jar"/>
2016-09-07 12:29:15 +00:00
<pathelement location="${basedir}/jars/jetty-6.1.1.jar"/>
<pathelement location="${basedir}/jars/jetty-util-6.1.1.jar"/>
<pathelement location="${basedir}/jars/servlet-api-2.5-6.1.1.jar"/>
</classpath>
</javac>
<copy todir="${basedir}/example-classes">
<fileset dir="${example.home}">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<!-- ==================== web-example ==================== -->
<target name="web-example" depends="compile-examples" description="Runs the web example">
<java classname="com.mxgraph.examples.web.Main" dir="${basedir}/.." fork="true">
<classpath>
<pathelement path="${basedir}/classes"/>
<pathelement path="${basedir}/example-classes"/>
2017-01-29 09:00:22 +00:00
<pathelement location="${basedir}/jars/mxPdf.jar"/>
2016-09-07 12:29:15 +00:00
<pathelement location="${basedir}/jars/jetty-6.1.1.jar"/>
<pathelement location="${basedir}/jars/jetty-util-6.1.1.jar"/>
<pathelement location="${basedir}/jars/servlet-api-2.5-6.1.1.jar"/>
</classpath>
</java>
</target>
<!-- ==================== grapheditor ==================== -->
<target name="grapheditor" depends="compile-examples" description="Runs the grapheditor example">
<java classname="com.mxgraph.examples.web.GraphEditor" dir="${basedir}/.." fork="true">
<classpath>
<pathelement path="${basedir}/classes"/>
<pathelement path="${basedir}/example-classes"/>
2017-01-29 09:00:22 +00:00
<pathelement location="${basedir}/jars/mxPdf.jar"/>
2016-09-07 12:29:15 +00:00
<pathelement location="${basedir}/jars/jetty-6.1.1.jar"/>
<pathelement location="${basedir}/jars/jetty-util-6.1.1.jar"/>
<pathelement location="${basedir}/jars/servlet-api-2.5-6.1.1.jar"/>
</classpath>
</java>
</target>
2012-05-21 20:32:26 +00:00
</project>