0

変更されたファイルのみのインクリメンタル チェックをサポートするように stylecop ターゲットを変更しようとしています。

デバッグ時に、@(Compile) がチェック対象のファイルのリストであることがわかります。ただし、このリストを、変更されたファイル (つまり、 $(TargetPath) として参照できることがわかっているターゲット dll より後のタイムスタンプを持つファイル) のみにフィルター処理したいと考えています。

createitem の出力である「StyleCopFiles」を再帰的に処理し、変更されていないファイルを削除するにはどうすればよいでしょうか。

以下は、フィルター条件を追加したいターゲットです。

<Target Name="SetUpStyleCopProperties">
        <!-- Determine what files should be checked. Take all Compile items, but exclude those that have
        set ExcludeFromStyleCop=true or ExcludeFromSourceAnalysis=true. -->
        <CreateItem Include="@(Compile)" Condition="('%(Compile.ExcludeFromStyleCop)' != 'true') and ('%(Compile.ExcludeFromSourceAnalysis)' != 'true')">
            <Output TaskParameter="Include" ItemName="StyleCopFiles"/>
        </CreateItem>

        <!-- Show list of what files should be excluded. checked. Take all Compile items, but exclude those that have
        set ExcludeFromStyleCop=true or ExcludeFromSourceAnalysis=true. -->
        <CreateItem Include="@(Compile)" Condition="('%(Compile.ExcludeFromStyleCop)' == 'true') or ('%(Compile.ExcludeFromSourceAnalysis)' == 'true')">
            <Output TaskParameter="Include" ItemName="StyleCopExcludedFiles"/>
        </CreateItem>
    </Target>
4

1 に答える 1