Re: Ant Build Error
Re: Ant Build Error
- Subject: Re: Ant Build Error
- From: Susanne Schneider <email@hidden>
- Date: Tue, 11 Aug 2009 20:52:05 +0200
Hi Miguel,
just recently I had a similar problem. I could not make it to work the
standard way as our frameworks will be build in a custom subfolder of
the standard framework location.
This is what worked for me in our ant file for building an application
(some targets omitted):
<!-- ============================================= -->
<!-- Property Determination -->
<!-- @uses the local WebObjects properties file -->
<!-- @return error if properties not found -->
<!-- ============================================= -->
<target name="init.properties">
<tstamp />
<!-- general properties -->
<property file="build.properties" />
<property file="${wolips.properties}" />
<condition property="wo.properties.check.failed">
<not>
<and>
<isset property="wo.system.frameworks" />
<isset property="wo.local.frameworks" />
</and>
</not>
</condition>
<fail message="The properties 'wo.system.frameworks' and
'wo.local.frameworks' must be set. Check that your ${wolips.properties}
is correct." if="wo.properties.check.failed" />
<!-- current build properties -->
<property name="local.srt.dir" value="${basedir}/../../.." />
<property file="${local.srt.dir}/ant/build.properties" />
<condition property="build.srt.check.failed">
<not>
<and>
<isset property="version" />
<isset property="installation" />
</and>
</not>
</condition>
<fail message="Could not find ${local.srt.dir}/ant/build.properties
or version or installation not set." if="build.srt.check.failed" />
<condition property="local.dest.dir" value="build" else="dist">
<and>
<isset property="dev.build" />
</and>
</condition>
<echo message="${project.name} local.dest.dir ${local.dest.dir}"/>
<property name="src.dir" value="src-install" />
<!-- shorten names -->
<property name="frameworks.dir"
value="${wo.local.frameworks}/${installation}" />
<!-- ============================================= -->
<!-- Define Compile Classpath -->
<path id="classpath">
<fileset dir="${frameworks.dir}">
<include name="*.framework/Resources/Java/*.jar" />
</fileset>
</path>
</target>
<!-- ============================================= -->
<!-- WOProject Tasks -->
<!-- ============================================= -->
<taskdef name="wocompile"
classname="org.objectstyle.woproject.ant.WOCompile" />
<taskdef name="woapplication"
classname="org.objectstyle.woproject.ant.WOApplication" />
<!-- ============================================= -->
<!-- Compile Classes -->
<!-- ============================================= -->
<target name="compile">
<wocompile source="${javalevel}" srcdir="${src.dir}"
destdir="${classes.dir}" debug="${compile.debug}"
optimize="${compile.optimize}" deprecation="${compile.deprecation}">
<frameworks root="System" embed="true">
<include name="JavaWOExtension.framework" />
<include name="JavaFoundation.framework" />
<include name="JavaXML.framework" />
<include name="JavaEOAccess.framework" />
<include name="JavaEOControl.framework" />
<include name="JavaWebObjects.framework" />
<include name="JavaWOExtensions.framework" />
</frameworks>
<classpath refid="classpath" />
</wocompile>
</target>
<!-- ============================================= -->
<!-- Build WOApplication -->
<!-- ============================================= -->
<target name="build.woapp">
<!-- add webXML="true" to generate a web.xml file -->
<woapplication name="${project.name}"
frameworksBaseURL="/WebObjects/${build.app.name}.woa/Frameworks"
destDir="${local.dest.dir}" jvmoptions="${jvm.options}">
<classes dir="${classes.dir}">
</classes>
<wsresources dir=".">
<include name="addYourWebServerResourcesHere" />
<exclude name="**/*.woa/**" />
</wsresources>
<resources dir=".">
<include name="Properties" />
<include name="**/*.eomodeld/" />
<include name="**/*.d2wmodel" />
<include name="**/*.wo/" />
<include name="**/*.strings" />
<exclude name="**/*.eomodeld~/" />
<exclude name="**/*.woa/**" />
<exclude name="**/*.api" />
</resources>
<frameworks root="System" embed="${embed.System}" >
<include name="JavaEOAccess.framework" />
<include name="JavaEOControl.framework" />
<include name="JavaFoundation.framework" />
<include name="JavaWebObjects.framework" />
<include name="JavaJDBCAdaptor.framework" />
<include name="JavaXML.framework" />
<include name="JavaWOExtensions.framework" />
</frameworks>
<!-- SecuTrial Frameworks (used for CLSSPATH.TXT) -->
<frameworks root="Local" embed="${embed.Project}">
<include name="${installation}/IASLibrary.framework" />
<include name="${installation}/IASFoundation.framework" />
<include name="${installation}/IASEnterpriseObjects.framework" />
<include name="${installation}/IASUserManagement.framework" />
<include name="${installation}/IASSchemaFramework.framework" />
<include name="${installation}/IASComponents.framework" />
<include name="${installation}/IASDocumentation.framework" />
<include name="${installation}/SRTExportFramework.framework" />
</frameworks>
<lib dir=".">
<include name="Add .jar's that should be copied in the woa." />
<exclude name="**/*.woa/**" />
</lib>
</woapplication>
</target>
As you can see, for compilation a classpath is defined from the
distribution framework location. Our custom frameworks are put there
with another ant build before. Maybe this could be handled in another
way, but this works for me.
The standard way seems to be to rely on the Eclipse configured
classpath, but this does not work if the distribution location is
another than the development situation.
HTH,
Susanne
--
Susanne Schneider
Coordinator secuTrial Development
iAS interActive Systems GmbH
Dieffenbachstraße 33 c, D-10967 Berlin
fon +49(0)30 22 50 50 - 498
fax +49(0)30 22 50 50 - 451
mail email@hidden
web http://www.interActive-Systems.de
----------------------------------------------------
Geschäftsführer: Dr. Marko Reschke, Thomas Fritzsche
Sitz der Gesellschaft: Berlin
Amtsgericht Berlin Charlottenburg, HRB 106103B
----------------------------------------------------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden