Changing the build working directory

Hi,
I've created the build and the sources are automatically checked out from CVS to the buildAgent\work\Server\myproject directory. How can I change this to different directory? In documentation I have found something like "build.working.dir" property but no explanation where/how to use it.
Thank you for help.

6 comments

Hello, Steve!

Seems, you need to set the "Build working directory" field on the your build runner (Ant/Maven2, etc.) configuration page.

You can then use the value in other properties by referring to it as "build.working.dir" (only if you need this).

Hope, this helps.

--
Best regards,

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

0

1) But I can't specify this for Ipr build runner.
2) If I use ant build runner and change the dir, then I have to change VCS Checkout mode to "Do not check out files automatically" right? Does this mean that I have to also update the files manually from vcs every day or is this still automatic?

0

Steve,

1) But I can't specify this for Ipr build runner.


This is true. IPR runner does not support changing the build working directory for now.
BTW, why do you want to change the directory for IPR runner?

2) If I use ant build runner and change the dir, then I have to change VCS Checkout mode to "Do not check out files automatically" right?

>Does this mean that I have to also update the files manually from vcs every day or is this still automatic?

Actually, no. Automatic checkout modes should work fine.

"Do not check out files automatically" option is usually used when sources are checked out from the VCS as part of the build process (in a build script).

--
Best regards,

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

0

BTW, why do you want to change the directory for IPR
runner?


Well maybe I am too complicated or missing something. The reason is following.

We have a multimodule project in IDEA. All the modules are using "relative paths" in iml files for storing dependencies to other modules, libs etc. We have iml files in CVS and our team is sharing them.

Example:
any path\Projects
|- Project1\Project1.iml
|- Project2\Project2.iml
|- Project3\Project3.iml
|- Libs
||- Apache\lib1.jar
||- Apache\lib2.jar

The Project3 is multimodule project and is dependent on Project1 and Project2. It has their iml files used as modules (option "use existing module" when adding module to project).

In our team everybody has the Projects directory in different place but inside the projects directory we have same structure. Thanks to using relative paths in iml files everything is working fine for everybody.

Now I want to put Project3 to TeamCity and create Ipr build runner for it. The project is by default checked out to the internal teamcity folder tree. To get the project compile I would have to move all dependent projects including all libs into that folder as well. It would be much easier to just tell TeamCity to checkout the Project3 to different directory, i.e. the Projects folder.

More complication comes when you have multiple Projects folders (e.g. per customer: Customer1Projects, Customer2Projects) and some projects in Customer1Projects have same names as projects in Customer2Projects. Now you have to mix everything together under TeamCity folder tree and have name conflicts. That is quite a problem.

This project scenario is used in our company. We have lots of projects and lots of customers. We want to use TeamCity to make things easier :).

0

Steve,

If I understand your structure right, I would configure each TeamCity project to contain all the sources (as VCS roots) that are used to build the project. e.g. TeamCity's project corresponding to Project3 would have VCS root for "Project3" directory as well as all dependent sources: Project1, Project2 directories in the case.

This way, TeamCity would correctly update all the VCS roots before the build, which will not be the case if TeamCity project does not have Project1 directory as one of VCS roots.

Of course, if TeamCityProject1 checks out Project1 and TeamCityProject3 checks out Project1, Project2 and Project3 the content of Project1 directory will be duplicated on agent's disk, but for the time being this seems to be the only reliable way to build projects with overlapping sources.

If you don't store libs in VCS this is another point that may require special handling. The most appropriate way seems to use IDEA's Path Variable feature to allow specifying libs path for each computer individually.

Our initial plan for next minor release include implementing pre- and post- tasks for Ipr runner that will allow to prepare the necessary structure: e.g. to copy the libs in place.
This may be of some help in setting up complex dependencies.

--
Best regards,

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

0

Thank you, I will try what you suggest. I will add all dependent projects into TeamCity project as VCS roots.

About the libs. I don't think it's a good idea to have big binaries stored in VCS. It tends to grow like crazy with each new version of library. What we do is that we have all libraries in one big library depository tree on the server share with all different versions of libs and docs etc. It has more than 2 gigs now. We synchronize changes in lib depository with local developer depositories regularly. Versions of libs are stored in iml files.

Anyway what I will do is that I will create ntfs symbolic link in the TeamCity project to the libraries repository.

0

Please sign in to leave a comment.