build.xml for running applets
hi all!! i am new with ant. For one of my projects, i need to write a simple build.xml for compiling and running java applets.. i am able to compile those applets but don't know how to run those.. can anyone help me in writing the code for running applets.. I searched in net for a sample code for the same but didn't had good luck.. Hoping to have some here.. Thanks in advance, Vimi Soman - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Perform a task for every folder from the file.
Any suggestions, please? mpr wrote: > > I have one more question connected with a topic as well. > > I use > match="^(~~.+)$" select="\1"/> > but i would like to do operation as fallows: > match="^(${prefix}.+)$" select="\1"/> > where ${prefix} is user defined property > > > How to do that? > > > > > mpr wrote: >> >> Yes, it works. >> >> Thanks a lot for a help >> >> >> Patrick Martin-2 wrote: >>> >>> You miss param="dir" in >>> >>> On 4/30/07, mpr <[EMAIL PROTECTED]> wrote: Looks cool for me but: >>> name="fullGenericTokenReplacements"> >>> property="src.file.head"/> >>> delimiter="${line.separator}"> I get BUILD FAILED C:\CMApplicationTools2\PackagingTools\build.xml:251: You must supply a property name to set on each iteration in param What to do with that? Patrick Martin-2 wrote: > > Hello, > > I think you don't need to use antcount for that (even though this is a > great task ... ;-)) > > you should be able to load your file with loadfile, without filtering, > and then use ac:for with delimiter="${line.separator}" > > [...] > > >>> delimiter="${line.separator}"> > [...] > > > Rgds, > > Patrick > > On 4/30/07, Camer38 <[EMAIL PROTECTED]> wrote: >> >> It is a part of a bigger application so I cannot change the version af >> Ant. >> I would like to follow my fir idea , that almost work. The problem that I >> have >> is describe below. >> >> >> I have the file user.properties and inside a paths to folders are defined >> e.g. >> C:\CMDOCUMENTATION4\DOCCENTER\BUILD >> C:\CMApplicationTools2\PackagingTools >> >> For each folder from user.properties I need to perform a task. >> I read a file and for each line I create a property(${prefix}) starting >> with >> ~~ >> >> >>> >> property="src.file.head"> >> >> >> >> >>> >> property="nb.matching.tokens" match="^(.+)$"> >> >> >>> >> propertyprefix="${prefix}" select="\1"/> >> >> >> >> >> >> >> >> >>> >> delimiter="${delimiter}" >> match="~~(.+)" select="\1"/> >> >> >> >> >> At the end of the target I need a list of all those properties so, I use >> ac:propertyselector but I do not get a right result. What I received is >> a >> path b-to-file but without \ character. >> Do you have an idea why? >> Could you suggest a right solution, please? >> counteach task is taken from: >> http://antcount.sourceforge.net/ >> >> >> >> OUTPUT >> >> >> genericTokenReplacement: >> [echo] 2 >> [echo] C:\CURAMDOCUMENTATION4\DOCCENTER\BUILD >> [echo] C:\CuramApplicationTools2\PackagingTools >> [echoproperties] #Ant properties >> [echoproperties] #Mon Apr 30 14:21:19 BST 2007 >> [echoproperties] ~~C\:\\CURAMDOCUMENTATION4\\DOCCENTER\\BUILD=1 >> [echoproperties] ~~C\:\\CuramApplicationTools2\\PackagingTools=1 >> [echo] >> C:CURAMDOCUMENTATION4DOCCENTERBUILD,C:CuramApplicationTools2PackagingTools >> >> >> >> >> >> Matt Benson wrote: >> > >> > I didn't read your error message closely enough the >> > first time. It shows that is taken as >> > belonging to the ac namespace, indicating it couldn't >> > be found in the default namespace. The example >> > requires Ant 1.7 . >> > >> > -Matt >> > >> > --- mpr <[EMAIL PROTECTED]> wrote: >> > >> >> >> >> I have followed your instructions, download the >> >> latest AC release and build >> >> ant-contrib.jar from source but I still get the same >> >> error. >> >> What do I have to do? >> >> >> >> >> >> >> >> Matt Benson wrote: >> >> > >> >> > I can't recall when AC last had a release; you >> >> might >> >> > have to build from the current source, wherein >> >> >> >> > can handle any type that returns an Iterator. >> >> > >> >>
Re: build.xml for running applets
>From : http://java.sun.com/docs/books/tutorial/deployment/applet/index.html In order to load an applet in a web page, you must specify the applet class with appropriate applet tags. A simple example is below: For development and testing purposes, you can run your applet using the lightweight appletviewer application that comes with the JDK. For example, if AppletWorld.html is the html file name, then you run the command as appletviewer AppletWorld.html You can use ANT to compile your applet Java files. See :http://ant.apache.org/manual/CoreTasks/javac.html This javac task itself must be written in a build.xml file http://ant.apache.org/manual/using.html ANT also has 'exec' task which can execute any commands. So appletviewer command can also be called from ANT's build.xml. Hope this helps. -Prashant On Tue, 2007-05-01 at 14:49 +0550, vimisoman wrote: > hi all!! > i am new with ant. For one of my projects, i need to write a simple build.xml > for compiling and running java applets.. i am able to compile those applets > but don't know how to run those.. can anyone help me in writing the code for > running applets.. I searched in net for a sample code for the same but didn't > had good luck.. Hoping to have some here.. > > Thanks in advance, > > Vimi Soman > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- -Prashant Don't upload, just share : www.dekoh.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: build.xml for running applets
Thanks for the response but my problem is not about writing applet code... but it is about writing a build.xml for executing the applets.. i wrote a build for compiling and running java stand alone programs.. but now i want to write a build for executing a simple java applet. eg. for running a compiled java application, I want to know, similarly how to run a compiled applet pgm, using build. Hope you understood my problem now.. Thanks for the concern, Vimi Soman > >From : > http://java.sun.com/docs/books/tutorial/deployment/applet/index.html > > In order to load an applet in a web page, you must specify the applet > class with appropriate applet tags. A simple example is below: > > > > For development and testing purposes, you can run your applet using the > lightweight appletviewer application that comes with the JDK. For > example, if AppletWorld.html is the html file name, then you run the > command as > > appletviewer AppletWorld.html > > You can use ANT to compile your applet Java files. > See :http://ant.apache.org/manual/CoreTasks/javac.html > > This javac task itself must be written in a build.xml file > http://ant.apache.org/manual/using.html > > ANT also has 'exec' task which can execute any commands. > So appletviewer command can also be called from ANT's build.xml. > > Hope this helps. > -Prashant > > On Tue, 2007-05-01 at 14:49 +0550, vimisoman wrote: > > hi all!! > > i am new with ant. For one of my projects, i need to write a simple > build.xml > > for compiling and running java applets.. i am able to compile those applets > > but don't know how to run those.. can anyone help me in writing the code for > > running applets.. I searched in net for a sample code for the same but > didn't > > had good luck.. Hoping to have some here.. > > > > Thanks in advance, > > > > Vimi Soman > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > -- > > -Prashant > > Don't upload, just share : www.dekoh.com > > > - > 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]
Re: Re: build.xml for running applets
> I want to know, similarly how to run a compiled applet pgm, using build. > Hope you understood my problem now. Yes, I also addressed this towards the end of my last email. Reproducing here... ANT also has 'exec' task which can execute any commands. So appletviewer command can also be called from ANT's build.xml. http://ant.apache.org/manual/CoreTasks/exec.html Also once you have embedded the call your applet class in a HTML file, you can launch a browser and ask browser to open that html file. HTH On Tue, 2007-05-01 at 16:05 +0550, vimisoman wrote: > Thanks for the response but my problem is not about writing applet code... > but it is about writing a build.xml for executing the applets.. i wrote a > build for compiling and running java stand alone programs.. but now i want to > write a build for executing a simple java applet. > > eg. for running a compiled java application, > >depends="compile"> > classpath="./build;." > classname="Mypgm"/> > > > > I want to know, similarly how to run a compiled applet pgm, using build. > Hope you understood my problem now.. > > Thanks for the concern, > > Vimi Soman > > > > > >From : > > http://java.sun.com/docs/books/tutorial/deployment/applet/index.html > > > > In order to load an applet in a web page, you must specify the applet > > class with appropriate applet tags. A simple example is below: > > > > > > > > For development and testing purposes, you can run your applet using the > > lightweight appletviewer application that comes with the JDK. For > > example, if AppletWorld.html is the html file name, then you run the > > command as > > > > appletviewer AppletWorld.html > > > > You can use ANT to compile your applet Java files. > > See :http://ant.apache.org/manual/CoreTasks/javac.html > > > > This javac task itself must be written in a build.xml file > > http://ant.apache.org/manual/using.html > > > > ANT also has 'exec' task which can execute any commands. > > So appletviewer command can also be called from ANT's build.xml. > > > > Hope this helps. > > -Prashant > > > > On Tue, 2007-05-01 at 14:49 +0550, vimisoman wrote: > > > hi all!! > > > i am new with ant. For one of my projects, i need to write a simple > > build.xml > > > for compiling and running java applets.. i am able to compile those > > > applets > > > but don't know how to run those.. can anyone help me in writing the code > > > for > > > running applets.. I searched in net for a sample code for the same but > > didn't > > > had good luck.. Hoping to have some here.. > > > > > > Thanks in advance, > > > > > > Vimi Soman > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to set the next week start date
Hi, Actually what i need is irrespective of the current date, i need the starting date of the next week and starting date of the last week.. - Original Message - From: "Gilbert Rebhan" <[EMAIL PROTECTED]> To: "Ant Users List" Sent: Saturday, April 28, 2007 1:03 AM Subject: Re: How to set the next week start date > > Hi, > > Ninju Bohra wrote: > > Have you looked at the task (http://ant.apache.org/manual/CoreTasks/tstamp.html) > > > > Maybe something like: > > > > > >> offset="7" unit="week"/> > > > > i tried that on Win2000, with jdk 1.5.0_11 ant 1.6.5 > > > > > offset="7" unit="week"/> > > > > > >Antversion == ${ant.version} >Today == ${TODAY} > >$${touch.time} == ${touch.time} > > > > > and it gave me = > > Buildfile: J:\eclipse_3_2\workspace\AntTest\tstamp.xml > depends: > main: > [echo] Antversion == Apache Ant version 1.6.5 compiled on June 2 2005 > [echo] Today == April 27 2007 > [echo] > [echo] ${touch.time} == 19/15/2007 09:19 PM > BUILD SUCCESSFUL > Total time: 156 milliseconds > > > hm, strange 19/15/2007 ?? > > i think you meant something like = > > >offset="-7" unit="day"/> > > > or > > >offset="7" unit="day"/> > > > > similar to the example from manual : > > >offset="-5" unit="hour"/> > > > > but that gives him the actual date minus | plus 7 days. > > > Also when you say 'set the current date' what does that mean? > > If you want to calculate what '7 days from now and set it to an ANT > > property' > >please look at the task otherwise please provide more > >explaination on what you need. > > I thought the original poster was asking for > > "... > the next weeks start date and last week start date > ..." > > because of that i suggested the
Re: How to set the next week start date
Thanks Charles, Actually i need the starting date of the next week and last week .. - Original Message - From: <[EMAIL PROTECTED]> To: Sent: Friday, April 27, 2007 7:00 PM Subject: RE: How to set the next week start date > On what day (for your purposes) does a week start? > Will you take holidays into account? > If so, what country's holidays will figure in? > Are there any local holidays that should be taken into account? > > -- > Charles Knell > [EMAIL PROTECTED] - email > > > > -Original Message- > From: Satheesh <[EMAIL PROTECTED]> > Sent: Fri, 27 Apr 2007 15:21:12 +0530 > To: "Ant Users List" > Subject: How to set the next week start date > > Hi Guys, If i want to set the current date its possible in ANT , even if i want a date which is some 'n' days after the current date, that also is possible.. > > I need a way to set the value of the next weeks start date and last week start date using ANT. > > How can i achieve this/// > > > - > 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]
RE: Re: How to set the next week start date
That's fine, but: On what day (for your purposes) does a week start? -- Charles Knell [EMAIL PROTECTED] - email -Original Message- From: Satheesh <[EMAIL PROTECTED]> Sent: Tue, 1 May 2007 17:16:50 +0530 To: "Ant Users List" Subject: Re: How to set the next week start date Thanks Charles, Actually i need the starting date of the next week and last week .. - Original Message - From: <[EMAIL PROTECTED]> To: Sent: Friday, April 27, 2007 7:00 PM Subject: RE: How to set the next week start date > On what day (for your purposes) does a week start? > Will you take holidays into account? > If so, what country's holidays will figure in? > Are there any local holidays that should be taken into account? > > -- > Charles Knell > [EMAIL PROTECTED] - email > > > > -Original Message- > From: Satheesh <[EMAIL PROTECTED]> > Sent: Fri, 27 Apr 2007 15:21:12 +0530 > To: "Ant Users List" > Subject: How to set the next week start date > > Hi Guys, If i want to set the current date its possible in ANT , even if i want a date which is some 'n' days after the current date, that also is possible.. > > I need a way to set the value of the next weeks start date and last week start date using ANT. > > How can i achieve this/// > > > - > 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Probable bug found: scp task does not handle correctly directories containing subdirectories
http://ant.apache.org/manual/OptionalTasks/scp.html M-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: "Jean-Noël Rivasseau" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, May 01, 2007 9:52 AM Subject: Probable bug found: scp task does not handle correctly directories containing subdirectories Hi, I posted this on the user list but noone answered, I have better luck here. I am using Ant 1.6.5 and Ant 1.7 on Gentoo Linux amd64, and the same behavior appears. When using the scp task, I cannot copy a directory that contains subdirectories. When copying a directory that has no subdirectories, things work fine, but any directory with subdirs in it will cause the scp task to hang. By hang, I mean that the scp task when Ant is loaded from the command line never finishes. Should a bug report be filed? Is this normal behavior? My code: Note that there are no errors related to authentication or whatever. Just changing the fileset dir attribute to some directory that has no subdirectories makes the whoile thing work perfectly. Jean-Noël - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Probable bug found: scp task does not handle correctly directories containing subdirectories
Yes, but there was a bug! The manual example was not working. Actually I finally found the bug: http://issues.apache.org/bugzilla/show_bug.cgi?id=41090 It is due to jsch 0.1.30 On 5/1/07, Martin Gainty <[EMAIL PROTECTED]> wrote: http://ant.apache.org/manual/OptionalTasks/scp.html M-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: "Jean-Noël Rivasseau" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, May 01, 2007 9:52 AM Subject: Probable bug found: scp task does not handle correctly directories containing subdirectories > Hi, I posted this on the user list but noone answered, I have better luck > here. > > I am using Ant 1.6.5 and Ant 1.7 on Gentoo Linux amd64, and the same > behavior appears. > > When using the scp task, I cannot copy a directory that contains > subdirectories. When copying a directory that has no subdirectories, > things > work fine, but any directory with subdirs in it will cause the scp task to > hang. > > By hang, I mean that the scp task when Ant is loaded from the command line > never finishes. > > Should a bug report be filed? Is this normal behavior? > > My code: > > keyfile="${user.home}/.ssh/id_rsa" passphrase="" verbose="true"> > > > > Note that there are no errors related to authentication or whatever. Just > changing the fileset dir attribute to some directory that has no > subdirectories makes the whoile thing work perfectly. > > Jean-Noël >
Files exist using ftp task?
Good day all, I am trying to copy files using the ftp task and a fileset include which is working just fine. The problem I am having is I need to know when 0 files retrieved so that I can send an email if the files are not there. Is there a way to check to see if the files exist using the ftp task? Thanks, Julie Julie Robertson Commercial Leveraged Application Services 918.661.3850 [EMAIL PROTECTED]
Reporting build success/failure in /'s output log file?
Hi - I'm working on a project that builds a number of subprojects in a dynamically-determined order, based on some information we define in properties. The problem I'm running into is in logging the subprojects - (and therefore ) hardcodes its subproject's build listener as DefaultLogger at log level INFO. In a perfect world, I'd like to be able to set that log level myself, but the more significant issue is that I can't just look at the subproject's logfile and see whether it failed or passed. The subprojects are not just Java - we have macro'd wrappers around calls to InstallShield and Visual Studio on Windows, among other things - so it's not like there's an easy pattern to look for in case of failure. In an earlier incarnation of this project, I extended Ant.java and basically rewrote it to use a custom-set log level, to return properties (like ant-contrib's , but also allowing for wildcards), to use a failonerror attribute like , and to run newProject.fireBuildFinished after executing the subproject, so that we got either BUILD SUCCESSFUL or BUILD FAILED in the subproject's log file. I got the older version of the project working with Ant 1.7, but it was an ugly and painful process that I'd really like to avoid having to go through again when Ant changes down the road. The new version no longer needs the returned properties, and now that I understand better, I think I can use that instead of and get the failonerror behavior that way. That leaves only the custom log level and getting BUILD SUCCESSFUL/BUILD FAILED in the subproject's logs to go. I see that fireSubBuildFinished is called in , but since the subproject's listener is hardcoded as DefaultLogger, that doesn't do anything - I can use my own listener for the main project and report the subproject's results in the main project's logfile, but I really want to have that go into the subproject's logfile - we have a bunch of other tools for reporting, integrating with our build management system, working with an external distribution tool, etc that get run as subprojects. The subprojects know how to get at the logfiles for the other subprojects (through the information we're storing in globally-defined properties), and can therefore determine which subprojects have failed or passed just by finding the logfile for a subproject and looking for BUILD SUCCESSFUL/BUILD FAILED. Is there any way to do this without having to subclass Ant.java? I'm not married to the output being BUILD SUCCESSFUL or BUILD FAILED specifically - any pass/fail string that I can do a regexp for would be sufficient. Any help/advice/etc anyone could provide would be greatly appreciated. Thank you! Andrew Bayer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Ftp task question again
Sorry about sending this again, I guess I removed myself from the users list in error, so I wanted to add myself back in and resend this in case someone has an idea to solve my issue. I am trying to copy files using the ftp task and a fileset include which is working just fine. The problem I am having is I need to know when 0 files are retrieved so that I can send an email if the files are not there. Is there a way to check to see if the files exist using the ftp task? Thanks for your time, Julie Julie Robertson Commercial Leveraged Application Services 918.661.3850 [EMAIL PROTECTED]
RE: Ftp task question again
Do you know ahead of time what the filenames might be?If so, then you could do something like this: For one of the files. -Original Message- From: Robertson, Julie [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 01, 2007 1:28 PM To: Ant Users List Subject: Ftp task question again Sorry about sending this again, I guess I removed myself from the users list in error, so I wanted to add myself back in and resend this in case someone has an idea to solve my issue. I am trying to copy files using the ftp task and a fileset include which is working just fine. The problem I am having is I need to know when 0 files are retrieved so that I can send an email if the files are not there. Is there a way to check to see if the files exist using the ftp task? Thanks for your time, Julie Julie Robertson Commercial Leveraged Application Services 918.661.3850 [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Ftp task question again
By using the wildcard character I could build the file name, but how do I specify the server and location of the file, or do I actually do that inside the ftp task? -Original Message- From: Loehr, Ruel [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 01, 2007 1:34 PM To: Ant Users List Subject: RE: Ftp task question again Do you know ahead of time what the filenames might be?If so, then you could do something like this: For one of the files. -Original Message- From: Robertson, Julie [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 01, 2007 1:28 PM To: Ant Users List Subject: Ftp task question again Sorry about sending this again, I guess I removed myself from the users list in error, so I wanted to add myself back in and resend this in case someone has an idea to solve my issue. I am trying to copy files using the ftp task and a fileset include which is working just fine. The problem I am having is I need to know when 0 files are retrieved so that I can send an email if the files are not there. Is there a way to check to see if the files exist using the ftp task? Thanks for your time, Julie Julie Robertson Commercial Leveraged Application Services 918.661.3850 [EMAIL PROTECTED] - 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]