2

TeamCity で追加のファイルを公開しようとしています。ここでも件名を開きました: Web プロジェクトに含まれていない追加の dll ファイルを公開しますが、ここでは、DefineCustomFiles と CustomCollectFiles が起動されていないように見えるという事実に焦点を当てています。

私のビルドステップは次のようになります。

TeamCity ビルドステップ

そして、私のカスタムビルドファイルは次のようになります:

<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121. 
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
    <PropertyGroup>
        <Configuration>Release</Configuration>
        <CopyAllFilesToSingleFolderForPackageDependsOn>
            DefineCustomFiles;
            CustomCollectFiles;
            $(CopyAllFilesToSingleFolderForPackageDependsOn);
        </CopyAllFilesToSingleFolderForPackageDependsOn>
    </PropertyGroup>
    <Target Name="BuildAll" DependsOnTargets="Compile">
        <Message Text="=== BuildAll ===" Importance="high" />
    </Target>
    <Target Name="Compile">
        <Message Text="=== Compile ===" Importance="high" />
        <MSBuild Projects="$(SolutionFile)" Properties="Configuration=$(Configuration)" />
    </Target>
    <Target Name="DefineCustomFiles">
        <Message Text="=== DefineCustomFiles ===" Importance="high" />
        <ItemGroup>
            <CustomFilesToInclude Include="example01.txt" />
        </ItemGroup>
    </Target>
    <Target Name="CustomCollectFiles">
        <Message Text="=== CustomCollectFiles ===" Importance="high" />
        <ItemGroup>
            <FilesForPackagingFromProject Include="@(CustomFilesToInclude)">
                <DestinationRelativePath>%(Filename)%(Extension)</DestinationRelativePath>
            </FilesForPackagingFromProject>
        </ItemGroup>
    </Target>
</Project>

example01.txt ファイルは、カスタム ビルド ファイルと同様に、プロジェクトのルートにあります。

問題:

  • TeamCity のログで発行された DefineCustomFiles および CustomCollectFiles ターゲットが表示されない
  • パブリケーション中にサンプル ファイルが追加されない

助けてくれてありがとう!

アップデート

問題は別ファイルから!ここで、最後にこれを含む標準の .csproj ファイルを使用します。

<PropertyGroup>
    <CopyAllFilesToSingleFolderForPackageDependsOn>
        CustomCollectFiles;
        $(CopyAllFilesToSingleFolderForPackageDependsOn);
    </CopyAllFilesToSingleFolderForPackageDependsOn>
</PropertyGroup>
<Target Name="CustomCollectFiles">
    <Message Text="=== CustomCollectFiles ===" Importance="high" />
    <ItemGroup>
        <_CustomFiles Include="..\Extra Files\**\*" />
        <FilesForPackagingFromProject Include="%(_CustomFiles.Identity)">
            <DestinationRelativePath>%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
        </FilesForPackagingFromProject>
    </ItemGroup>
</Target>

そして、それはうまくいきます。

アップデート

そして、Team City でのビルド手順は次のとおりです。

ここに画像の説明を入力

4

0 に答える 0