ant builds

I have already spent a few hours searching for a solution to this but to no avail, so came here with hope that someone would be able to advise. I have java code that is built using ant scripts. All I need to do is to ensure that ear files/jar files generated by ant scripts include the source as well. Could somebody advise me o how to include the source code in the ear files as well

[391 byte] By [LisaMa] at [2007-11-26 16:00:50]
# 1
Publish the ant task that creates the ear file.
sabre150a at 2007-7-8 22:22:20 > top of Java-index,Java Essentials,Java Programming...
# 2

> Publish the ant task that creates the ear file.

here you go

<?xml version="1.0"?>

<project name="posttradeengine2 master build" default="all">

<import file="../common-tasks.xml"/>

<import file="../common-test-macros.xml"/>

<property environment="env"/>

<variable-exists name="env.LocalJar"/>

<property file="version2.properties"/>

<property file="../script/pmd_rulesets/rulesets.properties"/>

<target name="all" depends="get.dependencies, clean, sub-build"/>

<target name="get.dependencies">

<dependency jar="${jar.xercesImpl}"/>

<dependency jar="${jar.xmlbeans.xbean}"/>

<dependency jar="${jar.xmlbeans.jsr.api}"/>

<dependency jar="${jar.weblogic}"/>

<dependency jar="${jar.weblogic.webservices}"/>

</target>

<target name="sub-build">

<antcall target="myApp-xmlbeans"/>

</target>

<target name="myApp-xmlbeans">

<ant antfile="build.xml" dir="myApp-xmlbeans"/>

<antcall target="myApp-core"/>

</target>

<target name="myApp-core">

<ant antfile="build.xml" dir="myApp-core"/>

<antcall target="myApp-dao"/>

</target>

<target name="myApp-dao">

<ant antfile="build.xml" dir="myApp-dao"/>

<antcall target="myApp-infra-services"/>

</target>

<target name="myApp-infra-services">

<ant antfile="build.xml" dir="myApp-infra-services"/>

<antcall target="myApp-service-impl"/>

</target>

<target name="myApp-service-impl">

<ant antfile="build.xml" dir="myApp-service-impl"/>

<antcall target="myApp-interfaces-comint"/>

</target>

<target name="myApp-interfaces-comint">

<ant antfile="build.xml" dir="myApp-interfaces-comint"/>

<antcall target="cac"/>

</target>

<target name="cac">

<ant antfile="build.xml" dir="cac"/>

<antcall target="myApp"/>

</target>

<target name="myApp">

<ant antfile="build.xml" dir="myApp"/>

<antcall target="werf"/>

</target>

<target name="werf">

<ant antfile="build.xml" dir="werf"/>

<antcall target="myApp-package"/>

</target>

<target name="myApp-package">

<ant antfile="build.xml" dir="myApp" target="package"/>

<antcall target="myApp-services"/>

</target>

<target name="myApp-services">

<ant antfile="build.xml" dir="myApp-services"/>

<antcall target="navisys"/>

</target>

<target name="navisys">

<ant antfile="build.xml" dir="navisys"/>

<antcall target="rtf"/>

</target>

<target name="rtf">

<ant antfile="build.xml" dir="rtf"/>

<antcall target="desktop"/>

</target>

<target name="desktop">

<ant antfile="build.xml" dir="desktop"/>

<antcall target="AWD"/>

</target>

<target name="AWD">

<ant antfile="build.xml" dir="AWD"/>

<antcall target="test-harness"/>

</target>

<target name="test-harness">

<ant antfile="build.xml" dir="test-harness"/>

<antcall target="crx-interface"/>

</target>

<target name="crx-interface">

<ant antfile="build.xml" dir="crx-interface"/>

<antcall target="bizlink"/>

</target>

<target name="bizlink">

<ant antfile="build.xml" dir="bizlink"/>

<antcall target="conWSul"/>

</target>

<target name="conWSul">

<ant antfile="build.xml" dir="conWSul"/>

<antcall target="WSul"/>

</target>

<target name="WSul">

<ant antfile="build.xml" dir="WSul"/>

<antcall target="erfd"/>

</target>

<target name="erfd">

<ant antfile="build.xml" dir="erfd"/>

<antcall target="wmd"/>

</target>

<target name="wmd">

<ant antfile="build.xml" dir="wmd"/>

<antcall target="dev-tools"/>

</target>

<target name="dev-tools">

<ant antfile="build.xml" dir="dev-tools"/>

<antcall target="myApp-monitoring"/>

</target>

<target name="myApp-monitoring">

<ant antfile="build.xml" dir="myApp-monitoring"/>

</target>

<target name="quick">

<ant antfile="build.xml" target="quick" dir="myApp-xmlbeans"/>

<ant antfile="build.xml" target="quick" dir="myApp-core"/>

<ant antfile="build.xml" target="quick" dir="myApp-dao"/>

<ant antfile="build.xml" target="quick" dir="myApp-infra-services"/>

