Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary dependency #1471

Merged
merged 5 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: cd test/DocumentFormat.OpenXml.Benchmarks; dotnet build -c RELEASE
shell: pwsh
- name: Run benchmarks
run: cd test/DocumentFormat.OpenXml.Benchmarks; dotnet run -c RELEASE -- results --exporters json --filter '*'
run: cd test/DocumentFormat.OpenXml.Benchmarks; dotnet run -c RELEASE -f net7.0 -- results --exporters json --filter '*'
shell: pwsh
- name: Write summary
shell: pwsh
Expand Down
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' OR $(TargetFramework.StartsWith('net4')) ">true</IsFramework>
</PropertyGroup>

<Target Name="UnknownProjectLoadStyle" BeforeTargets="Build" Condition="$(__InvalidProjectLoadStyle)">
Expand Down
4 changes: 1 addition & 3 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<Reference Condition="$(IsFramework)" Include="WindowsBase" />
</ItemGroup>
<!-- The tool is used by default, but we don't want it to. It must be set in a target to ensure it is not overridden -->
<Target Name="BeforeResGen" Condition=" '$(TargetFramework)' == 'net35' ">
Expand All @@ -27,7 +28,4 @@
<PackageOutputPath>$(MSBuildThisFileDirectory)bin\$(Configuration)\packages\</PackageOutputPath>
<PackageOutputPath Condition="$(IsShipped)">$(PackageOutputPath)shipping\</PackageOutputPath>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net35' OR $(TargetFramework.StartsWith('net4'))">
<Reference Include="WindowsBase" />
</ItemGroup>
</Project>
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 @@ -9,13 +9,13 @@ namespace DocumentFormat.OpenXml.Features
public class ParagraphIdOptions
{
/// <summary>
/// Gets a value indicating whether or not paragraph ids should be auto-generated on elements.
/// Gets or sets a value indicating whether or not paragraph ids should be auto-generated on elements.
/// </summary>
public bool AutoGenerateIds { get; init; } = true;
public bool AutoGenerateIds { get; set; } = true;

/// <summary>
/// Gets a value indicating whether or not uniqueness should be guaranteed on elements added to the document. This will change a node's para id if it has already been registered.
/// Gets or sets a value indicating whether or not uniqueness should be guaranteed on elements added to the document. This will change a node's para id if it has already been registered.
/// </summary>
public bool EnsureUniquenessOnExistingNodes { get; init; } = true;
public bool EnsureUniquenessOnExistingNodes { get; set; } = true;
}
}
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
1 change: 0 additions & 1 deletion test/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
</Compile>
</ItemGroup>
<ItemGroup>
<!-- Need to bring this in manually as the test framework itself tries to bring in 9.0.0 -->
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="System.ValueTuple" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>$(LatestTargetFramework)</TargetFramework>
<TargetFrameworks>$(LatestTargetFramework)</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down