ANT for Dummies

patrick1982l

Mitglied
Hello Leute,

ich bin wirklich mit meinem Latein am Ende.

Dieses weiter unten folgende Ant file macht mir Probleme:

Konkret geht es hier um das Taget <target name="compile"

und zwar lass ich dies unter Eclipse laufen die JRE ist auf JDK 1.6 gestellt

Theoretisch möchte ich es aber mit dieser JDK unter 1.4 compilieren.

Das es nicht funktioniert seh ich daran das beim compilieren auf eine swinx.jar zugegriffen wird welche unter 1.4 nicht funktioniert. desweiteren hab ich Generics && Anotations im Code provisorisch integriert und auch da schreit der Compiler nicht :-(

Wenn ich unter Eclipse auf die 1.4 JDK umstelle kommt es wieder zu meinen erwarteten Exceptions.

Vielleicht kann mir ein ANT-Experte weiter helfen

Vielen Dank schon mal im vorhinein

Patrick


[XML]<project basedir=".." default="all" name="scheduling">

<!-- place where are 3td party binaries and destination for generated packages-->
<property name="libDir" value="../lib"/>



<!--Initialize properties relevant to build for Oracle Database Server-->
<!--These properties are used to generate jar that will be loaded to Oracle Server-->
<target name="initOracle" if="oracle.target">
<property name="classDir" value="classes12"/>
<property name="jarFileName" value="schedulingOra.jar"/>
<property name="jarManifestFile" value="project/manifestOra.mf"/>
<!--Compile target is used to command argument TARGET for java compiler. Means the Java Version Number -->
<property name="compile.target" value="1.2"/>

<!--Exclude user interface and tests from the compilation -->
<property name="compileExcludes" value="hlfg/scheduling/event/** **/ui/** **/ppc/scheduling/test/** **/ppc/scheduling/reports/** **/StorManFieldParameterSource.java"/>

<!-- This is part of classpath that will be added for compilling sources. Shoudl contain 3rd party binaries-->
<path id="extlibs">
<pathelement location="${libDir}/xmlparserv2.jar"/>
<!--<pathelement location="${libDir}/classes12.zip"/>-->
<pathelement location="${libDir}/log4j_12.jar"/>
<pathelement location="${libDir}/STD_12.jar"/>
<pathelement location="${libDir}/std.jar"/>
<pathelement location="${libDir}/masterDataOra.jar"/>
<pathelement location="${libDir}/messageServicesOracle.jar"/>
<!--pathelement location="${libDir}/telegram.jar"/-->
<pathelement location="${libDir}/smg.jar"/>
<pathelement location="${libDir}/schedulingdb.jar"/>
<pathelement location="${libDir}/commonOra.jar"/>
<pathelement location="${libDir}/systemOra.jar"/>
<pathelement location="${libDir}/storageManager.jar"/>
<pathelement location="${libDir}/PPC_PLANNING_12.jar"/>
<pathelement location="${libDir}/jakarta-regexp-1.3.jar"/>
</path>
</target>



<!--Initialize properties relevant to build for Generic purposes-->
<!--These properties are used to generate jar for generic usability -->
<target name="initOther" unless="oracle.target">
<property name="classDir" value="classes"/>
<property name="jarFileName" value="scheduling.jar"/>
<property name="jarManifestFile" value="project/manifest.mf"/>
<property name="compile.target" value="1.4"/>
<property name="build.compiler" value="javac1.4"/>

<!-- <property name="compile.target" value="${ant.java.version}"/>-->

<!--Exclude tests from the compilation -->
<property name="compileExcludes" value="**ppc/scheduling/test/**"/>


<path id="extlibs">
<pathelement location="${libDir}/xmlparserv2.jar"/>
<pathelement location="${libDir}/classes12.jar"/>
<pathelement location="${libDir}/log4j.jar"/>
<pathelement location="${libDir}/std.jar"/>
<pathelement location="${libDir}/masterData.jar"/>
<pathelement location="${libDir}/messageServicesClient.jar"/>
<pathelement location="${libDir}/telegram.jar"/>
<pathelement location="${libDir}/smg.jar"/>
<pathelement location="${libDir}/schedulingdb.jar"/>
<pathelement location="${libDir}/common.jar"/>
<pathelement location="${libDir}/system.jar"/>
<pathelement location="${libDir}/storageManager.jar"/>
<pathelement location="${libDir}/planning.jar"/>
<pathelement location="${libDir}/ima.jar"/>
<pathelement location="${libDir}/jhall.jar"/>
<pathelement location="${libDir}/CR.jar"/>
<pathelement location="${libDir}/jakarta-regexp-1.3.jar"/>
<pathelement location="${libDir}/swingx.jar"/>

</path>
</target>


<!--Main initialization target all non target relevant properties are initialized here -->
<target name="init" depends="initOracle,initOther" description="Initialize properties">
<!-- set global properties for this build -->

<!-- the following properties can be initialized in sub init tasks, this initialization is only by default.
it does not overwrite the previous initialized value -->
<property name="jarManifestFile" value="project/manifest.mf"/>
<property name="jarFileName" value="scheduling.jar"/>

<property name="classDir" value="classes"/>
<property name="compile.target" value="javac1.4"/>

<property name="build.compiler.deprecation" value="true"/>
<property name="build.compiler.debug" value="true"/>

<property name="srcDir" value="src"/>
<property name="docDir" value="docs"/>


<property name="libDir" value="../lib"/>
<property name="jarFile" value="${libDir}/${jarFileName}"/>


<tstamp prefix="std">
<format pattern="hhmmss" property="TSTAMP"/>
</tstamp>
<condition property="hlfg.build.tag" value="TEMP_BUILD_${std.DSTAMP}_${std.TSTAMP}">
<not>
<isset property="hlfg.build.tag"/>
</not>
</condition>
<condition property="hlfg.build.version" value="${hlfg.build.tag}">
<not>
<isset property="hlfg.build.version"/>
</not>
</condition>
</target>



<target name="compile" depends="init" description="Compile Module Sources">
<echo>Source compilation for target: ${compile.target}</echo>
<mkdir dir="${classDir}"/>
<javac deprecation="${build.compiler.deprecation}" debug="${build.compiler.debug}"
destdir="${classDir}" srcdir="${srcDir}" classpathref="extlibs" fork="true"
excludes="${compileExcludes}" source="1.4" target="1.4" compiler="javac1.4" includeantruntime="false" optimize="true">
</javac>
</target>



<target name="jar" depends="init,clean,compile" description="Create Module Jar file">
<mkdir dir="${libDir}"/>

<!-- Prepare manifest file, insert actual buildnumber string -->
<filter token="BUILD_TAG_SUBST" value="${hlfg.build.tag}"/>
<filter token="BUILD_VERSION_SUBST" value="${hlfg.build.version}"/>
<copy file="${jarManifestFile}" filtering="on" tofile="${jarManifestFile}.subst"/>

<!-- Jars all files in classDir and all files except sources from srcDir to jar -->
<jar compress="true" jarfile="${jarFile}" manifest="${jarManifestFile}.subst">
<fileset dir="${classDir}">
</fileset>
<fileset dir="${srcDir}">
<include name="**/resource/**"/>
<include name="**/*.properties"/>
<include name="**/*.gif"/>
</fileset>
</jar>
</target>



<!-- delete all created files by this ant script -->
<target name="clean" depends="init" description="Clean all build products.">
<delete file="${jarFile}"/>
<delete dir="${classDir}"/>
<delete file="${jarManifestFile}.subst"/>
</target>



<!-- Build all buildable things for all plattforms -->
<target name="all" description="Build everything." >
<echo message="Application built."/>
<antcall target="jar"/>
<antcall target="jar" inheritAll="false">
<param name="oracle.target" value="true"/>
<param name="hlfg.build.tag" value="${hlfg.build.tag}"/>
<param name="hlfg.build.version" value="${hlfg.build.version}"/>
</antcall>
</target>




<target name="cleanOracle" description="Cleaning the build files for Oracle Database Server">
<antcall target="clean" inheritAll="false">
<param name="oracle.target" value="true"/>
<param name="hlfg.build.tag" value="${hlfg.build.tag}"/>
<param name="hlfg.build.version" value="${hlfg.build.version}"/>
</antcall>
</target>




<target name="compileOracle" description="Compilation for Oracle Database Server">
<antcall target="compile" inheritAll="false">
<param name="oracle.target" value="true"/>
<param name="hlfg.build.tag" value="${hlfg.build.tag}"/>
<param name="hlfg.build.version" value="${hlfg.build.version}"/>
</antcall>
</target>



<!--Build jar for Oracle JavaStorageProcedures-->
<target name="jarOracle" description="Build jar loadable to Oracle Database Server">
<!--echo>This package does not contain any JAR for Oracle Database Server</echo-->
<antcall target="jar" inheritAll="false">
<param name="oracle.target" value="true"/>
<param name="hlfg.build.tag" value="${hlfg.build.tag}"/>
<param name="hlfg.build.version" value="${hlfg.build.version}"/>
</antcall>
</target>


</project>[/XML]
 

Wildcard

Top Contributor
Entweder du gibst im buildscript explizt den Pfad zu einem bestimmten JDK an, oder du stellst das passende JDK in der Eclipse Launch Config ein.
 

Neue Themen


Oben