简体   繁体   中英

How to change project version in AssemblyInfo.cs files for TFS 2012 using Community TFS Build Extensinos

I'm using TfsVersion Activity 2012, it is very confusing for me, and the current documentation is for TFS 2010 at: http://tfsbuildextensions.codeplex.com/wikipage?title=How%20to%20integrate%20the%20TfsVersion%20build%20activity&referringTitle=Documentation .

I have follow this documentation. I got to the point I can find all assembly files and print the messages out.

However I need some guidelines to set the properties of TfsVersion Activity for TFS 2012. I have already created variables "Major, Minor, VersionNumber" and set the properties roughly the same with the current documentation. But I got errors: " Major is required. Version is required."

So the questions: where in the process suppose to read out the version number from AssemblyInfo files? What variable is getting set that value? How Major an Minor works? Do they automatically get value from... something? Do we or can we set Major and Minor variables? Where in the process set the final output Version variable if it's been set in the background? Or do we have to set it manually? I have found the document for these variables, just don't know what the process to set them and when do we suppose to use them. Major - Gets or Sets the Major component of the version number. Minor - Gets or Sets the Minor component of the version number. Version - Gets or sets the Version.

Thanks a lot for your help.

You haven't assigned variables to TfsVersion activity arguments - refer to screenshot in the linked article. There are 3 potential actions types for this activity Get, Set, GetAndSet. For Get Major and Minor arguments are required, for Set Version is required. During Get phase Version generated from all the provided parts. During Set phase Version gets put into assembly files. If you use only Set then you must provide full Version number yourself.

GetAndSet is used in example.

So the questions: where in the process suppose to read out the version number from AssemblyInfo files? What variable is getting set that value? Where in the process set the final output Version variable if it's been set in the background? Or do we have to set it manually?

Variable (VersionNumber) passed to activity Version argument will be contain the generated version number, quote from the linked documentation cross reference that with screenshot. If you use only Set action you need to provide full version number.

Prior to editing the activity's properties another variable is needed, this time a string called VersionNumber. This is used to return the TFSVersion activity generated version number for logging.

How Major an Minor works?
You provide values that get inserted in standart 4 number version number Major and Minor slots. There are also attributes for build and revision.

Do they automatically get value from... something? No, both are required to be have value for Get action.

Do we or can we set Major and Minor variables?

Yes, you can pass variable assigned somewhere in workflow or you can pass workflow argument variable whose value is defined in build configuration window. Refer to linked article screen shot. For acitivities In arguments you can pass value directly, this should fail for Out or InOut.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM