Friday, September 17, 2004

Copying latest file from a dir using ANT

I was using ANT to create the entire migration process, part of this process involves copying the latest jar from a location into my location machine and unjaring it. But I am not able to locate an ant task that picks up the latest file from a dir and copys it to the local machine.

I am not able to the latest file from a dir using ant??

It seems quite difficut since ant is a very low level build tool and doenst actually do anything much, rather it doest do the stuff that I want it to do.

Here is what I want.

1. Clean the local classes dir (done)
2. Clean the k drive classes dir (done)
3. Pick up the latest prod jar file and copy to local k drive ( this is not possible since there doesnt seem to be a method on ant that I can use to pick up the last modified file from a dir )
4. Unjar the file.


All the above steps will just get me that latest files
Next I need to do that following in a sort of loop

1. Prompt for Package Name that I would like to migrate (manual entry)
2. Clean the corresponding folder in the k drive classes
3. Check out the head from cvs into the dev/src
4. Get the log for build.xml from the current package, this will display all the tags etc.
5. Prompt to enter the tag to update too
6. Incase of differences display and pause. So that the user can open another window and solve the problem and then reexecute step 5.
7. Call a target from the build file for clean compile

20Sep04
After having a look around I realized that I cannot all this stuff using ANT I needed some kind of scripting tool like UNIX shell script, I had a talk with Hermit Dave and asked him if he had any information of a scripting tool in windows and he suggested that I use 'Windows Scripting Host', rit now I am having a look at and it seems that I can achive what I want using 'Windows Scripting Host'

22Sep04
Hmm tried using windows scripting host, I guess a lot can be achieved by this method raher than ANT but I am not that good at WSH so I think I am not using the correct ActiveX object to get the job done, anyways I have some work now (real work) so I am getting back to that untill the next release where I again feel that I should have done someting about automating the migration process.

No comments: