I am new to Ant scripts.
below is description of requirement
in my workspace, there are various projects and I have to have my project work on RAD and eclips
I'd suggest using Apache ivy for managing complex classpaths. It externalizes your build dependencies into a separate ivy.xml file.
Secondly, ivy can automatically download such dependencies, reducing the size of your project under source control.
Finally, this solution at first glance might appear horribly complex. It's advantage is that it's compatible with other build technologies such as Maven.
Ivy uses "configurations" to manage logical groupings of jars.
In this example the code compiles against the SLF4J api jars, but at run-time use different logging implementations:
Notes:
The ivy ANT tasks are imported as an antlib. The ivy cachepath task is used to turn an ivy managed configuration into normal ANT paths and the ivy report task produces a dependency report.
..
..
The ivy retrieve task is used to populate a directory during your application's packaging phase:
An Eclipse plugin for ivy is available.
It's also possible to generate IDE configuration files using an embedded groovy task. Following is an Eclipse example:
import groovy.xml.MarkupBuilder
//
// Generate the project file
//
project.log("Creating .project")
new File(".project").withWriter { writer ->
def xml = new MarkupBuilder(writer)
xml.projectDescription() {
name(project.name)
comment()
projects()
buildSpec() {
buildCommand() {
name("org.eclipse.jdt.core.javabuilder")
arguments()
}
}
natures() {
nature("org.eclipse.jdt.core.javanature")
}
}
}
//
// Generate the classpath file
//
// The "lib" classpathentry fields are populated using the ivy artifact report
//
project.log("Creating .classpath")
new File(".classpath").withWriter { writer ->
def xml = new MarkupBuilder(writer)
xml.classpath() {
classpathentry(kind:"src", path:args[0])
classpathentry(kind:"output", path:args[1])
classpathentry(kind:"con", path:"org.eclipse.jdt.launching.JRE_CONTAINER")
project.references.libfiles.each {
classpathentry(kind:"lib", path:it)
}
}
}