From: SourceForge.net <no...@so...> - 2006-10-11 08:28:53
|
Bugs item #1274114, was opened at 2005-08-26 15:33 Message generated for change (Comment added) made by peterkittreilly You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=416920&aid=1274114&group_id=36177 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: platform Group: v1.0 (example) Status: Open Resolution: None Priority: 5 Submitted By: Dirk Krummacker (krummacker) Assigned to: Matt Inger (mattinger) Summary: 'shellscript' task in the same target cannot be run twice Initial Comment: If a target contains the 'shellscript' task, and if during one invocation of Ant this target is executed twice, the second invocation fails with something along the lines of [shellscript] /bin/sh: /tmp/script2023260757null: Datei oder Verzeichnis nicht gefunden (the error message translates to "file not found") Steps to reproduce: 1) create a build.xml with a target "foo" containing a 'shellscript' task 2) run "ant foo foo" I also think I have found the reason for this behaviour: In the execute() method of the 'ShellScriptTask' (which inherits from 'ExecTask'), the super class method createArg() is being called and the name of the temporary shell script file is set. To my understanding, Ant creates one instance of the 'ShellScriptTask' class per occurrence in the build.xml file. Thus, if execute() is being called the second time, yet *another* Arg gets created and added. The first Arg which still exists however points to a temp file which is already deleted. Consequently, the next invocation of super.execute() then fails due to a 'file not found' error. I haven't tested this since I wasn't able to get the source distribution of 'ant-contrib' to compile, but I would suggest a bugfix along the following lines: 1) invoke super.createArg() only once (through lazy init maybe) and assign it to an instance field 2) in the execute() method, call setValue() on the instance field This should make sure that there is only one command line arg that always contains the proper file name. BTW: We here find 'ant-contrib' really helpful. Keep up the good work :-) Cheers, Dirk ---------------------------------------------------------------------- Comment By: peterkittreilly (peterkittreilly) Date: 2006-10-11 08:28 Message: Logged In: YES user_id=1614820 Thanks for the bug report. I will look into a fix. Note that due to a change in processing in Ant, the example will work with Ant 1.7.0. (in ant 1.7.0beta3 but not ant 1.7.0beta2). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=416920&aid=1274114&group_id=36177 |