modelsbuilder/ModelsBuilder.Original

Cleaner csproj include generated files

Opened this issue · 1 comments

After the VS extension generates models, it modifies the csproj to include the .generated.cs files under the DependentUpon:ModelsBuilder ItemGroup, adding an entry for each individual file.

This could be simplified with a wildcard, eg:

  <ItemGroup Label="DependentUpon:ModelsBuilder">
    <Compile Update="Models\Generated\*.generated.cs">
      <DesignTime>True</DesignTime>
      <AutoGen>True</AutoGen>
      <DependentUpon>_UmbracoModels.mb</DependentUpon>
    </Compile>    
  </ItemGroup>

Wildcards don't work with the default project type, only on the new SDK-style projects. As Umbraco doens't support that yet (umbraco/Umbraco-CMS#3635), the generated files need to be included individually (but please feel free to prove me wrong).