cleaned up build.xml

This commit is contained in:
josch 2011-01-18 11:44:56 +02:00
parent 50b6a75ccc
commit 4e3a68a38d

104
build.xml
View file

@ -1,7 +1,7 @@
<?xml version = "1.0" encoding = "utf-8"?>
<project name = "sample plugin project" default = "install" basedir = ".">
<project name = "sample plugin project" default = "install" basedir = ".">
<!--
<!--
To run this build file set the environment variable
PROTEGE_HOME to point to a protege distribution and type ant
install or jar.
@ -14,20 +14,9 @@
<property file="local.properties"/>
<!--
**** CHANGE ME ****
This setting defines the name of the plugin.
This may be the only setting that the developer needs to
change.
-->
<property name = "plugin" value = "de.unibremen.informatik.hets"/>
<!--
these properties probably don't need changing
-->
<property name = "src" location = "./src"/>
<property name = "src" location = "./src"/>
<property name = "build" location = "./build"/>
<property name = "bundle.dir" location = "${build}"/>
<property name = "classes" location = "${build}/classes"/>
@ -45,9 +34,8 @@
</tstamp>
<mkdir dir = "${build}"/>
<mkdir dir = "${classes}"/>
<!-- <mkdir dir = "${classes}/lib"/> -->
<mkdir dir = "${genlib}"/>
</target>
</target>
<!-- ============================================================= -->
<!-- Configuring the Compile Classpath -->
@ -65,14 +53,6 @@
<fail message = "missing protege libraries"/>
</target>
<!--
**** CHANGE ME ****
The following target only needs to be modified if the user
needs to change the classpath. It is preconfigured to use
the common protege 4 jars, the lib directory and the
libraries that have been uncovered in buildlibs.
-->
<target name = "checkProtegeLibs" depends="init">
<echo message="Using Protege Home = ${protege.home} to find protege jars"/>
<condition property="libs.found">
@ -80,32 +60,21 @@
<available file="${protege.osgi}" type="file"/>
<available file="${equinox.common}" type = "file"/>
<available file="${equinox.registry}" type = "file"/>
<!-- <available file="${owl.editor.jar}" type = "file"/> -->
<available file="${owl.editor.jar}" type = "file"/>
<available file="${owl.lib}" type="file"/>
</and>
</condition>
<path id = "project.classpath">
<path id = "project.classpath">
<pathelement location="${protege.osgi}"/>
<pathelement location="${protege.lib}"/>
<pathelement location="${equinox.common}"/>
<pathelement location="${equinox.registry}"/>
<pathelement location="${owl.editor.jar}"/>
<pathelement location="${owl.lib}"/>
<!-- <fileset dir="${lib}"/> -->
<fileset dir="${genlib}"/>
</path>
</target>
<!--
**** CHANGE ME ****
The following target only needs to be modified if the
developer needs to obtain some jar files that are contained in
the Protege bundles. The contents of these jar files are
found when Protege 4 runs but may be needed in order to
compile the plugin.
-->
<target name = "buildlibs" depends="checkProtegeLibsAndReport">
<unjar dest="${build}"
src="${common.lib}">
@ -116,18 +85,6 @@
</unjar>
</target>
<!--
**** CHANGE ME ****
Here is the copy.resources target. It may need modification
to copy the right resources into the classes directory. By
default it already copies non-java files found in the source
directory, the libraries needed by the project and the
viewconfig and the plugin.xml. This will be sufficient in
many cases.
-->
<target name="copy.resources" depends="build.manifest">
<copy todir="${classes}">
<fileset dir="${src}">
@ -137,27 +94,18 @@
<exclude name="**/manifest.mf"/>
</fileset>
</copy>
<!-- <copy todir="${classes}/lib">
<fileset dir="${lib}" excludes="junit*.jar"/>
</copy> -->
<copy todir="${classes}">
<fileset dir="." includes="*.xml">
<exclude name="build.xml"/>
</fileset>
</copy>
<!-- the manifest doesn't belong here but this is good for IDE's -->
<mkdir dir="${classes}/META-INF"/>
<copy todir="${classes}/META-INF"
<mkdir dir="${classes}/META-INF"/>
<copy todir="${classes}/META-INF"
file = "${manifest}"/>
</target>
<!--
It is less likely that the developer will want to make changes
below this line
-->
<!-- ============================================================= -->
<target name = "jjtree">
<jjtree target="./src/de/unibremen/informatik/hets/grammar/HetCASLGrammar.jjt"
outputdirectory="./src/de/unibremen/informatik/hets/grammar/"
@ -174,17 +122,17 @@
<target name = "compile" depends = "buildlibs, checkProtegeLibsAndReport, javacc">
<javac srcdir = "${src}"
destdir = "${classes}"
destdir = "${classes}"
debug="on"
includeAntRuntime="false">
<classpath refid = "project.classpath"/>
<classpath refid = "project.classpath"/>
</javac>
</target>
<target name="build.manifest">
<copy tofile="${manifest}"
<copy tofile="${manifest}"
file="META-INF/MANIFEST.MF" overwrite="true"/>
<manifest file="${manifest}"
<manifest file="${manifest}"
mode = "update">
<attribute name="Built-By" value = "${user.name}"/>
<attribute name="Build-Date" value = "${build.time}"/>
@ -193,7 +141,7 @@
<target name = "jar" depends = "compile, copy.resources">
<jar jarfile = "${build}/${plugin}.jar"
basedir = "${classes}"
basedir = "${classes}"
manifest = "${build}/manifest.mf"/>
</target>
@ -201,15 +149,16 @@
<!-- flush cache -->
<delete dir = "${protege.home}/configuration/org.eclipse.core.runtime"/>
<delete dir = "${protege.home}/configuration/org.eclipse.osgi"/>
<copy file="${build}/${plugin}.jar"
<copy file="${build}/${plugin}.jar"
todir = "${protege.plugins}"
overwrite = "true"/>
</target>
<target name = "run" depends="install">
<java fork = "true"
dir = "${protege.home}"
jar = "${protege.osgi}">
<java dir = "${protege.home}"
classname = "org.protege.osgi.framework.Launcher"
classpath = "${protege.osgi}:${protege.launcher}"
fork="true">
<jvmarg value = "-Dfile.encoding=UTF-8"/>
<jvmarg value = "-Xmx500M"/>
<jvmarg value = "-Dlog4j.configuration=file:log4j.xml"/>
@ -217,13 +166,13 @@
</target>
<target name = "debug" depends="install">
<java fork = "true"
dir = "${protege.home}"
<java fork = "true"
dir = "${protege.home}"
jar = "${protege.osgi}">
<jvmarg value = "-Xmx500M"/>
<jvmarg value = "-Dlog4j.configuration=file:log4j.xml"/>
<jvmarg value = "-Dfile.encoding=UTF-8"/>
<jvmarg value = "-Xrunjdwp:transport=dt_socket,address=8500,server=y,suspend=y"/>
<jvmarg value = "-Xrunjdwp:transport=dt_socket,address=8500,server=y,suspend=y"/>
</java>
</target>
@ -243,15 +192,11 @@
<echo message = "debug - install the plugin and start protege for debug"/>
</target>
<!--
Standard properties that should not require changing
-->
<property name="equinox.common"
<property name="equinox.common"
location="${protege.common}/org.eclipse.equinox.common.jar"/>
<property name="equinox.registry"
location="${protege.common}/org.eclipse.equinox.registry.jar"/>
<property name="protege.lib"
<property name="protege.lib"
location="${protege.common}/org.protege.editor.core.application.jar"/>
<property name="common.lib"
location="${protege.common}/org.protege.common.jar"/>
@ -261,7 +206,4 @@
<property name="owl.editor.jar"
location="${protege.plugins}/org.protege.editor.owl.jar"/>
</project>