Skip to content

Commit

Permalink
Glob include files based on project extension (VS) (#46702)
Browse files Browse the repository at this point in the history
* Glob include files based on project extension (VS)

* Update Directory.Build.targets

* Update Directory.Build.targets

* Update Directory.Build.targets
  • Loading branch information
ViktorHofer authored Jan 8, 2021
1 parent 32a9a04 commit e36948f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
10 changes: 9 additions & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
<InformationalVersion Condition="'$(InformationalVersion)' == '' and '$(VersionSuffix)' == ''">$(ProductVersion)</InformationalVersion>
<InformationalVersion Condition="'$(InformationalVersion)' == '' and '$(VersionSuffix)' != ''">$(ProductVersion)-$(VersionSuffix)</InformationalVersion>
</PropertyGroup>

<!-- The Default behavior in VS is to show files for the first target framework in TargetFrameworks property.
This is required to show all the files corresponding to all target frameworks in VS. -->
<ItemGroup Condition="'$(DefaultLanguageSourceExtension)' != '' and
('$(BuildingInsideVisualStudio)' == 'true' or '$(DesignTimeBuild)' == 'true')">
<None Include="$(MSBuildProjectDirectory)\**\*$(DefaultLanguageSourceExtension)"
Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder);@(Compile)" />
</ItemGroup>

<!-- Packaging -->
<ItemGroup Condition="'$(IsPackable)' == 'true'">
Expand Down Expand Up @@ -62,4 +70,4 @@
<PackDependsOn />
</PropertyGroup>
</Target>
</Project>
</Project>
7 changes: 0 additions & 7 deletions src/libraries/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,6 @@
</When>
</Choose>

<!-- The Default behavior in VS is to show files for the first target framework in TargetFrameworks property.
This is required to show all the files corresponding to all target frameworks in VS. -->
<ItemGroup Condition="'$(BuildingInsideVisualStudio)' == 'true' or '$(DesignTimeBuild)' == 'true'">
<None Include="$(MSBuildProjectDirectory)\**\*.cs"
Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder);@(Compile)" />
</ItemGroup>

<PropertyGroup>
<SkipLocalsInit Condition="'$(SkipLocalsInit)' == '' and '$(MSBuildProjectExtension)' == '.csproj' and '$(IsNETCoreAppSrc)' == 'true' and ($([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', '$(NetCoreAppCurrent)')))">true</SkipLocalsInit>
</PropertyGroup>
Expand Down

0 comments on commit e36948f

Please sign in to comment.