Skip to content

CppWinRT NuGet package deletes a file it doesn't write #1173

@davidmatson

Description

@davidmatson

Snippets from the CppWinRT NuGet package’s targets file:

        <CppWinRTProjectWinMD>$(OutDir)$(RootNamespace).winmd</CppWinRTProjectWinMD>
    <Target Name="CppWinRTClean">
        <ItemGroup>
            <_FilesToDelete Remove="@(_FilesToDelete)"/>
            <_FilesToDelete Include="$(GeneratedFilesDir)**"/>
            <_FilesToDelete Include="$(CppWinRTMergedDir)**"/>
            <_FilesToDelete Include="$(CppWinRTUnmergedDir)**"/>
            <_FilesToDelete Include="$(CppWinRTProjectWinMD)"/> <- The bug is here; this line should be conditional on CppWinRTGenerateWindowsMetadata (otherwise, this targets file is not writing that file and should not delete it)
        </ItemGroup>
        <Delete Files="@(_FilesToDelete)"/>
    </Target>

We noticed this issue when the WinMD was being produced by a different project but just happened to match the value of CppWinRTProjectWinMD.

(The fix is trivial; PR coming shortly.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions