Separating ANT builts

Reply

Join Date: Dec 2004
Posts: 8
Reputation: dannyfang is an unknown quantity at this point 
Solved Threads: 0
dannyfang dannyfang is offline Offline
Newbie Poster

Separating ANT builts

 
0
  #1
Dec 13th, 2005
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, 0 views)
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,145
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Separating ANT builts

 
0
  #2
Dec 13th, 2005
Create supertargets building only those parts of the application you want to include.
So for example (from one of my buildfiles):

  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.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 8
Reputation: dannyfang is an unknown quantity at this point 
Solved Threads: 0
dannyfang dannyfang is offline Offline
Newbie Poster

Re: Separating ANT builts

 
0
  #3
Dec 14th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,145
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Separating ANT builts

 
0
  #4
Dec 14th, 2005
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).
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC