28

Can anyone give me an example of what the Artifact paths setting defined for a build configuration could look like if I want to create two artifacts dist and source where I am using the sln 2008 build runner and building my projects using the default bin/Release?

**/Source/Code/MyProject/bin/Release/*.* => dist
**/*.* => source

I get two artifact roots dist and source but under dist I get the whole directory structure (Source/Code/MyProject/bin/Release) which I don't want and under source I get the whole thing along with obj and bin/Release which I do not want.

Can you give some advice on how to do this correctly?

Do I need to change the target location for all the projects I am building to be able to get this thing to work?

Luke Puplett
  • 42,091
  • 47
  • 181
  • 266
Xerx
  • 3,755
  • 8
  • 32
  • 28

2 Answers2

28

So you'll just need:

Source\Code\MyProject\bin\Release\* => dist
Source\**\* => source

This will put all the files in release into a artifact folder called dist and everything in Source into a artifact folder called source.

If you have subfolders in Release try:

Source\Code\MyProject\bin\Release\**\* => dist
brian d foy
  • 129,424
  • 31
  • 207
  • 592
Scott Cowan
  • 2,652
  • 7
  • 29
  • 45
  • 3
    what happens if your path has a space in it? I've tried path in quotes and using "\ " and neither seems to work.... – David Alpert Dec 11 '12 at 16:12
  • How could I use that artifact folder in a dependency? e.g.: B -> A. I set A's artifacts paths in dependencies as "target-directory\**\* => ." I set B's artifacts paths in general settings as "**/* => target_directory" Is it right? Thanks – Cirelli94 Sep 28 '17 at 16:02
  • The reason that the full path is brought over is because the source path has a wildcard in the path (the `**` at the start). You either need to define the path in full like in this answer or use params to pass it through. – Richard Ockerby Feb 10 '20 at 14:45
0

According to TeamCity documentation; it should be like this:

file_name|directory_name|Ant-like wildcard [ => target_directory ]

So..

Source\Code\MyProject\bin\Release|**\* => dist  (| not \)
oleksii
  • 35,458
  • 16
  • 93
  • 163
user233173
  • 45
  • 1
  • 3