Skip to content

Commit

Permalink
Merge pull request #523 from BUTR/netstandard_refasm
Browse files Browse the repository at this point in the history
Added netstandard2.0 reference assemblies support
  • Loading branch information
pardeike committed Apr 8, 2023
2 parents f43955b + be81a54 commit f810941
Showing 1 changed file with 26 additions and 1 deletion.
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

0 comments on commit f810941

Please sign in to comment.