diff --git a/etc/anttasks.xml b/etc/anttasks.xml new file mode 100644 index 0000000000000000000000000000000000000000..a2035d59f811636b86e83c9e00cd67c2f7afb3ff --- /dev/null +++ b/etc/anttasks.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="anttasks" default="build"> + + +<!-- ant-contribs --> +<taskdef resource="net/sf/antcontrib/antlib.xml"> + <classpath> + <pathelement location="${path.libs}/ant/ant-contrib-1.0b3.jar"/> + </classpath> +</taskdef> + +<!-- BND tool --> +<taskdef resource="aQute/bnd/ant/taskdef.properties"> + <classpath> + <pathelement location="${path.libs}/ant/bnd-0.0.378.jar"/> + </classpath> +</taskdef> + +<!-- Set the log level --> +<taskdef name="setloglevel" + classname="de.berkom.ehome.tools.ant.setloglevel.SetLogLevel" + classpath="${path.libs}/ant/antSetLogLevel.jar"/> + +<!-- Ant Thinlet Dialog --> +<taskdef name="dialog" + classname="de.berkom.ehome.tools.ant.dialog.Dialog" + classpath="${path.libs}/ant/antDialog.jar"/> + +<!-- SVN Library --> +<taskdef resource="org/tigris/subversion/svnant/svnantlib.xml"> + <classpath> + <pathelement location="${path.libs}/ant/svnant.jar"/> + <pathelement location="${path.libs}/ant/svnClientAdapter.jar"/> + <pathelement location="${path.libs}/ant/svnjavahl.jar"/> + </classpath> +</taskdef> + +</project> + diff --git a/etc/common.xml b/etc/common.xml new file mode 100644 index 0000000000000000000000000000000000000000..87a562f7463792aa28f97bf9f4376f7c1c529e3a --- /dev/null +++ b/etc/common.xml @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="imported" default="build"> + +<!-- TODOs + + * genjar integration + * if no manifest is available include a defalt one from etc? +--> + + +<property name="path.libs" location="${basedir}/../../libs" /> + +<!-- Load various tasks --> +<import file="anttasks.xml" /> + +<!-- Unset the _mainbuild property --> +<var name="_mainbuild" unset="true" /> + +<!-- Load the properties --> +<import file="properties.xml" /> + + +<!-- Load all the actual tasks --> +<import file="tasks/all.xml" /> +<import file="tasks/allforced.xml" /> +<import file="tasks/build.xml" /> +<import file="tasks/buildjar.xml" /> +<import file="tasks/clean.xml" /> +<import file="tasks/collect.xml" /> +<import file="tasks/compile.xml" /> +<import file="tasks/compilenative.xml" /> +<import file="tasks/doc.xml" /> +<import file="tasks/eclipse.xml" /> + +<import file="tasks/_addPrivateLibs.xml" /> +<import file="tasks/_buildNative.xml" /> +<import file="tasks/_checkDependentProjects.xml" /> +<import file="tasks/_cleanDependentProjects.xml" /> +<import file="tasks/_getBuildNumber.xml" /> +<import file="tasks/_handleProjectProperties.xml" /> +<import file="tasks/_includeExternalResourcesInJar.xml" /> +<!-- <import file="tasks/_importManifest.xml" /> --> +<import file="tasks/_prepare.xml" /> +<import file="tasks/_preparebuild.xml" /> +<import file="tasks/_setClassPath.xml" /> + + +</project> diff --git a/etc/default.properties b/etc/default.properties new file mode 100644 index 0000000000000000000000000000000000000000..6c1e9ad0f26632f0d0c7375c229a08b02eef79e0 --- /dev/null +++ b/etc/default.properties @@ -0,0 +1,124 @@ +# Default Properties for the Ant make system +# + +# +# Default libraries. +# Update accordingly if another library becomes the system's default library +# + +default.lib.cdc.foundation.1.1=cdc/foundation/1.1/classes.zip + +default.lib.osgi.core.2.0=osgi/framework/2.0/osgi.jar +default.lib.osgi.cmpn.2.0=osgi/framework/2.0/osgi.jar + +default.lib.osgi.core.3.0=osgi/framework/3.0/osgi.jar +default.lib.osgi.cmpn.3.0=osgi/framework/3.0/osgi.jar + +default.lib.osgi.core.4.0=osgi/core/4.0/osgi.core.jar +default.lib.osgi.core.4.1=osgi/core/4.1/osgi.core.jar +default.lib.osgi.core.4.2=osgi/core/4.2/osgi.core.jar +default.lib.osgi.core=osgi/core/4.2/osgi.core.jar + +default.lib.osgi.cmpn.4.0=osgi/cmpn/4.0/osgi.compendium.jar +default.lib.osgi.cmpn.4.1=osgi/cmpn/4.1/osgi.cmpn.jar +default.lib.osgi.cmpn.4.2=osgi/cmpn/4.2/osgi.cmpn.jar +default.lib.osgi.cmpn=osgi/cmpn/4.2/osgi.cmpn.jar + +default.lib.osgi.dmt.1.0=osgi/info/1.0/dmt.jar +default.lib.osgi.dmt.2.0=osgi/info/2.0/org.osgi.impl.service.dmt.jar +default.lib.osgi.dmt=osgi/info/2.0/org.osgi.impl.service.dmt.jar + + +default.lib.mail.1.4.prosyst=javax/mail/1.4-prosyst/mail.jar +default.lib.mail=javax/mail/1.4-prosyst/mail.jar + +default.lib.activation.1.1.prosyst=javax/activation/1.1-prosyst/activation.jar +default.lib.activation=javax/activation/1.1-prosyst/activation.jar + +default.lib.j2ee.1.3.1=javax/j2ee/1.3.1/j2ee.jar +default.lib.j2ee=javax/j2ee/1.3.1/j2ee.jar + +# - Servlet APIs --------------------------------------------------------------- +# +# With the addition of the SIP-Servlet API, and it's dependency on newer +# version of the Servlet API, I thought names matching the Sun package +# structure would be clearer. Kept the old definition as well. + +default.lib.servlet.2.3.1=javax/servlet/2.3.1/servlet.jar +default.lib.servlet=javax/servlet/2.3.1/servlet.jar + +default.lib.javax.servlet.2.3.1=javax/servlet/2.3.1/servlet.jar +default.lib.javax.servlet.2.4=javax/servlet/2.4/servlet.jar +default.lib.javax.servlet.2.5=javax/servlet/2.5/servlet.jar +default.lib.javax.servlet.3.0.1=javax/servlet/3.0.1/servlet.jar +default.lib.javax.servlet=javax/servlet/2.3.1/servlet.jar + +default.lib.javax.sip.servlet.1.1=javax/servlet/sip/1.1/sip-servlet.jar +default.lib.javax.sip.servlet=javax/servlet/sip/1.1/sip-servlet.jar + +# ------------------------------------------------------------------------------ + +default.lib.log4j=apache/log4j/1.2.4/log4j-1.2.4.jar + +default.lib.jgraph=jgraph/5.12.0.4/jgraph.jar + +default.lib.thinlet.20031012=thinlet/20031012/thinlet.jar +default.lib.thinlet.20050328=thinlet/20050328/thinlet.jar +default.lib.thinlet.20070222=thinlet/20070222/thinlet.jar +default.lib.thinlet=thinlet/20070222/thinlet.jar + +default.lib.id3tag=id3tag/id3t.jar +default.lib.xmlrpc=prosyst/xmlrpc/xmlrpc.jar + +# - CDC/Foundation Extensions ------------------------------------------------- + +default.lib.cdc.foundationx.j9jsse=cdc/foundationx/j9jsse/2.4/j9jsse.jar + +# ----------------------------------------------------------------------------- +# Note: We should not require dependencies on the ProSyst HTTPS Handler! + +default.lib.httpshdlr=prosyst/httpshdlr.jar + +default.lib.ksoap2=ksoap2/ksoap2-j2se-full-2.1.0.jar +default.lib.kxml=ksoap2/kxml2-2.3.0.jar + + +# ----------------------------------------------------------------------------- +default.lib.xmlrpc=xmlrpc/xmlrpc-1.1.1.jar + +# ----------------------------------------------------------------------------- + +# +# Default version number +# (I'm wondering whether anybody will set this in his build properties) +# +version=1.0.0 + +# +# The default Manifest file. +# This might change if we adopt the bnd tool +# +manifest=etc/Manifest.mf + +# +# Add a build number to the resulting jar file. +# The file "build.number" in the root directory of each project contains the latest build number. +# Default: The value "none" means that no build number is appended. +# +buildnumber=none + +# +# Set the loglevel. +# Possible loglevel: debug,verbose,info (the ant default), warning, error +# Default is warning, which is rather quiet. +# +loglevel=warning + + +# +# Enable lint (all recommend warnings) +# Possible values: true, false +# Default: false +# +uselint=false + diff --git a/etc/properties.xml b/etc/properties.xml new file mode 100644 index 0000000000000000000000000000000000000000..33fd7df9a0871c9ddb476aa7a6179a307589e4ee --- /dev/null +++ b/etc/properties.xml @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="properties" default="build"> + +<!-- Set the default project name to the name of the directory --> +<propertyregex override="yes" + property="projectname" + input="${basedir}" + regexp=".*[/\\]([^/\\]*)" + select="\1" /> + +<!-- A couple of constants --> +<property name="path.base" location="${basedir}/../.." /> +<property name="path.libs" location="${path.base}/libs" /> +<property name="path.etc" location="${path.base}/etc" /> +<property name="path.genbase" location="${path.base}/gen" /> +<property name="path.gen" location="${path.genbase}/projects/${projectname}" /> +<property name="path.gen.classes" location="${path.gen}/classes" /> +<property name="path.gen.etc" location="${path.gen}/etc" /> +<property name="path.gen.docbase" location="${path.genbase}/docs" /> +<property name="path.gen.documentation" location="${path.gen.docbase}/${projectname}" /> +<property name="path.gen.collection" location="${path.genbase}/collection" /> +<property name="path.gen.domain" location="${path.genbase}/domains" /> +<property name="path.src" location="${basedir}/src" /> +<property name="path.resources" location="${basedir}/resources" /> +<property name="path.native" location="${basedir}/native" /> +<property name="path.gen.native" location="${path.gen}/native" /> +<property name="path.gen.classpathfile" location="${path.gen.etc}/_classpath" /> +<property name="path.gen.includecmdfile" location="${path.gen.etc}/_jarinclude.xml" /> +<property name="path.gen.importmanifestcmdfile" location="${path.gen.etc}/_manifestimport.xml" /> +<property name="path.etc.localfile" location="${path.base}/etc/local.xml" /> +<property name="path.eclipse.classpathfile" location="${basedir}/.classpath" /> +<property name="path.eclipse.projectfile" location="${basedir}/.project" /> +<property name="path.eclipse.settingsdir" location="${basedir}/.settings" /> +<property name="path.eclipse.settingsfile" location="${path.eclipse.settingsdir}/org.eclipse.jdt.core.prefs" /> + + + +<!-- The following tasks only need to be executed when this file is not included from the main build file --> +<if><not> + <isset property="_mainbuild" /> + </not> + <then> + <!-- Unset the java.target and java.source properties --> + <var name="java.target" unset="true" /> + <var name="java.source" unset="true" /> + + <!-- Load project specific properties from local properties file --> + <loadproperties srcFile="properties" /> + + <!-- Load project specific properties from local properties file --> + <loadproperties srcFile="../../etc/default.properties" /> + + <!-- Set the start loglevel --> + <setloglevel level="${loglevel}" /> + + </then> +</if> + +<!-- Define the path to additional Java jar files for the scriptdef and similar tasks --> +<path id="antscripting"> + <fileset dir="${path.libs}/ant/scripting" includes="*.jar" /> +</path> + + +<!-- set the default Java source and target formats to the local versions --> +<if><not> + <isset property="java.source" /> + </not> + <then> + <var name="java.source" value="${ant.java.version}" /> + </then> +</if> +<if><not> + <isset property="java.target" /> + </not> + <then> + <var name="java.target" value="${ant.java.version}" /> + </then> +</if> + + +<!-- load local properties, if the file exists --> +<available property="available.local" file="${path.etc.localfile}"/> +<if><isset property="available.local" /> + <then> + <import file="${path.etc.localfile}" /> + </then> +</if> + + +</project> diff --git a/etc/tasks/_addPrivateLibs.xml b/etc/tasks/_addPrivateLibs.xml new file mode 100644 index 0000000000000000000000000000000000000000..b6a4fcad28e10ae82d353881e8433be9c4513be7 --- /dev/null +++ b/etc/tasks/_addPrivateLibs.xml @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="_addPrivateLibs" default="build"> + + +<!-- INTERNAL: _addPrivateLibs + Check, whether there are privare jars that should be added to the classpath. + Those must be located under resouces/libs or libs in the project directory. + Note that jars under resources/libs will be included in the resulting jar. +--> +<target name="_addPrivateLibs"> + <!-- look for jar files in the projects resources libs directory --> + <path id="idPrivatelibs"> + <fileset dir="resources/libs"> + <include name="*.jar" /> + </fileset> + </path> + + <trycatch> + <try> + <!-- try to access the private jars. If those don't exist, the following code is *not* executed --> + <var name="tmp" value="${toString:idPrivatelibs}" /> + <!-- add them to the classpath file --> + <for list="${tmp}" delimiter=":" param="jfile"> + <sequential> + <propertyregex override="yes" + property="tmp" + input="@{jfile}" + regexp=".*[/\\]([^/\\]*)" + select="\1" /> + <echo file="${path.gen.classpathfile}" append="true">projects/${projectname}/resources/libs/${tmp}${line.separator}</echo> + </sequential> + </for> + </try> + <catch> + <!-- if no lib available then do nothing --> + </catch> + </trycatch> + + + <path id="idPrivateExternallibs"> + <fileset dir="libs"> + <include name="*.jar" /> + </fileset> + + </path> + + <trycatch> + <try> + <!-- try to access the private jars. If those don't exist, the following code is *not* executed --> + <var name="tmp" value="${toString:idPrivateExternallibs}" /> + <!-- add them to the classpath file --> + <for list="${tmp}" delimiter=":" param="jfile"> + <sequential> + <propertyregex override="yes" + property="tmp" + input="@{jfile}" + regexp=".*[/\\]([^/\\]*)" + select="\1" /> + <echo file="${path.gen.classpathfile}" append="true">projects/${projectname}/libs/${tmp}${line.separator}</echo> + </sequential> + </for> + </try> + <catch> + <!-- if no lib available then do nothing --> + </catch> + </trycatch> + +</target> + +</project> diff --git a/etc/tasks/_buildNative.xml b/etc/tasks/_buildNative.xml new file mode 100644 index 0000000000000000000000000000000000000000..2d03b5dea4c6dcdeb9937d8060f4dcfb1bf758fc --- /dev/null +++ b/etc/tasks/_buildNative.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="_buildNative" default="build"> + +<!-- INTERNAL: _buildNative + Build all native code +--> + +<target name="_buildNative"> + <!-- is there a directory for native code? --> + <available property="available.native" file="${path.native}" type="dir"/> + <if><isset property="available.native" /> + <then> + + <!-- check whether ${prog.make} is set --> + <if> <isset property="prog.make" /> + <then> + + <!-- it is set, so go all the directories unter "native" and execute the Makefile --> + <path id="idNativeDirs"> + <dirset dir="${path.native}"> + <include name="*" /> + </dirset> + </path> + + <!-- iterate over all directories and call the makefile --> + <var name="tmp" value="${toString:idNativeDirs}" /> + <for list="${tmp}" delimiter=":" param="ndir"> + <sequential> + <available property="available.native.makefile" file="@{ndir}/Makefile" /> + <if><isset property="available.native.makefile" /> + <then> + <echo>@{ndir}/Makefile</echo> + + <!-- <exec executable="/usr/bin/make" + failonerror="false" + failifexecutionfails="false" + resultproperty="myStatus" + errorproperty="/tmp/error.out" + outputproperty="/tmp/foo.out" + error="/tmp/error.txt" + output="/tmp/output.txt"/> + --> + + </then> + <else> + <echo>No "Makefile" found. Please check the check (note the upper-case M).</echo> + </else> + </if> + <echo>@{ndir}</echo> + </sequential> + </for> + </then> + <else> + <echo>Property "prog.make" not set. Native Builds are ignored.</echo> + </else> + </if> + + + + + </then> + </if> +</target> + +</project> diff --git a/etc/tasks/_checkDependentProjects.xml b/etc/tasks/_checkDependentProjects.xml new file mode 100644 index 0000000000000000000000000000000000000000..6ad985573a996e31702c7a2fd60610f9a5b0bd0f --- /dev/null +++ b/etc/tasks/_checkDependentProjects.xml @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="_checkDependentProjects" default="build"> + +<!-- INTERNAL: _checkDependentProjects + Check whether there are dependencies to other projects and build them if necessary. +--> +<target name="_checkDependentProjects"> + <if><and> + <isset property="dependency.projects" /> + <length string="${dependency.projects}" trim="true" when="greater" length="0" /> + </and> + <then> + <!-- go through all dependent projects --> + <for list="${dependency.projects}" param="pname"> + <sequential> + <available property="available.dir.@{pname}" file="../@{pname}" /> + <available property="available.gen.@{pname}" file="../../gen/projects/@{pname}" /> + + <!-- does the project exist at all? --> + <if><isset property="available.dir.@{pname}" /> + <then> + <!-- look for jar files in the according project's gen directory --> + <path id="x"> + <fileset dir="../../gen/projects/@{pname}"> + <include name="*.jar" /> + </fileset> + </path> + + <trycatch> + <try> + <echo>Checking dependent project "@{pname}"</echo> + <var name="tmp" value="${toString:x}" /> + <if><isset property="dependency.projects.forcebuild" /> + <then> + <echo>Building dependent project "@{pname}" (forced)</echo> + <if><isset property="global.build" /> <!-- inheriting global.build property, if set --> + <then> + <ant dir="../@{pname}" inheritall="false" antfile="../@{pname}/build.xml" target="all"> + <property name="global.build" value="true" /> + </ant> + </then> + <else> + <ant dir="../@{pname}" inheritall="false" antfile="../@{pname}/build.xml" target="all" /> + </else> + </if> + </then> + </if> + </try> + <catch> + <!-- if no jar file available, build the project --> + <echo>Building dependent project "@{pname}"</echo> + <if><isset property="global.build" /> <!-- inheriting global.build property, if set --> + <then> + <ant dir="../@{pname}" inheritall="false" antfile="../@{pname}/build.xml" > + <property name="global.build" value="true" /> + </ant> + </then> + <else> + <ant dir="../@{pname}" inheritall="false" antfile="../@{pname}/build.xml" /> + </else> + </if> + </catch> + </trycatch> + + <!-- and try again --> + <trycatch> + <try> + <var name="tmp" value="${toString:x}" /> + <echo>Dependent project "@{pname}": ok</echo> + <for list="${tmp}" delimiter=":" param="jfile"> + <sequential> + <!--echo file="${path.gen.classpathfile}" append="true">@{jfile}${line.separator}</echo--> + <propertyregex override="yes" + property="tmp" + input="@{jfile}" + regexp=".*[/\\]([^/\\]*)" + select="\1" /> + <echo file="${path.gen.classpathfile}" append="true">gen/projects/@{pname}/${tmp}${line.separator}</echo> + </sequential> + </for> + </try> + <catch> + <fail>.${line.separator}${line.separator}Can't resolve dependency to project "@{pname}". Aborting.${line.separator}Perhaps that project was not build (check the property 'gobal.build.ignore').</fail> + </catch> + </trycatch> + </then> + </if> + </sequential> + </for> + </then> + </if> +</target> + + +</project> diff --git a/etc/tasks/_cleanDependentProjects.xml b/etc/tasks/_cleanDependentProjects.xml new file mode 100644 index 0000000000000000000000000000000000000000..851233972d0b0a7bc1cc7f91ba6d43aa131e2a75 --- /dev/null +++ b/etc/tasks/_cleanDependentProjects.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="_cleanDependentProjects" default="build"> + +<!-- INTERNAL: _cleanDependentProjects + Check whether there are dependencies to other projects and clean them. +--> +<target name="_cleanDependentProjects"> + <if><and> + <isset property="dependency.projects" /> + <length string="${dependency.projects}" trim="true" when="greater" length="0" /> + </and> + <then> + <!-- go through all dependent projects --> + <for list="${dependency.projects}" param="pname"> + <sequential> + <available property="available.dir.@{pname}" file="../@{pname}" /> + + <!-- does the project exist at all? --> + <if><isset property="available.dir.@{pname}" /> + <then> + <echo>Cleaning dependent project "@{pname}"</echo> + <var name="tmp" value="${toString:x}" /> + <if><isset property="global.build" /> <!-- inheriting global.build property, if set --> + <then> + <ant dir="../@{pname}" inheritall="false" antfile="../@{pname}/build.xml" target="clean"> + <property name="global.build" value="true" /> + </ant> + </then> + <else> + <ant dir="../@{pname}" inheritall="false" antfile="../@{pname}/build.xml" target="clean" /> + </else> + </if> + </then> + </if> + </sequential> + </for> + </then> + </if> +</target> + + +</project> diff --git a/etc/tasks/_getBuildNumber.xml b/etc/tasks/_getBuildNumber.xml new file mode 100644 index 0000000000000000000000000000000000000000..ea24ad5ffa9e8948cdb09abf0d2ef28d4bbf535b --- /dev/null +++ b/etc/tasks/_getBuildNumber.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="_getBuildNumber" default="build"> + + +<!-- INTERNAL: _getBuildNumber + Add the build number to the jar file name, if necessary. +--> +<target name="_getBuildNumber"> + <if><and> + <isset property="buildnumber" /> + <not> + <equals arg1="${buildnumber}" arg2="none" /> + </not> + </and> + <then> + <buildnumber /> + <propertyregex property="tmp" + override="true" + input="${file.jar}" + regexp="(.*).jar" + select="\1" /> + + <var name="file.jar" value="${tmp}-${build.number}.jar" /> + </then> + </if> + +</target> + +</project> diff --git a/etc/tasks/_handleProjectProperties.xml b/etc/tasks/_handleProjectProperties.xml new file mode 100644 index 0000000000000000000000000000000000000000..4bccaa8b7d14da65300543fb336a4f48e54f6ce5 --- /dev/null +++ b/etc/tasks/_handleProjectProperties.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="_handleProjectProperties" default="build"> + +<!-- INTERNAL: _handleProjectProperties + Calculate and the project properties +--> +<target name="_handleProjectProperties"> + + <!-- go through all properties that start with "dependency.lib." --> + <propertyselector property="libs.list" + override="yes" + delimiter="," + match="^dependency\.lib\.(.*)" + select="\1" + casesensitive="false" /> + <if><isset property="libs.list" /> + <then> + <for list="${libs.list}" param="lib.id"> + <sequential> + <propertycopy override="yes" name="lib.name" from="dependency.lib.@{lib.id}" /> + <!-- echo message="@{lib.id}" / --> + + <!-- check whether the value is empty. In this case the globally configured value is assigned to the property so that it is not blank anymore --> + <if><length string="${lib.name}" trim="true" when="equal" length="0" /> + <then> + <var name="dependency.lib.@{lib.id}" value="${default.lib.@{lib.id}}" /> + </then> + </if> + <echo file="${path.gen.classpathfile}" append="true">libs/${dependency.lib.@{lib.id}}${line.separator}</echo> + </sequential> + </for> + </then> +<!-- + <else> + <echo file="${path.gen.classpathfile}" append="true"></echo> + </else> +--> + </if> + + + <!-- build the name for the jar file --> + <var name="tmp" value="${projectname}" /> + <if><isset property="jarbase" /> + <then> + <var name="tmp" value="${jarbase}" /> + </then> + </if> + + <!-- append verson number if it is not empty --> + <if><isset property="version" /> + <then> + <if><and> + <length string="${version}" trim="true" when="greater" length="0" /> + <not> + <equals arg1="${version}" arg2="none" trim="true" /> + </not> + </and> + <then> + <var name="tmp" value="${tmp}-${version}" /> + </then> + </if> + </then> + </if> + <var name="file.jar" value="${path.gen}/${tmp}.jar" /> +</target> + +</project> diff --git a/etc/tasks/_importManifest.xml b/etc/tasks/_importManifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..84097da891db3231afeb57446521dc25d37f2c1f --- /dev/null +++ b/etc/tasks/_importManifest.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="_importManifest" default="build"> + +<!-- BAUSTELLE --> + + + + + + +<!-- INTERNAL: _importManifest + Import the Manifest from another jar (in lib or from another project). +--> +<target name="_importManifest"> + <!-- Build an external build file to add the content to the jar file --> + <echo file="${path.gen.importmanifestcmdfile}" append="true"><project name="runimportmanifest" default="_runimportmanifest">${line.separator}</echo> + <echo file="${path.gen.importmanifestcmdfile}" append="true"><target name="_runimportmanifest">${line.separator}</echo> + <propertyselector property="manifestlib" + override="yes" + delimiter="," + match="^importmanifest\.lib\.(.*)" + select="\1" + casesensitive="false" /> + <if><isset property="manifestlib" /> + <then> + <echo file="${path.gen.importmanifestcmdfile}" append="true"><zip destfile="${file.jar}" update="true">${line.separator}</echo> + <propertycopy name="fs.src" from="default.lib.${manifestlib}" override="yes" /> + <var name="fs.src" value="${path.libs}/${fs.src}" /> + <echo file="${path.gen.importmanifestcmdfile}" append="true"><zipfileset src="${fs.src}" includes="META-INF/MANIFEST.MF" />${line.separator}</echo> + <echo file="${path.gen.importmanifestcmdfile}" append="true"></zip>${line.separator}</echo> + </then> + </if> + + + <echo file="${path.gen.importmanifestcmdfile}" append="true"></target>${line.separator}</echo> + <echo file="${path.gen.importmanifestcmdfile}" append="true"></project>${line.separator}</echo> + + + <!-- run the generates build file --> + <ant antfile="${path.gen.importmanifestcmdfile}" target="_runimportmanifest" inheritAll="true" /> + +</target> + +</project> diff --git a/etc/tasks/_includeExternalResourcesInJar.xml b/etc/tasks/_includeExternalResourcesInJar.xml new file mode 100644 index 0000000000000000000000000000000000000000..b03ab105d4fae133c4604c02c546f4f417a785b5 --- /dev/null +++ b/etc/tasks/_includeExternalResourcesInJar.xml @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="_includeExternalResourcesInJar" default="build"> + +<!-- INTERNAL: _includeExternalResourcesInJar + Check, whether there should resources from other jar files be included. + Generate an external build file and execute it in order to add the files. +--> +<target name="_includeExternalResourcesInJar"> + <!-- go through all properties that start with "include." --> + <propertyselector property="include.list" + override="yes" + delimiter="," + match="^include\.(.*)" + select="\1" + casesensitive="false" /> + <if><isset property="include.list" /> + <then> + + <!-- Build an external build file to add the content to the jar file --> + <echo file="${path.gen.includecmdfile}" append="true"><project name="runzipinclude" default="_runzipinclude">${line.separator}</echo> + <echo file="${path.gen.includecmdfile}" append="true"><target name="_runzipinclude">${line.separator}</echo> + <echo file="${path.gen.includecmdfile}" append="true"><jar destfile="${file.jar}" update="true">${line.separator}</echo> + + <for list="${include.list}" param="include.id"> + <sequential> + <propertycopy override="yes" name="include.value" from="include.@{include.id}" /> + <var name="include.iszipfileset" value="true" /> + + + <!-- check whether the include is from a lib or generated project file --> + <if><matches string="include.@{include.id}" pattern="^include\.lib.\.*" /> + <then> <!-- lib --> + <propertyregex property="include.libname" + override="yes" + input="include.@{include.id}" + regexp="^include\.(.*)" + select="\1" + casesensitive="false" /> + <propertycopy name="fs.src" from="default.${include.libname}" override="yes" /> + <var name="fs.src" value="${path.libs}/${fs.src}" /> + </then> + <else> + + <!-- check whether the include is from a gen/resources directory --> + <if><matches string="include.@{include.id}" pattern="^include\.gen\.resources" /> + <then> + <var name="fs.src" value="${path.gen}" /> + <var name="include.iszipfileset" value="false" /> + </then> + <else> + + <!-- include from a project --> + <propertyregex property="include.libname" + override="yes" + input="include.@{include.id}" + regexp="^include\.project\.(.*)" + select="\1" + casesensitive="false" /> + + <path id="x"> + <fileset dir="../../gen/projects/${include.libname}"> + <include name="*.jar" /> + </fileset> + </path> + <var name="fs.src" value="${toString:x}" /> + </else> + </if> + </else> + </if> + + <if><length string="${include.value}" trim="true" when="equal" length="0" /> + <then> + <var name="fs.includes" value="**/*" /> + </then> + <else> + <var name="fs.includes" value="${include.value}" /> + </else> + </if> + + + <if><equals arg1="${include.iszipfileset}" arg2="true"/> + <then> + <echo file="${path.gen.includecmdfile}" append="true"><zipfileset src="${fs.src}" includes="${fs.includes}" />${line.separator}</echo> + </then> + <else> + <echo file="${path.gen.includecmdfile}" append="true"><fileset dir="${fs.src}" includes="${fs.includes}" />${line.separator}</echo> + </else> + </if> + + </sequential> + </for> + + <echo file="${path.gen.includecmdfile}" append="true"></jar>${line.separator}</echo> + <echo file="${path.gen.includecmdfile}" append="true"></target>${line.separator}</echo> + <echo file="${path.gen.includecmdfile}" append="true"></project>${line.separator}</echo> + + + <!-- run the generates build file --> + <ant antfile="${path.gen.includecmdfile}" target="_runzipinclude" inheritAll="true" /> + </then> + </if> + +</target> + +</project> diff --git a/etc/tasks/_prepare.xml b/etc/tasks/_prepare.xml new file mode 100644 index 0000000000000000000000000000000000000000..0658dffe73ee7c1cd0a61127db64d3c51dae9238 --- /dev/null +++ b/etc/tasks/_prepare.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="_prepare" default="build"> + +<!-- TASK: _prepare + Set properties, generate the classpath etc +--> +<target name="_prepare"> + <!-- initialize the build.time property --> + <tstamp /> + <tstamp> + <format property="build.time" pattern="dd.MM.yyyy HH:mm:ss" /> + </tstamp> + + <!-- Retrieve the subversion property --> + <trycatch> + <try> + <svn> + <status path="${basedir}" revisionProperty="svn.revision" /> + </svn> + </try> + <catch> + <property name="svn.revision" value="svn.revision.undefined" /> + <echo>Cannot determine SVN revision. SVN not found?</echo> + </catch> + </trycatch> + + <mkdir dir="${path.genbase}" /> + <mkdir dir="${path.gen}" /> + <mkdir dir="${path.gen.classes}" /> + <mkdir dir="${path.gen.documentation}" /> + <mkdir dir="${path.gen.etc}" /> + <mkdir dir="${path.gen.docbase}" /> + <mkdir dir="${path.gen.documentation}" /> + <mkdir dir="${path.gen.collection}" /> + <mkdir dir="${path.gen.domain}" /> + + <!-- remove old help files --> + <delete file="${path.gen.classpathfile}"/> + <delete file="${path.gen.includecmdfile}"/> + <delete file="${path.gen.importmanifestcmdfile}"/> + + <runtarget target="_handleProjectProperties" /> + + + <!-- make the directory for the domain --> + <if> + <isset property="omain" /> + <then> + <mkdir dir="${path.gen.domain}/${omain}" /> + </then> + </if> + + +</target> + +</project> diff --git a/etc/tasks/_preparebuild.xml b/etc/tasks/_preparebuild.xml new file mode 100644 index 0000000000000000000000000000000000000000..3df6082e757a557c57d0f6745267406549845467 --- /dev/null +++ b/etc/tasks/_preparebuild.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="_preparebuild" default="build"> + +<!-- INTERNAL: _preparebuild + Does preparations that are only necessary in case of a build +--> +<target name="_preparebuild"> + <runtarget target="_checkDependentProjects" /> + <runtarget target="_addPrivateLibs" /> +</target> + +</project> diff --git a/etc/tasks/_setClassPath.xml b/etc/tasks/_setClassPath.xml new file mode 100644 index 0000000000000000000000000000000000000000..bebe50b7a56ed333822a6048494eec68485c3c3f --- /dev/null +++ b/etc/tasks/_setClassPath.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="_setClassPath" default="build"> + +<!-- INTERNAL: _setClassPath + Set the internal classpath for building the project by reading from the classpathfile, or empty. +--> +<target name="_setClassPath"> + <!-- set the classpath from the file, only when the _classpathfile exists. Otherwise define an empty path element --> + <available property="available.classpathfile" file="${path.gen.classpathfile}" /> + <if><isset property="available.classpathfile" /> + <then> + <path id="id.libraries"> + <!--fileset dir="${path.base}" includesfile="${path.gen.classpathfile}" excludes="**/*"/ --> + <fileset dir="${path.base}" includesfile="${path.gen.classpathfile}" /> + </path> + </then> + <else> + <path id="id.libraries"> + </path> + </else> + </if> +</target> + +</project> diff --git a/etc/tasks/all.xml b/etc/tasks/all.xml new file mode 100644 index 0000000000000000000000000000000000000000..1859e09fe7bcc18b5f7f726bfdddb056976c2958 --- /dev/null +++ b/etc/tasks/all.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="all" default="build"> + +<!-- TASK: all + Clean up, build and collect +--> +<target name="all"> + <runtarget target="clean" /> + <runtarget target="build" /> + <runtarget target="collect" /> +</target> + +</project> diff --git a/etc/tasks/allforced.xml b/etc/tasks/allforced.xml new file mode 100644 index 0000000000000000000000000000000000000000..32f73751b478cf800e7623f3bebee89c55f71a2c --- /dev/null +++ b/etc/tasks/allforced.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="allforced" default="build"> + +<!-- TASK: allforced + Clean up, build and collect. + Includes a forced update to all dependent projects +--> +<target name="allforced"> + <var name="dependency.projects.forcebuild" value="" /> + <runtarget target="all" /> +</target> + +</project> diff --git a/etc/tasks/build.xml b/etc/tasks/build.xml new file mode 100644 index 0000000000000000000000000000000000000000..0b87b3e0bdbfa8cff9e3eb73f122f6d7734e6d65 --- /dev/null +++ b/etc/tasks/build.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="build" default="build"> + +<!-- TASK: build + Main target +--> +<target name="build"> + <echo>----</echo> + <echo>Building project "${projectname}"</echo> + <!-- don't run the build if it is a global build and the project property "global.build.ignore" is set --> + <if><not> + <and> + <isset property="global.build" /> + <isset property="global.build.ignore" /> + </and> + </not> + <then> + <runtarget target="compile" /> + <runtarget target="buildjar" /> + </then> + <else> + <echo>+--------------------------------------------------------------------------------+</echo> + <echo>| PROJECT IS NOT BUILD. Global build, but "global.build.ignore" property is set. |</echo> + <echo>+--------------------------------------------------------------------------------+</echo> + </else> + </if> +</target> + +</project> diff --git a/etc/tasks/buildjar.xml b/etc/tasks/buildjar.xml new file mode 100644 index 0000000000000000000000000000000000000000..119545a2ba817a6dc1b8aaaa4dfbc544a4620536 --- /dev/null +++ b/etc/tasks/buildjar.xml @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="buildjar" default="build"> + + +<!-- TASK: buildjar + Build the jar file +--> +<target name="buildjar" depends="_getBuildNumber"> + + <!-- Build the base jar file --> + <if><not> + <equals arg1="${manifest}" arg2="none" trim="true" /> + </not> + <then> + <jar destfile="${file.jar}" manifest="${manifest}" whenmanifestonly="create"> + <fileset dir="${path.gen.classes}"> + <include name="**/*.class" /> + </fileset> + <manifest> + <!-- Who is building this jar? --> + <attribute name="Built-By" value="${user.name}"/> + <attribute name="Build-Time" value="${build.time}"/> + <attribute name="SVN-Revision" value="${svn.revision}"/> + </manifest> + </jar> + </then> + <else> + <jar destfile="${file.jar}" whenmanifestonly="create"> + <fileset dir="${path.gen.classes}"> + <include name="**/*.class" /> + </fileset> + <manifest> + <!-- Who is building this jar? --> + <attribute name="Built-By" value="${user.name}"/> + <attribute name="Build-Time" value="${build.time}"/> + <attribute name="SVN-Revision" value="${svn.revision}"/> + </manifest> + </jar> + </else> + </if> + + <!-- Add resources, if necessary --> + <available property="available.resources" file="resources" /> + <if><isset property="available.resources" /> + <then> + <jar destfile="${file.jar}" update="true"> + <fileset dir="${path.resources}"> + <include name="**/*" /> + </fileset> + </jar> + </then> + </if> + + <!-- Include external resources in the jar file --> + <runtarget target="_includeExternalResourcesInJar" /> + + <!-- Include external manifest in the jar file --> + <!-- <runtarget target="_importManifest" /> --> + +</target> + + +</project> diff --git a/etc/tasks/clean.xml b/etc/tasks/clean.xml new file mode 100644 index 0000000000000000000000000000000000000000..8d86e0be8f13e14fc9914ad1b67562a383fd0e62 --- /dev/null +++ b/etc/tasks/clean.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="clean" default="build"> + +<!-- TASK: Clean + Removes all generated files from the "gen" directory for a project +--> +<target name="clean" depends="_cleanDependentProjects"> + <echo>Cleaning project "${projectname}"</echo> + <delete dir="${path.gen}"/> + <delete dir="${path.gen.documentation}"/> + + <!-- remove the directory for the domain --> + <if> + <isset property="omain" /> + <then> + <delete dir="${path.gen.domain}/${omain}" /> + </then> + </if> + +</target> + +</project> diff --git a/etc/tasks/collect.xml b/etc/tasks/collect.xml new file mode 100644 index 0000000000000000000000000000000000000000..f34e547012a667cd0d9d1472ff2280bca44e92c9 --- /dev/null +++ b/etc/tasks/collect.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="collect" default="build"> + +<!-- TASK: collect + collect the results in a common directory. If $omain is set, the artifacts are also collected in + the specified Domain directory. +--> +<target name="collect" depends="_prepare"> + <echo>Collecting artifacts from "${projectname}"</echo> + <if> + <isset property="omain" /> + <then> + <copy todir="${path.gen.domain}/${omain}"> + <fileset dir="${path.gen}" includes="*.jar"/> + </copy> + </then> + </if> + <copy todir="${path.gen.collection}"> + <fileset dir="${path.gen}" includes="*.jar"/> + </copy> +</target> + +</project> diff --git a/etc/tasks/compile.xml b/etc/tasks/compile.xml new file mode 100644 index 0000000000000000000000000000000000000000..74f5382884758226bba2dfd809dbecf4dab40b3b --- /dev/null +++ b/etc/tasks/compile.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="compile" default="build"> + +<!-- TASK: compile + Compile the source code +--> +<target name="compile" depends="_prepare,_preparebuild,_setClassPath"> + + <echo>Java.source=${java.source}, Java.target=${java.target}</echo> + + <if><equals arg1="${uselint}" arg2="true" trim="true" /> + + <!-- Enable -Xlint compiler warnings --> + <then> + <javac destdir="${path.gen.classes}" + includes="**/*.java" + classpathref="id.libraries" + srcdir="${path.src}" + debug="on" + target="${java.target}" + source="${java.source}" + includeantruntime="false" + listfiles="on"> + <compilerarg value="-Xlint"/> + </javac> + </then> + + <!-- No special compiler warnings --> + <else> + <javac destdir="${path.gen.classes}" + includes="**/*.java" + classpathref="id.libraries" + srcdir="${path.src}" + debug="on" + target="${java.target}" + source="${java.source}" + includeantruntime="false" + listfiles="on"> + </javac> + </else> + </if> +</target> + +</project> diff --git a/etc/tasks/compilenative.xml b/etc/tasks/compilenative.xml new file mode 100644 index 0000000000000000000000000000000000000000..8ad51f72712afe00f61c900bfc288d368533eca2 --- /dev/null +++ b/etc/tasks/compilenative.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="compilenative" default="build"> + +<!-- + Compile native code +--> +<target name="compilenative" depends="_prepare, _buildNative"> +</target> + +</project> diff --git a/etc/tasks/doc.xml b/etc/tasks/doc.xml new file mode 100644 index 0000000000000000000000000000000000000000..add2e25f7a066fafdcd73de61647bfbe6a796b09 --- /dev/null +++ b/etc/tasks/doc.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="doc" default="build"> + +<!-- TASK: doc + Generate documentation for a project +--> + +<target name="doc" depends="_prepare,_setClassPath"> + <javadoc destdir="${path.gen.documentation}" + classpathref="id.libraries" + sourcepath="${path.src}" + > + </javadoc> +</target> + +</project> + diff --git a/etc/tasks/eclipse.xml b/etc/tasks/eclipse.xml new file mode 100644 index 0000000000000000000000000000000000000000..bbab65e89cbbc2326cbe46aeb7afb379d52e7560 --- /dev/null +++ b/etc/tasks/eclipse.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<project name="eclipse" default="build"> + +<!-- TASK: eclipse + Set properties, generate the classpath etc +--> +<target name="eclipse" depends="build, _setClassPath"> + + <!-- Writing the .classpath file --> + <!-- using echoxml is not possible together with the "for" statement, so <echo> and escapes must be used --> + <echo file="${path.eclipse.classpathfile}"><?xml version="1.0" encoding="UTF-8"?>${line.separator}<classpath>${line.separator}<classpathentry kind="src" path="src"/>${line.separator}<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>${line.separator}</echo> + <for param="p"> + <path refid="id.libraries" /> + <sequential> + <echo file="${path.eclipse.classpathfile}" append="true"><classpathentry kind="lib" path="@{p}"/>${line.separator}</echo> + </sequential> + </for> + <echo file="${path.eclipse.classpathfile}" append="true"><classpathentry kind="output" path="classes"/>${line.separator}</classpath>${line.separator}</echo> + + <!-- Writing the .project file --> + <echoxml file="${path.eclipse.projectfile}"> + <projectDescription> + <name>${projectname}</name> + <comment></comment> + <projects></projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> + <linkedResources> + <link> + <name>classes</name> + <type>2</type> + <location>${path.gen.classes}</location> + </link> + </linkedResources> + </projectDescription> + </echoxml> + + <!-- Writing the settings/org.eclipse.jdt.core.prefs file --> + <mkdir dir="${path.eclipse.settingsdir}" /> + <echo file="${path.eclipse.settingsfile}">org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled${line.separator}</echo> + <echo file="${path.eclipse.settingsfile}" append="true">org.eclipse.jdt.core.compiler.codegen.targetPlatform=${java.target}${line.separator}</echo> + <echo file="${path.eclipse.settingsfile}" append="true">org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve${line.separator}</echo> + <echo file="${path.eclipse.settingsfile}" append="true">org.eclipse.jdt.core.compiler.compliance=${java.source}${line.separator}</echo> + <echo file="${path.eclipse.settingsfile}" append="true">org.eclipse.jdt.core.compiler.debug.lineNumber=generate${line.separator}</echo> + <echo file="${path.eclipse.settingsfile}" append="true">org.eclipse.jdt.core.compiler.debug.localVariable=generate${line.separator}</echo> + <echo file="${path.eclipse.settingsfile}" append="true">org.eclipse.jdt.core.compiler.debug.sourceFile=generate${line.separator}</echo> + <echo file="${path.eclipse.settingsfile}" append="true">org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning${line.separator}</echo> + <echo file="${path.eclipse.settingsfile}" append="true">org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning${line.separator}</echo> + <echo file="${path.eclipse.settingsfile}" append="true">org.eclipse.jdt.core.compiler.source=${java.source}${line.separator}</echo> + + +</target> + +</project> + + diff --git a/libs/ant/ant-contrib-1.0b3.jar b/libs/ant/ant-contrib-1.0b3.jar new file mode 100644 index 0000000000000000000000000000000000000000..062537661a514c2ce97d18948f4f25f7226cc1a0 Binary files /dev/null and b/libs/ant/ant-contrib-1.0b3.jar differ diff --git a/libs/ant/antDialog.jar b/libs/ant/antDialog.jar new file mode 100644 index 0000000000000000000000000000000000000000..a4a294ad407350638b4e34643d841abb50c3cd24 Binary files /dev/null and b/libs/ant/antDialog.jar differ diff --git a/libs/ant/antSetLogLevel.jar b/libs/ant/antSetLogLevel.jar new file mode 100644 index 0000000000000000000000000000000000000000..59e6a22d692662b8a19139ae484aac6dacecde9c Binary files /dev/null and b/libs/ant/antSetLogLevel.jar differ diff --git a/libs/ant/bnd-0.0.378.jar b/libs/ant/bnd-0.0.378.jar new file mode 100644 index 0000000000000000000000000000000000000000..a6924eefde7a38299c7690fb812de883305a2f06 Binary files /dev/null and b/libs/ant/bnd-0.0.378.jar differ diff --git a/libs/ant/svnClientAdapter.jar b/libs/ant/svnClientAdapter.jar new file mode 100644 index 0000000000000000000000000000000000000000..ed37ba467147596fde3c7ae73d1cde4cbf788626 Binary files /dev/null and b/libs/ant/svnClientAdapter.jar differ diff --git a/libs/ant/svnant.jar b/libs/ant/svnant.jar new file mode 100644 index 0000000000000000000000000000000000000000..af52be0de6b8d504d807023eb592c16bfe8b219c Binary files /dev/null and b/libs/ant/svnant.jar differ diff --git a/libs/ant/svnjavahl.jar b/libs/ant/svnjavahl.jar new file mode 100644 index 0000000000000000000000000000000000000000..71873057866091c4bd5edda26e879ab0c1c9a778 Binary files /dev/null and b/libs/ant/svnjavahl.jar differ