[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [Subclipse-dev] Regarding svnant checkout using JavaAPI

From: Daniel Rall <dlr_at_collab.net>
Date: 2006-02-11 01:41:25 CET

On Tue, 27 Dec 2005, aman mahajan wrote:

> Hi,
>
> I am creating a small front end for my project which
> will be having 1-2 customized build related tasks.
>
> I am using Java APIs of ant to implement that.
> As our repository is SVN so I am using svnant for some
> svn tasks.

Hi Aman. In what way are the existing tasks deficient? Why is an Ant
build file insufficient to drive them?

> But it is throwing null pointer exception when try to
> execute tasdef.

Please provide the stack trace.

Thanks, Dan

> /*
> * testAnt.java
> *
> * Created on December 27, 2005, 11:53 AM
> */
> import java.io.File;
> import java.net.MalformedURLException;
>
> import org.apache.tools.ant.*;
> import org.apache.tools.ant.taskdefs.Mkdir;
> import org.apache.tools.ant.taskdefs.Taskdef;
> import org.apache.tools.ant.types.FileSet;
> import org.apache.tools.ant.types.Path;
> import org.tigris.subversion.svnant.*;
> import org.tigris.subversion.svnclientadapter.SVNUrl;
> //import
> org.tigris.subversion.svnclientadapter.javasvn.commands.CheckoutCommand;
> /**
> *
> * @author aman_m`ahajan
> */
> public class testANt {
>
> /** Creates a new instance of testAnt */
> public static void main(String arg[]){
> Project project = new Project();
> try {
> project.init();
> } catch (BuildException e) {
> e.printStackTrace();
> }
> File f = new File("C:\\antAman");
>
> //Creates the new target
> //Target copyFile = new Target();
> Target checkout = new Target();
>
>
> //Sets the name of target
> //copyFile.setName("copyFile");
> checkout.setName("checkout");
>
> //Adds the target to the project
> //project.addTarget(copyFile);
> project.addTarget(checkout);
>
> //Mkdir is subclass of task class (This portion is
> ther
> // to define the tasks and set the values accordingly
> /*Mkdir makedir = new Mkdir();*/
> Taskdef td = new Taskdef();
> //td.setName("useSvn");
> td.setResource("org.tigris.subversion.svnant.SvnTask");
> //td.setClassname("org.tigris.subversion.svnant.SvnTask");
>
> Checkout co = new Checkout();
> //Sets teh task name
> //makedir.setTaskName("makedir");
>
> //As this task is related to creation of dir so setDir
> is required
> //makedir.setDir(f);
> //sets the project in target.
> //makedir.setProject(project);
>
> co.setProject(project);
> SVNUrl urlS = null;
> try {
> urlS = new
> SVNUrl("http://x5.com/repo/branches/B2006_1_1/equicom-admin-common-web");
> } catch (MalformedURLException e1) {
> e1.printStackTrace();
> }
> co.setUrl(urlS);
> co.setDestpath(f);
> //co.execute()
>
> td.setProject(project);
>
>
>
> td.setClasspath(pth);
> td.execute();
>
> //Add the task to target specified
> //copyFile.addTask(makedir);
> //checkout.addTask(co);
>
> //execute the target
> //copyFile.execute();
>
> }
> }
> ====================
>
> Actually there is no Javadocs for svnant so bit
> difficult to code too.
>
> Please help me to get rid of this problem so that i
> can check out the code.
>
> ~Aman
>
>
>
>
> __________________________________________
> Yahoo! DSL ? Something to write home about.
> Just $16.99/mo. or less.
> dsl.yahoo.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subclipse.tigris.org
> For additional commands, e-mail: dev-help@subclipse.tigris.org

-- 
Daniel Rall

  • application/pgp-signature attachment: stored
Received on Sat Feb 11 01:41:02 2006

This is an archived mail posted to the Subclipse Dev mailing list.