modelsbuilder / ModelsBuilder.Original

The Community Models Builder for Umbraco
MIT License
114 stars 49 forks source link

Cleaner csproj include generated files #229

Open tompipe opened 4 years ago

tompipe commented 4 years ago

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>
ronaldbarendse commented 4 years ago

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