Basically you should make any task as atomic as
possible.  So all your task would need to know about
is a <fileset>.  Then it becomes the user's problem
how to select which files to include.  One way might
be to use a <tstamp>
to set a baseline time, then compile, then use a
<date> file selector to get the updated classes. 
Another way might use ant-contrib's <outofdate> to
determine which sources should be recompiled.  You
could then compile only those sources to some
temporary build area, then hotswap only those classes.
 The point is that others have designed ways in which
the files can be selected, so you gain maximum
flexibility (and minimum RESPONSIBILITY) the less your
Task is expected to do.

-Matt

--- [EMAIL PROTECTED] wrote:
> When I was toying with a separate task, I wondered
> if <uptodate> could be use
> somehow to create a <fileset>. I don't see now, but
> that would sure be a nice
> feature. Then, if I could assign an ID so I could
> make a <fileset> of files
> that aren't uptodate, run the compile, then take
> that same <fileset> as input
> to the <hotswap> target.
> The idea of a timestamp file could work. The
> sequence might be something like.
> <touch file="timestamp"/>
> <javac .../>
> <hotswap classesdir="foo" host="localhost"
> port="9000" timefile="timestamp">
>   <patternset>
>      ... some pattern to apply to the classes dir
> ...
>   </patternset>
> </hotswap>
> 
> That way, the hotswap task would check the files in
> the classes dir based on the
> patternset and/or the timestamp.
> 
> Seriously, I'm open to feedback. I might as well do
> it right the first time!
> 
> David
> 
> Quoting Steve Loughran <[EMAIL PROTECTED]>:
> 
> > [EMAIL PROTECTED] wrote:
> > > I'd like to not only build (using Ant) when I'm
> using VIM, but hotdeploy
> > the
> > > class changes to a running app. I use ant.vim
> and it works very nicely.
> > Then, I
> > > wrote a hotswap client using JDI. Now, I can run
> that via the commandline,
> > but
> > > I'd rather integrate it into Ant.
> > > I toyed with doing a separate task, but I
> thought I'd just end up redoing
> > some
> > > code that was already in <javac>. So, for a
> proof of concept, I've added
> > some
> > > attributes to the <javac> task and am in the
> process of finishing the
> > > connections to the hot swap code. Basicly, once
> the compile is done, if
> > hotswap
> > > was enabled, it would connect to the VM and push
> those class files over.
> > > 
> > > First, does anyone have any better idea of how I
> could integrate the
> > hotswap
> > > feature into Ant?
> > > Second, is there a good way to get a list of the
> actual fully qualified
> > class
> > > names that were compiled? I have the list of
> files, but I'd have to try to
> > > parse out the class name, which I don't have a
> good solution for yet. I
> > just
> > > really need the classes dir (destDir) and the
> names of all the classes to
> > be
> > > replaced in the VM.
> > > 
> > 
> > Better to make it a separate task, if possible.
> > One problem with getting a list of compiled
> classes is that the compiler 
> > (be it javac, jikes, etc), makes its own mind up.
> So not even javac knows.
> > 
> > A separate <hotswap> task could take a fileset of
> classes, and maybe 
> > some timestamp file; all files after the timestamp
> file are deployed & 
> > the timestamp file is touched.
> > 
> > 
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to