[英]How can I build an application on a build server by not having all my DLLs in the same repository as the application
[英]How can i incrementally build my application
我有一個桌面WPF應用程序,需要不時更新。 我有一個可以提供更新的DLL的更新服務,以及一個可以將更新應用於所述WPF應用程序的客戶端。 但是我想利用MSBuilds增量構建來創建僅包含更新的DLL的補丁。 有沒有一種方法可以構建整個應用程序並僅輸出包含對單獨目錄的更新的DLL?
好吧,我想我破解了。
解決方案是利用MSBuild 增量版本來檢查是否對正在編譯的文件進行了更改。 如果設置了指示該屬性的屬性,然后再次使用MSBuild將生成的dll復制到增量文件夾中。
所以我的項目文件都在底部:
...
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.-->
<Target Name="BeforeBuild" Inputs="@(Compile)" Outputs="$(OutputPath)$(AssemblyName).dll">
<CreateProperty Value="true">
<Output TaskParameter="Value" PropertyName="NewFile" />
</CreateProperty>
</Target>
<Target Name="AfterBuild" Condition=" '$(NewFile)' == 'true' ">
<MakeDir Directories="$(IncrementalBuildRoot)$(BuildNumber)" Condition="!Exists('$(IncrementalBuildRoot)$(BuildNumber)')" />
<Copy SourceFiles="$(OutputPath)$(AssemblyName).dll" DestinationFolder="$(IncrementalBuildRoot)$(BuildNumber)" />
</Target>
</Project>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.