Skip to content

Commit

Permalink
Remove explicit System.IO.Packaging for SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
twsouthwick committed Jun 28, 2023
1 parent e2b8a44 commit a687fea
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 110 deletions.
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@
<PropertyGroup>
<SupportsNetStandard>true</SupportsNetStandard>
<SupportsNetStandard Condition=" '$(TargetFramework)' == 'net35' OR '$(TargetFramework)' == 'net40' OR '$(TargetFramework)' == 'net452' OR '$(TargetFramework)' == 'net46' ">false</SupportsNetStandard>
<IsFramework>false</IsFramework>
<IsFramework Condition=" '$(TargetFramework)' == 'net35' AND '$(TargetFramework)' == 'net40' AND '$(TargetFramework)' == 'net46' ">true</IsFramework>
</PropertyGroup>

<Target Name="UnknownProjectLoadStyle" BeforeTargets="Build" Condition="$(__InvalidProjectLoadStyle)">
Expand Down
5 changes: 5 additions & 0 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
<!--<PackageValidationBaselineVersion>2.18.0</PackageValidationBaselineVersion>-->
</PropertyGroup>

<ItemGroup Condition="$(IsFramework)">
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>

<Import Project="$(MSBuildThisFileDirectory)\PEVerify.targets" />

<Import Project="..\Directory.Build.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,46 +29,9 @@
<RootNamespace>DocumentFormat.OpenXml</RootNamespace>
</PropertyGroup>

<Choose>
<When Condition=" '$(TargetFramework)' == 'net35'">
<PropertyGroup>
<CompileWithPeVerify>true</CompileWithPeVerify>
</PropertyGroup>

<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
</When>

<When Condition=" '$(TargetFramework)' == 'net40' ">
<PropertyGroup>
<CompileWithPeVerify>true</CompileWithPeVerify>
</PropertyGroup>

<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
</When>

<When Condition=" '$(TargetFramework)' == 'net46' ">
<PropertyGroup>
<CompileWithPeVerify>true</CompileWithPeVerify>
</PropertyGroup>

<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
</When>

<When Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net7.0' ">
<ItemGroup>
<PackageReference Include="System.IO.Packaging" />
</ItemGroup>
</When>
</Choose>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="System.IO.Packaging" />
</ItemGroup>

<ItemGroup>
<Compile Update="Resources\ExceptionMessages.Designer.cs">
Expand Down
29 changes: 3 additions & 26 deletions src/DocumentFormat.OpenXml.Linq/DocumentFormat.OpenXml.Linq.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,8 @@
<ProjectReference Include="..\DocumentFormat.OpenXml.Framework\DocumentFormat.OpenXml.Framework.csproj" />
</ItemGroup>

<Choose>
<When Condition=" '$(TargetFramework)' == 'net35'">
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
</When>

<When Condition=" '$(TargetFramework)' == 'net40'">
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
</When>

<When Condition=" '$(TargetFramework)' == 'net46'">
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
</When>

</Choose>
<ItemGroup Condition="$(IsFramework)">
<Reference Include="System.Xml.Linq" />
</ItemGroup>

</Project>
41 changes: 0 additions & 41 deletions src/DocumentFormat.OpenXml/DocumentFormat.OpenXml.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,45 +35,4 @@
<ProjectReference Include="../DocumentFormat.OpenXml.Framework/DocumentFormat.OpenXml.Framework.csproj" />
</ItemGroup>

<Choose>
<When Condition=" '$(TargetFramework)' == 'net35'">
<PropertyGroup>
<CompileWithPeVerify>true</CompileWithPeVerify>
</PropertyGroup>

<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
</When>

<When Condition=" '$(TargetFramework)' == 'net40' ">
<PropertyGroup>
<CompileWithPeVerify>true</CompileWithPeVerify>
</PropertyGroup>

<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
</When>

<When Condition=" '$(TargetFramework)' == 'net46' ">
<PropertyGroup>
<CompileWithPeVerify>true</CompileWithPeVerify>
</PropertyGroup>

<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
</When>

<When Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net7.0' ">
<ItemGroup>
<PackageReference Include="System.IO.Packaging" />
</ItemGroup>
</When>
</Choose>

</Project>
5 changes: 2 additions & 3 deletions src/PEVerify.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
<PropertyGroup>
<!-- .NET Framework builds should pass PEVerify -->
<RunPeVerify Condition=" '$(RunPeVerify)' == '' ">false</RunPeVerify>
<CompileWithPeVerify Condition=" '$(CompileWithPeVerify)' == '' ">false</CompileWithPeVerify>
<PeVerifyPath Condition=" '$(PeVerifyPath)' == '' ">C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\PEVerify.exe</PeVerifyPath>
</PropertyGroup>

<PropertyGroup Condition="$(CompileWithPeVerify)">
<PropertyGroup Condition="$(IsFramework)">
<Features>$(Features);peverify-compat</Features>
</PropertyGroup>

<Target Name="Run PEVerify" AfterTargets="Build" Condition="$(CompileWithPeVerify) AND $(RunPeVerify)">
<Target Name="Run PEVerify" AfterTargets="Build" Condition="$(IsFramework) AND $(RunPeVerify)">
<ItemGroup>
<_OutputFileToVerify Include="@(FileWrites)" Condition="'%(Extension)' == '.dll' AND $([System.Text.RegularExpressions.Regex]::IsMatch('%(FullPath)', '.+\\bin\\.+'))" />
</ItemGroup>
Expand Down

0 comments on commit a687fea

Please sign in to comment.