<ant antfile="build.xml" target="quick" dir="myApp-service-impl"/>

<ant antfile="build.xml" target="quick" dir="myApp-interfaces-comint"/>

<ant antfile="build.xml" target="quick" dir="myApp"/>

<ant antfile="build.xml" target="quick" dir="werf"/>

<ant antfile="build.xml" target="quick" dir="myApp-services"/>

<ant antfile="build.xml" target="quick" dir="navisys"/>

<ant antfile="build.xml" target="quick" dir="rtf"/>

<ant antfile="build.xml" target="quick" dir="AWD"/>

<ant antfile="build.xml" target="quick" dir="test-harness"/>

<ant antfile="build.xml" target="quick" dir="crx-interface"/>

<ant antfile="build.xml" target="quick" dir="bizlink"/>

<ant antfile="build.xml" target="quick" dir="conWSul"/>

<ant antfile="build.xml" target="quick" dir="WSul"/>

<ant antfile="build.xml" target="quick" dir="erfd"/>

<ant antfile="build.xml" target="all" dir="wmd"/>

<ant antfile="build.xml" target="quick" dir="dev-tools"/>

<ant antfile="build.xml" target="all" dir="myApp-monitoring"/>

<delete dir="target"/>

</target>

<target name="clean">

<ant antfile="build.xml" target="clean" dir="myApp-xmlbeans"/>

<ant antfile="build.xml" target="clean" dir="myApp-core"/>

<ant antfile="build.xml" target="clean" dir="myApp-dao"/>

<ant antfile="build.xml" target="clean" dir="myApp-infra-services"/>

<ant antfile="build.xml" target="clean" dir="myApp-service-impl"/>

<ant antfile="build.xml" target="clean" dir="myApp-interfaces-comint"/>

<ant antfile="build.xml" target="clean" dir="myApp"/>

<ant antfile="build.xml" target="clean" dir="werf"/>

<ant antfile="build.xml" target="clean" dir="myApp-services"/>

<ant antfile="build.xml" target="clean" dir="navisys"/>

<ant antfile="build.xml" target="clean" dir="rtf"/>

<ant antfile="build.xml" target="clean" dir="desktop"/>

<ant antfile="build.xml" target="clean" dir="AWD"/>

<ant antfile="build.xml" target="clean" dir="test-harness"/>

<ant antfile="build.xml" target="clean" dir="crx-interface"/>

<ant antfile="build.xml" target="clean" dir="bizlink"/>

<ant antfile="build.xml" target="clean" dir="conWSul"/>

<ant antfile="build.xml" target="clean" dir="WSul"/>

<ant antfile="build.xml" target="clean" dir="erfd"/>

<ant antfile="build.xml" target="clean" dir="wmd"/>

<ant antfile="build.xml" target="clean" dir="dev-tools"/>

<ant antfile="build.xml" target="clean" dir="myApp-monitoring"/>

<delete dir="target"/>

</target>

<target name="coverage-report">

<ant antfile="build.xml" target="coverage-report" dir="myApp-core"/>

<ant antfile="build.xml" target="coverage-report" dir="myApp-dao"/>

<ant antfile="build.xml" target="coverage-report" dir="myApp-infra-services"/>

<ant antfile="build.xml" target="coverage-report" dir="myApp-service-impl"/>

<ant antfile="build.xml" target="coverage-report" dir="myApp-interfaces-comint"/>

<ant antfile="build.xml" target="coverage-report" dir="myApp"/>

<ant antfile="build.xml" target="coverage-report" dir="werf"/>

<ant antfile="build.xml" target="coverage-report" dir="myApp-services"/>

<ant antfile="build.xml" target="coverage-report" dir="navisys"/>

<ant antfile="build.xml" target="coverage-report" dir="rtf"/>

<ant antfile="build.xml" target="coverage-report" dir="desktop"/>

<ant antfile="build.xml" target="coverage-report" dir="AWD"/>

<ant antfile="build.xml" target="coverage-report" dir="crx-interface"/>

<ant antfile="build.xml" target="coverage-report" dir="bizlink"/>

<ant antfile="build.xml" target="coverage-report" dir="conWSul"/>

<ant antfile="build.xml" target="coverage-report" dir="WSul"/>

<ant antfile="build.xml" target="coverage-report" dir="wmd"/>

<ant antfile="build.xml" target="coverage-report" dir="myApp-monitoring"/>

</target>

<target name="metrics">

<!--ant antfile="build.xml" target="metrics" dir="myApp-xmlbeans" /-->

<ant antfile="build.xml" target="metrics" dir="myApp-core"/>

<ant antfile="build.xml" target="metrics" dir="myApp-dao"/>

<ant antfile="build.xml" target="metrics" dir="myApp-infra-services"/>

<ant antfile="build.xml" target="metrics" dir="myApp-service-impl"/>

<ant antfile="build.xml" target="metrics" dir="myApp-interfaces-comint"/>

