locked
How to have build customization items considered in VC++ 2010 up-to-date check? RRS feed

  • Question

  • Is there a way to integrate with VC++ 2010's up-to-date check from a build customization?  I see there's UpToDataCheckInput for ItemType (http://msdn.microsoft.com/en-us/library/microsoft.build.framework.xamltypes.itemtype.aspx), I'm guessing that this is a way to have a custom item be considered in the up-to-date check.  In my case I need my custom item to be included as well as its dependencies, so I'm wondering if there's possibly a more dynamic way.  For example, does the project system invoke a particular target to determine this, and then I could do something like indicate that a custom target runs first via BeforeTargets and I could add the dependencies to a particular item group?
    • Moved by Yi Feng Li Wednesday, August 31, 2011 2:26 AM MSbuild issue (From:Visual Studio Extensibility)
    • Moved by Yi Feng Li Thursday, September 1, 2011 3:47 AM VSX issue (From:MSBuild)
    Tuesday, August 30, 2011 5:24 PM

All replies

  • Hi ewells,

    As far as I know, there is no a general up-to-date check task in MSBuild. However you may write your own task to check if your custom items are up-to-dated. The idea is to compare the time between your output and project file, which mentioned in this thread: http://social.msdn.microsoft.com/forums/en-us/vsx/thread/6E3B036C-2E6D-486F-AD04-3D7FF346BB0B.

    To create a custom task, you can go through this tutorial:  http://msdn.microsoft.com/en-us/library/t9883dzc.aspx

    Since you want to create a custom task, some DTE related you may not use, but if you are looking for a way to check the build state of a configuration, please take a look: http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.vcprojectengine.vcconfiguration.uptodate.aspx

    This issue is more about MSBuild, I’m moving this thread to MSBuild forum for better support.

     

    Thank you for your understanding.

    Yi


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, August 31, 2011 2:26 AM
  • Sorry, I didn't explain my question well.  I understand that MSBuild doesn't have a general up-to-date check, I already have several custom MSBuild tasks, one of which is used to check if an item is up-to-date based on its dependencies.
    This isn't really an MSBuild-specific question, it's really about the VC++ project system.  More specifically, in Visual Studio go to Tools | Options, then go to Projects and Solutions, and then Build and Run.  In this dialog there's a setting called "On Run, when projects are out of date" and the the options are "Always build", "Never build", and "Prompt to build".
    What I'm looking for is a way to communicate to the VC++ project system if an item is up-to-date or not to contribute to this behavior.  These items are integrated into the build via a VC++ build customization.  I'm asking about how VC++ determines what items to look at to decide if a project is up-to-date for this setting and if there's a way I can add to this set of items via my build customization.


    • Edited by ewells Wednesday, August 31, 2011 1:52 PM Formatting
    Wednesday, August 31, 2011 1:50 PM
  • Hi ewells,

    Thank you for your clarify.

     

    You can use VCConfiguration.UpToDate to check whether the current configuration's build state is up to date. You may also try to use IVsBuildableProjectCfg.StartUpToDateCheck Method to request that a project begin an up-to-date check to determine whether or not the current build is up to date and obtain the result from a output window.

     

    By the way, I’m moving this thread back to the VSX forum.

     

    Sorry for any inconvenience.

    Regards,

    Yi

     

     

     


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, September 1, 2011 3:47 AM
  • Hi Yi, thanks for your response.  I knew about VCConfiguration.UpToDate and IVsBuildableProjectCfg.StartUpToDateCheck.  I'm not trying to find out if the project is up-to-date, I'm looking for a way to tell VC++ if my items are up-to-date.  In other words, how does VCConfiguration.UpToDate work?  How does it decide what items it's going to look at and can I extend this for my items in any way?  I also know about UpToDataCheckInput for ItemType (http://msdn.microsoft.com/en-us/library/microsoft.build.framework.xamltypes.itemtype.aspx) in a build customization, there's little documentation so I'm not 100% sure how this works, but I'm guessing this would solve the problem for my item, however I need to also include my item's dependencies.
    Thursday, September 1, 2011 2:21 PM
  • Hi,

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.

     Yi


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, September 2, 2011 1:53 AM
  • Hi Yi, any news on this issue?  Thanks.
    Thursday, September 8, 2011 2:03 PM