RE: Weird compilation problems

2006-04-06 Thread Jon Skeet
> It seems that I do not have any inner classes. Here's the > source of the file: Using a switch/case with an enum apparently creates an extra class when compiling with javac. (A simple test class does the same thing - if you use "javap -c" to look at the 'extra' class I think you'll see it has

Only using taskdef if the task isn't already defined

2006-03-16 Thread Jon Skeet
I have a fairly complex sequence of Ant scripts, including top level scripts which call lower level scripts. All of them go through a general import phase, which includes doing some taskdefs. Now, I'd like to avoid doing the taskdefs in the lower level scripts if the tasks have already been loaded

RE: Changing the "leading directory" path on a directory tree

2006-03-16 Thread Jon Skeet
> I am not sure if I can explain this correctly, so I will show > you the target text and then explain the problem > The problem I am having is in the task (the > first task afterthe ), what I want to do is > convert filepaths that are provided in the @{file} attribute from > C:\dir_viewer

RE: basedir returning the canonical rather than absolute directory?

2006-03-10 Thread Jon Skeet
> Is there any way of suppressing this behaviour? And the answer is... yes: ant -f `pwd`/build.xml ... Jon Clearswift monitors, controls and protects all its messaging traffic in compliance with its corporate email policy using Clearswift products. Find out more about Clearswift, its solut

RE: basedir returning the canonical rather than absolute directory?

2006-03-10 Thread Jon Skeet
> I'm using ${basedir} to work out where to write files to (I > navigate around a bit). Unfortunately, if I'm working within > a symlinked directory, basedir ends up being the canonical > directory rather than the symlinked one. Sample project: > > > > > > > ${basedir} > > > >

basedir returning the canonical rather than absolute directory?

2006-03-10 Thread Jon Skeet
Hi folks, I'm using ${basedir} to work out where to write files to (I navigate around a bit). Unfortunately, if I'm working within a symlinked directory, basedir ends up being the canonical directory rather than the symlinked one. Sample project: ${basedir} Run this from a symlin

RE: junit & ant

2006-03-09 Thread Jon Skeet
> I am sure that most of you have seen this message com across > the list before. I am trying to use junit with ant. I want > to be able to have the junit.jar file reside somewhere else > than in the ANT_HOME/lib directory. I have searched the web > for ideas about how to solve this problem

RE: Support for JUnit 4?

2006-02-23 Thread Jon Skeet
> On Tue, 21 Feb 2006, Marian Petras <[EMAIL PROTECTED]> wrote: > > > I would like to know about the current status of Ant's support for > > JUnit 4. > > The junit task currently only supports JUnit 3 style tests, > this means you must wrap your JUnit 4 tests in a > JUnit4TestAdapter in order

RE: Help with Microsoft visual source safe ant task

2006-02-13 Thread Jon Skeet
> We learned the same lesson. If files are checked out of vss, > then getting the files will either not get the file or will > get an older version of the file (i do not recall which is true). Doing a "get latest" will get the latest version which has been checked into the VSS database. It (ob

RE: Help with Microsoft visual source safe ant task

2006-02-13 Thread Jon Skeet
> I am new to Microsoft visual source ant task. I am trying to > checkout using ant.There is also get for vss.what is the > difference ? . what is the right syntax Under VSS, check out means "get the file and acquire a lock on it". It fetches it read-write instead of read-only, and locks it so t

RE: Unable to archive properly

2006-01-03 Thread Jon Skeet
> Thank u for all the answers to my silly queries, here is a new one, > > I tried to create a jar file of the java classes in the > dest folder, but > it is creating a jar file with a info file namely > Manifest.mf"" which doesnt have any class files at all, > What could be th

RE: JUnit task

2005-12-06 Thread Jon Skeet
> >That's given your basedir as a pathelement - how about giving it the > >"testing" directory instead? Isn't that the base of the > testing classes? > > But I think that is correct. > The base dir is, say, xxx. The testing dir sits below this > with tests that are in the testing package. > So

RE: JUnit task

2005-12-06 Thread Jon Skeet
> > > so it seems the fileset bit works (finds the test) but > JUnit doesn't > >have > > > the classpath. > > > >Simply because you didn't provide any ;-) > > > >You'd need a nested (within ) with at least your > >"testing" directory, and any other jar(s) or directory(ies) > required to > >run

RE: how to (usably) include one JAR in another?

2005-12-01 Thread Jon Skeet
> How to make include the *contents* of another JAR, > rather than just that JAR file itself? What I mean: Have you tried using ? I haven't used it myself, but given the documentation, it looks like it's what you're after. Jon Clearswift monitors, controls and protects all its messaging traff

RE: Writing files

2005-11-28 Thread Jon Skeet
> Does any body know how to create a property file and write > some properties in it from ant? Do you know any ant task > which can do that? Absolutely - the optional task. Jon Clearswift monitors, controls and protects all its messaging traffic in compliance with its corporate email policy

RE: [tag] Re: The good ol' JUnit problem

2005-11-14 Thread Jon Skeet
> i didn't quite catch the resolution to this. is there a > solution to using a stock ant distribution , without > modifying your target environment (ANT_HOME/lib, ~/.ant/lib, > etc), and using the optional tasks such as junit, scp, ftp, > etc? if so, can someone give an example of how to do t

RE: JUnit task not working

2005-11-10 Thread Jon Skeet
> When i run the ant junit task i get the following error : Have you looked at the FAQ entry about Junit? See http://ant.apache.org/faq.html#delegating-classloader Have you placed your junit jar file (not the Ant one, Junit itself) in the ant\lib directory? Jon Clearswift monitors, controls a

RE: passing the name of a property file as parameter

2005-11-09 Thread Jon Skeet
> I forgott to say that was my first attemp. But I just > realized that I made another mistake. So it works now. > But now I can't access the values in the properties file. Which version of Ant are you using? It works fine with Ant 1.6.5 (see my other post for a short but complete example). J

RE: passing the name of a property file as parameter

2005-11-09 Thread Jon Skeet
> I don't remember the exact source I found the information, > but essentially this does not work. The token will not work > with a variable :( Firstly, the should *certainly* have worked. Nothing in the original post actually said he was trying to load the properties file. Secondly, it works

RE: The good ol' JUnit problem

2005-11-09 Thread Jon Skeet
> --- Jon Skeet <[EMAIL PROTECTED]> wrote: > [SNIP] > > I've made the change (as well as fixing up some HTML > > problems) and > > mailed the file to Steve for check-in. It looks like I > don't have SVN > > access after all - either that, or

RE: The good ol' JUnit problem

2005-11-08 Thread Jon Skeet
> FYI ${ant.home} is documented on > using.html#built-in-props > > ${ant.library.dir} should probably be documented alongside it > and share its caveat. Yup - I noticed that when I dived into SVN. (It's not in the online manual, which is what I was looking at before.) I've made the change (

RE: The good ol' JUnit problem

2005-11-08 Thread Jon Skeet
Steve wrote (replying to me): > > I think if Ant provided a property for its "home" location > ${ant.home}/lib > ${user.home}/.ant/lib You star. Could I suggest that ant.home should be added to the manual? (I did look on the website first, honest!) I suppose I could just edit it in CVS myself

RE: The good ol' JUnit problem

2005-11-08 Thread Jon Skeet
Steve wrote: > ${ant.home}/lib > ${user.home}/.ant/lib Having just checked the source, it's even easier than that (for the first one): ${ant.library.dir} Both ant.home and ant.library.dir work from Eclipse, too, which I had worried about a little bit... Assuming I actually *do* still have write-

RE: The good ol' JUnit problem

2005-11-08 Thread Jon Skeet
> This is a similar issue with the xalan classes in the 1.4 jdk. > they're exposed directly by sun (and other jvm's) as org.apache.*. > basically they just imported xalan and possibly other apache > classes into the jvm. this gives your entire application > (jvm) one chance to override the ver

RE: Classpath in external file

2005-11-01 Thread Jon Skeet
> I have a situation where I have a few projects, each one have > its own build, but all use the same classpath reference for > compilation. > I have a huge classpath defined, and I don't want to repeat > it in every single script. What I did so far is to define the > classpath in a certain pro

The good ol' JUnit problem

2005-10-28 Thread Jon Skeet
prefer this to adding the junit jar file to ant/lib, as that makes it harder to change versions of Junit.) For Eclipse, I can modify our "template workspace" to give Ant an extra global entry to the JUnit jar file. That shouldn't be too bad. Jon Skeet Senior Software Engineer CLEARSW

RE: How to call an ant script with parameters?

2005-10-27 Thread Jon Skeet
> Hi all > I didnt find an answer to this in the documentaion or in the > mailinglist archive: > > To run a ant script, I have to call it like this: > > Ant -buildfile MyAntScript.xml MyTarget > > I call my ant script using batch files on windows. Now I need > to set some parameters to the ant

RE: Importing files - at the end of the file or not?

2005-10-27 Thread Jon Skeet
> > They claim that an imported file is added to the *end* of the > > importing file. That would suggest to me that top-level > tasks in the > > imported file would get executed *after* the top-level > tasks in the importing file. > > I was wrong. I found out I was wrong last week. I will go

RE: ant file= ... - Return Build Status to calling script ?!

2005-10-27 Thread Jon Skeet
> i have a delegating ant script that sets some properties and > then calls another antscript. > > I need a way to pass the return status, means either Build > Failed or Build Successful, back to the calling script. > > Any ideas ? I believe that if the build fails, it will throw a BuildExcept

Importing files - at the end of the file or not?

2005-10-27 Thread Jon Skeet
I'm trying to update our build procedures using some of the guidelines in http://www.1060.org/blogxter/resources/5/ant-1.7.pdf They claim that an imported file is added to the *end* of the importing file. That would suggest to me that top-level tasks in the imported file would get executed *after