<ant antfile="build.xml" target="metrics" dir="myApp"/>

<ant antfile="build.xml" target="metrics" dir="werf"/>

<ant antfile="build.xml" target="metrics" dir="myApp-services"/>

<ant antfile="build.xml" target="metrics" dir="navisys"/>

<ant antfile="build.xml" target="metrics" dir="rtf"/>

<ant antfile="build.xml" target="metrics" dir="desktop"/>

<ant antfile="build.xml" target="metrics" dir="AWD"/>

<ant antfile="build.xml" target="metrics" dir="test-harness"/>

<ant antfile="build.xml" target="metrics" dir="crx-interface"/>

<ant antfile="build.xml" target="metrics" dir="bizlink"/>

<ant antfile="build.xml" target="metrics" dir="conWSul"/>

<ant antfile="build.xml" target="metrics" dir="WSul"/>

<ant antfile="build.xml" target="metrics" dir="erfd"/>

<ant antfile="build.xml" target="metrics" dir="wmd"/>

<ant antfile="build.xml" target="metrics" dir="dev-tools"/>

<ant antfile="build.xml" target="metrics" dir="myApp-monitoring"/>

</target>

<target name="emma">

<path id="emma.sourcepath">

<pathelement location="myApp-core/src/java"/>

<pathelement location="myApp-dao/src/java"/>

<pathelement location="myApp-infra-services/src/java"/>

<pathelement location="myApp-interfaces-comint/src/java"/>

<pathelement location="myApp/src/java"/>

<pathelement location="myApp-services/src/java"/>

<pathelement location="navisys/src/java"/>

<pathelement location="rtf/src/java"/>

<pathelement location="desktop/src/java"/>

<pathelement location="AWD/src/java"/>

<pathelement location="test-harness/src/java"/>

<pathelement location="crx-interface/src/java"/>

<pathelement location="bizlink/src/java"/>

<pathelement location="conWSul/src/java"/>

<pathelement location="wmd/src/java"/>

<pathelement location="myApp-monitoring/src/java"/>

</path>

<emma-report basedir="${basedir}" outdir="target/unit-test" enabled="true"/>

</target>

<target name="deploy-artifacts">

<ant antfile="build.xml" target="deploy-artifacts" dir="myApp-xmlbeans"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="myApp-core"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="myApp-dao"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="myApp-infra-services"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="myApp-service-impl"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="myApp-interfaces-comint"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="myApp"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="werf"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="myApp-services"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="navisys"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="rtf"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="desktop"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="AWD"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="test-harness"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="crx-interface"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="bizlink"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="conWSul"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="WSul"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="erfd"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="wmd"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="dev-tools"/>

<ant antfile="build.xml" target="deploy-artifacts" dir="myApp-monitoring"/>

</target>

<target name="jaywalker">

<gfx-jaywalker archive="myApp/target/posttrade-${current.version}.ear" outputdir="target"/>

</target>

</project>

LisaMa at 2007-7-8 22:22:20 > top of Java-index,Java Essentials,Java Programming...
# 3
> > Publish the ant task that creates the ear file.> > here you goSorry but I can't help you. This file is only one of your build files and I would need to see all the others. An analysis of these would take more effort than I am willing to expend.
sabre150a at 2007-7-8 22:22:20 > top of Java-index,Java Essentials,Java Programming...
# 4
if you can give me a hint or some ideas hopefully I can do it myself. and as a metter of fact I dont want you to do my job
LisaMa at 2007-7-8 22:22:20 > top of Java-index,Java Essentials,Java Programming...
# 5

> if you can give me a hint or some ideas hopefully I

> can do it myself. and as a metter of fact I dont

> want you to do my job

You need to find the ear task. Find the javac task. Look to see what java files are involved in the javac task and then add them to the fileset used in the ear task.

sabre150a at 2007-7-8 22:22:20 > top of Java-index,Java Essentials,Java Programming...
# 6
I don't understand what your problem is. You just need to include the source in your .jar & .ear files? Just add another fileset element that matches your source tree.
bckrispia at 2007-7-8 22:22:20 > top of Java-index,Java Essentials,Java Programming...
# 7

> I don't understand what your problem is. You just

> need to include the source in your .jar & .ear files?

> Just add another fileset element that matches your

> source tree.

so shuld I do

<fileset file="src/java"/>

or

<fileset file="src/java/*.java"/>

or do i need to specify name of each file individually

LisaMa at 2007-7-8 22:22:20 > top of Java-index,Java Essentials,Java Programming...
# 8
any help?
LisaMa at 2007-7-8 22:22:20 > top of Java-index,Java Essentials,Java Programming...
# 9

do something like this

<copy todir="<dirName>" >

<fileset dir="<srcFolder>">

<include name="**/*.java"/>

<include name="**/*.properties"/>

</fileset>

</copy>

kilyasa at 2007-7-8 22:22:20 > top of Java-index,Java Essentials,Java Programming...