Solved

Ant: extract from CVS and compile java code

Posted on 2009-07-14
5
357 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
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now