Determine if MSBuild CoreCompile will run and call custom target

后端 未结 4 1966
旧巷少年郎
旧巷少年郎 2020-12-08 23:55

This seems like an obvious thing to want to do but I have pulled most of my hair out trying to find any examples on the web or do it myself.

I have a c# solution wit

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-09 00:43

    Even if you got the list of projects needing compilation, if you update the assemblyinfo.cs of one of them, it may induce a change that triggers a compilation of another project.

    So, simpliest way is to generate all AssemblyInfo.cs files according to source control revision number. You could even get latest revision number for each project directory, effectively knowing when was the "last" modification on this project.

    See this question : How can I change AssemblyProduct, AssemblyTitle using MSBuild?

    According to your comment, have you looked into the BeforeBuild and AfterBuild targets (at the end of your csproj file) :

      
      
      
      
    

提交回复
热议问题