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
Solved

Ant: extract from CVS and compile java code

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jar file executable 12 58
Automated testing suggestions? 2 61
Convert from a json string array to a Java object 3 51
ejb mdb examples 1 6
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

809 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