Solved

Ant: extract from CVS and compile java code

Posted on 2009-07-14
5
372 Views
Last Modified: 2013-11-25
I have  a folder called "custom" in CVS which has the following hierarchy

custom -> src
custom -> jsp
custom-> xsl
custom -> classes
....

Can someone please let me know how I can use ant script to extract the "custom" folder from CVS. After that using ant I need to build the java files inside "custom--> src" and put the compiled classes inside "custom -> classes".

thank you
0
Comment
Question by:ank9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 24856715
0
 
LVL 20

Expert Comment

by:a_b
ID: 24856780
You cannot 'extarct' it from CVS, you need to check out the directory and then write an ant file to run there.
Here is are some sample ant commandds to get you started, you will have to tune them as you progress to your needs -

<target name="compile">
      <javac srcdir="src direcory" destdir="destination direcotyr  includes="files to include"
         excludes="files to exclude">        
         <compilerarg value="args" />          
        <classpath refid="classpath" />            
     </javac>      
  </target>

<target name="create.jar" description="Test.jar">
            <jar destfile="Test.jar">
                  <zipfileset dir="..Specify" includes="Specify package names to be included here" />
            </jar>
</target>
0
 
LVL 6

Expert Comment

by:jwenting
ID: 24857522
You can actually have an ANT target extract things from version control.
See the specified sample file above, which contains just such a target.
0
 

Author Comment

by:ank9
ID: 24857999
Thanks for replying.

I am using the following target

 <target name="moveJarToAppServer" >
   <move todir="{$appserver.webappname}/WEB-INF/lib"  verbose="true" >
    <fileset dir="${install.jar}">
        <include name="**/*" />
    </fileset>
   </move>
 </target>

This does not do anything. Is there a way to find out if all the paths etc are correct? May be by putting some print statements. Something similar to System.out.print() in Java.

Please let me know how this can be done.

Thank you



0
 
LVL 92

Expert Comment

by:objects
ID: 24858032
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
In this post we will learn different types of Android Layout and some basics of an Android App.
The viewer will learn how to implement Singleton Design Pattern in Java.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question