944,076 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1462
  • Java RSS
Dec 13th, 2005
0

Separating ANT builts

Expand Post »
Hi,
I'm a newbie with ANT. I have a ANT build.xml file in which I'm attempting to separate certain packages from different requirements of the built.

As an example, if I have a software which consists of packages A,B,C,D and E. I have customer whom are purchasing the software, but are not interested in the incorporating packages D and E. The customer is only interested in using packages A,B and C. At the same time, I have another customer who is interested in using the entire package of the software i.e. A ...E.

How do I implement flags in ANT to ensure that certain components are not accessible by the customers if they are not being purchased?

From the attached is my build.xml, I'm attempting to exclude the following targets(listed below) so that users could not access them if they have not purchased the software with these features:
<target name = “activeCollector�>
<target name = “activeGUI�>
<target name = “saagui�>

From the build.xml, the final built would produce 2 *.jar files i.e.
Poller_Admin_Installation_V2.0.jar
Poller_Client_Installation_V2.0.jar

Could anyone show me an example how I could implement flags in ANT prevent users from accessing certain packages within a software?

Thanks
Danny
Attached Files
File Type: xml build.xml (22.3 KB, 8 views)
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dannyfang is offline Offline
8 posts
since Dec 2004
Dec 13th, 2005
0

Re: Separating ANT builts

Create supertargets building only those parts of the application you want to include.
So for example (from one of my buildfiles):

Java Syntax (Toggle Plain Text)
  1. <target depends="cleanup" name="clean"/>
  2. <target name="precompile"/>
  3. <target depends="javacompile" name="compile"/>
  4. <target name="postcompile"/>
  5. <target depends="archive,javadoc,resource" name="package"/>
  6. <target name="deploy"/>
  7. <target depends="precompile,compile,test,postcompile,package,deploy" name="make"/>
  8. <target depends="clean,make" name="rebuild"/

make sure every single supertarget does a clean build to make sure nothing is included that wasn't ordered.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Dec 14th, 2005
0

Re: Separating ANT builts

Hi jwenting,

From the example you had provided(see below), you seemed to have basically included the dependencies of the targets of interest - but how did you conditionally exclude the other target types/rules that are currently in the ANT build file without having conditions in them? Could you please help explain?

<target depends="cleanup" name="clean"/>
<target name="precompile"/>
<target depends="javacompile" name="compile"/>
<target name="postcompile"/>
<target depends="archive,javadoc,resource" name="package"/>
<target name="deploy"/>
<target depends="precompile,compile,test,postcompile,package,deploy" name="make"/>
<target depends="clean,make" name="rebuild"/>



Thanks
Danny
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dannyfang is offline Offline
8 posts
since Dec 2004
Dec 14th, 2005
0

Re: Separating ANT builts

You'll need to structure your build (and code) in such a way that your dependencies are minimised or (if possible) eliminated.

So you get a target compileABC depending on compileA, compileB, and compileC where neither depends on any of the others.
Another target compileCDE would depend on compileC, compileD, and compileE.

You will then structure your source directories so that parts A-E don't overlap (in this example C is likely some common package shared by the others so you would have your IDE set up to link to it in the other projects).
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: For loop
Next Thread in Java Forum Timeline: Need help on programming with bluetooth-enabled devices





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC