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

Added netstandard2.0 reference assemblies support #523

Merged
merged 3 commits into from
Apr 8, 2023
Merged
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
27 changes: 26 additions & 1 deletion Harmony/Harmony.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net35;net452;net472;net48;netcoreapp3.0;netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net35;net452;net472;net48;netcoreapp3.0;netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Product>Harmony</Product>
<Company>Andreas Pardeike</Company>
Expand Down Expand Up @@ -133,6 +133,31 @@
<PackageReference Include="ILRepack.Lib.MSBuild" Version="2.1.14" PrivateAssets="all" /> -->
</ItemGroup>

<!-- netstandard2.0 reference assemblies -->
<PropertyGroup Condition="$(TargetFramework) == 'netstandard2.0'">
<!-- Remove from /lib in NuGet -->
<IncludeBuildOutput>false</IncludeBuildOutput>
<!-- Create reference Assemblies instead of a full assembly -->
<ProduceOnlyReferenceAssembly>true</ProduceOnlyReferenceAssembly>
<!-- Add our target for packing -->
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);AddRefAssemblyToPackage</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>
<ItemGroup Condition="$(TargetFramework) == 'netstandard2.0'">
<!-- Adding System.Reflection.Emit to because there are public types exposed from its's package -->
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" />
</ItemGroup>
<Target Name="AddRefAssemblyToPackage" Condition="$(TargetFramework) == 'netstandard2.0'">
<ItemGroup>
<!-- Adding the Reference Assembly and the xml documentation to /ref of NuGet -->
<TfmSpecificPackageFile Include="$(OutDir)$(AssemblyName).dll">
<PackagePath>ref/netstandard2.0</PackagePath>
</TfmSpecificPackageFile>
<TfmSpecificPackageFile Include="$(OutDir)$(AssemblyName).xml">
<PackagePath>ref/netstandard2.0</PackagePath>
</TfmSpecificPackageFile>
</ItemGroup>
</Target>

<ItemGroup Condition="$(IsNET5OrGreater)">
<PackageReference Include="System.Text.Json" Version="5.0.2" />
</ItemGroup>
Expand Down