Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 86928 invoked from network); 13 Feb 2009 10:15:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Feb 2009 10:15:10 -0000 Received: (qmail 62558 invoked by uid 500); 13 Feb 2009 10:15:03 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 62530 invoked by uid 500); 13 Feb 2009 10:15:03 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 62519 invoked by uid 99); 13 Feb 2009 10:15:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Feb 2009 02:15:03 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [62.154.176.138] (HELO icon040.icongmbh.de) (62.154.176.138) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Feb 2009 10:14:54 +0000 Received: from icsrv02.icongmbh.de (unknown [192.168.195.2]) by icon040.icongmbh.de (Postfix) with ESMTP id 2C82313C85 for ; Fri, 13 Feb 2009 11:14:34 +0100 (CET) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: AW: setup environment for java task Date: Fri, 13 Feb 2009 11:14:33 +0100 Message-ID: <06080D44730F41428BAF2168FA8BDD8002ED4861@icsrv02.icongmbh.de> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: setup environment for java task Thread-Index: AcmNrHO0NPWX71HaT3uvRk4gvmPpgwABJmcgAAEc9JAAA3ygsA== References: <34721A41A7BCF54ABC3B116219A8C1C205564B71B8@NP1EXCH012.corp.halliburton.com> <06080D44730F41428BAF2168FA8BDD8002ED480F@icsrv02.icongmbh.de> <34721A41A7BCF54ABC3B116219A8C1C205564B71B9@NP1EXCH012.corp.halliburton.com> From: "Knuplesch, Juergen" To: "Ant Users List" X-Virus-Checked: Checked by ClamAV on apache.org Hello,=20 There are some interseting arguments to exec like spawn (standard is = false) etc. I never tried this, so someone else might know exactly. But I think it is worth a try to use the exec task for a test and see = what happens. I think it is possible to keep the settings of a Batchfile you run. Greetings --=20 J=FCrgen Knuplesch =20 Gesch=E4ftsf=FChrer: Uwe Seltmann HRB Stuttgart 17655 USt-IdNr.: DE 811944121=20 -----Urspr=FCngliche Nachricht----- Von: Shawn Castrianni [mailto:Shawn.Castrianni@halliburton.com]=20 Gesendet: Freitag, 13. Februar 2009 09:36 An: 'Ant Users List' Betreff: RE: setup environment for java task Thanks for the suggestion, but here is my problem: 1. These batch files are used at runtime from an end user after = installing the product with an installer. 2. Therefore, these batch files cannot be converted to ANT as that would = duplicate the logic and could get out of sync 3. I am trying to recreate = an end user's runtime environment with ANT so that I can launch our = application or run unit tests with the same environment which is why I = want to execute those same batch files 4. executing each batch file in = an exec task only affects the process spawned by the exec task and is = not remembered from one batch file to the next so when I finally launch = my java class, that environment from the batch files is already gone, I = think --- Shawn Castrianni -----Original Message----- From: Knuplesch, Juergen [mailto:Juergen.Knuplesch@icongmbh.de] Sent: Friday, February 13, 2009 2:05 AM To: Ant Users List Subject: AW: setup environment for java task Hello, I would translate the "bat" files to ANT-Tasks. This is a lot of work, but than your Antfile can decide what bat-jobs = you run and when. Another way is to run the bat-files itself inside Ant using the = exec-task, which is a bit tricky to handle. To be honest: I dont like Batchfiles, so I would prefer "translating" = the stuff to Ant, so that I have the control out of Ant. But maybe, if you need the Batchfiles as well, then you produce = redundancy, if you translate it to Ant. Greetings Juergen -- J=FCrgen Knuplesch -----Urspr=FCngliche Nachricht----- Von: Shawn Castrianni [mailto:Shawn.Castrianni@halliburton.com] Gesendet: Freitag, 13. Februar 2009 08:27 An: 'Ant Users List' Betreff: setup environment for java task Let's say I have a series of setupEnv.bat files in my source repository = that I need to execute as part of setting up my runtime environment = before executing my java code with the java task. I don't see an = elegant way of doing this. I could execute these bat files as part of = my build.bat before invoking ant itself. However, I don't like this = approach as it would interfere with my build environment. I only want = it to affect my runtime environment when I launch java code from my = build.xml. For example, my "build.bat compile" command should not = invoke the setupEnv.bat files, but my "build.bat launch" command should. = I don't want to start writing a lot of logic in my simple build.bat = script which just launches ant to detect what target is being run to = know whether to invoke the setupEnv.bat files. I was hoping for = something more elegant inside ANT itself. The java task already = provides a way to pass in environment variables, but I don't see how I = could have it execute some bat files first to setup the environment. Does anybody know of an elegant way of doing this or some 3rd party ant = plugin that can do it? I don't even know if it is possible in java. You would have to somehow = invoke a separate process and then feed it commands to run (like = executing batch files) to setup its environment, and then pass it the = JVM command line to finally invoke the java class. --- Shawn Castrianni ---------------------------------------------------------------------- This e-mail, including any attached files, may contain confidential and = privileged information for the sole use of the intended recipient. Any = review, use, distribution, or disclosure by others is strictly = prohibited. If you are not the intended recipient (or authorized to = receive information for the intended recipient), please contact the = sender by reply e-mail and delete all copies of this message. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional = commands, e-mail: user-help@ant.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional = commands, e-mail: user-help@ant.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org