Cannot get Build Parameter into build for "teamcity.build.changedFiles.file"

In reference to this thread:

http://www.jetbrains.net/devnet/message/5215524#5215524

I cannot figure out how to create my build parameter working, using teamcity.build.changedFiles.file as is mentioned in the thread I linked in above.  Could you please let me know what I have to use for the Reference Syntax and Value?

I am trying to get the full path to the changed file, so that I can use it in the build itself.

7 comments
Comment actions Permalink

Here is a screenshot of one of the things I have tried.



Attachment(s):
buildFiles.jpg
0
Comment actions Permalink

There is no need to define new property pointing to "teamcity.build.properties.file", you can simply use "teamcity.build.properties.file" as it is already defined. You can also use corresponding environment variable: TEAMCITY_BUILD_PROPERTIES_FILE

Your reference is perfectly valid too, but references to this property do not work because it is a bit "special" and is defined after the references resolution. There is corresponding issue in our tracker: http://youtrack.jetbrains.net/issue/TW-7750

0
Comment actions Permalink

I guess I don't understand what you mean.  I am trying to send the full path to the MSBuild script, so I can work with it there.  So, what do I need to put into the TC build configuration and then what do I need to put in the MSBuild script, in order to reference it?  So far, if I do a MSBuild message line, to print out the value of the parameter, I end up with it just printing this out, instead of the path:

[15:40:40]: [Project "Broadway.Scripts.proj.teamcity.patch.tcprojx" (default targets):] teamcity.build.changedFiles.file

0
Comment actions Permalink

In MSBuild runner you should replace . with _ in the property name, so you should use:
teamcity_build_changedFiles_file

0
Comment actions Permalink

I am sorry, I am still not understanding.  You have seen my screenshot.  That is what I have in the TeamCity MSBuild runner build parameter.  Should that be there?  Is that what needs to be changed?

This is what I have for the build configuration parameter:

Name Reference Syntax This column shows reference syntax if value of this parameter needs to be used in other build configuration settings. Value
buildFiles %system.buildFiles% teamcity_build_changedFiles_file edit delete


I have also tried:

ame Reference Syntax This column shows reference syntax if value of this parameter needs to be used in other build configuration settings. Value
buildFiles %system.buildFiles% %system.teamcity.build.changedFiles.file% edit delete


I have these lines in my MSBuild script:

<PropertyGroup>
    <buildFiles  Condition=" '$(buildFiles)'  == '' "></buildFiles>
</PropertyGroup>



<Target Name="Build">
    <Message Text="$(buildFiles)" />
</Target>

0
Comment actions Permalink

As I told you should not define additional parameter buildFiles via TeamCity UI. It won't work if it contains a reference to teamcity.build.changedFiles.file because of a bug in TeamCity. But in MSBuild you can use teamcity_build_changedFiles_file:

<Target Name="Build">
    <Message Text="$(teamcity_build_changedFiles_file)" />
</Target>

0
Comment actions Permalink

Awesome!  I have never directly referenced a TC parameter in the MSBuild script before.  Very cool!  Thank you for your help.

0

Please sign in to leave a comment.