How to setup Ant working directory

Hello,
I have a problem running ant script in TC. It works fine when running from clean Ant but when setupping it from TC it always fails. The problem I discovered is that the script is not written well and it needs to be run from one exact directory (otherwise the relative paths in the script are not evaluated correctly).
I know that this is mainly the problem in the script but anyway... is there a way to setup the directory from which the ant build will be started?
If there is, it would save me time when fixing the script...
PP

6 comments

Hello,

We have "Build working directory" setting for most build runners.
Is it what you need?

Regards,
KIR

0

No Kirill, it is not.
I tried to change this "Build working directory" but it is just the directory where to check out the files from CVS. This is fine.
When the files are checked out, ant script is started to build from these files the distribution. Unfortunatelly, the script needs to be started from an exact directory (within the checked out files), if it is not, the build fails.
So what I need is not to change the directory where to check files out but need to set the directory from which to start the ant script.

0

I have a problem running ant script in TC. It works
fine when running from clean Ant but when setupping
it from TC it always fails. The problem I discovered
is that the script is not written well and it needs
to be run from one exact directory (otherwise the
relative paths in the script are not evaluated
correctly).
I know that this is mainly the problem in the script
but anyway... is there a way to setup the directory
from which the ant build will be started?
If there is, it would save me time when fixing the
script...


Not knowing exactly what the problem is, I have 2 suggestions:
1) Make sure that the path to the build.xml file in Build Runner is correct in TeamCity.
2) The script (build.xml?) problem may just need to have basedir value set to the current
directory.
e.g.: ]]>

Hope that helps.

-Dave

0

You're right Dave that the problem is in the build.xml file. My question is whether the 'basedir' property is possible to be set from TC build settings.

0

Hmm. What about passing system property "basedir" to the build? Like
-Dbasedir=value or system.basedir=value ?

0

I've created a feature request to add the directory that should be made current before the build.

You can vote for it: http://www.jetbrains.net/jira/browse/TW-2847

--
Best regards,

Yegor Yarko
Quality Assurance Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Please sign in to leave a comment.