Skip to content

Commit

Permalink
chore: Remove multi targeting of the source generator and remove Inte…
Browse files Browse the repository at this point in the history
…rnalsVisibleTo to make VS 17.6+ work again
  • Loading branch information
latonz committed Aug 18, 2023
1 parent a512ee9 commit 61b1c57
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 55 deletions.
7 changes: 4 additions & 3 deletions build/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,18 @@ mkdir -p "${artifacts_dir}"
rm -rf "${artifacts_dir:?}"/*

artifacts_dir="$(realpath "$artifacts_dir")"
source_generator="$(realpath "${script_dir}/../src/Riok.Mapperly")"

for roslyn_version in "${roslyn_versions[@]}"; do
echo "building for Roslyn ${roslyn_version}"
dotnet pack \
"${script_dir}/../src/Riok.Mapperly" \
"$source_generator" \
--verbosity quiet \
-c Release \
/p:TargetFrameworks="netstandard2.0" \
/p:ROSLYN_VERSION="${roslyn_version}" \
-o "${artifacts_dir}/roslyn-${roslyn_version}" \
/p:Version="${RELEASE_VERSION}" \
/p:PackageReleaseNotes=\""${RELEASE_NOTES}"\" >/dev/null
/p:PackageReleaseNotes=\""${RELEASE_NOTES}"\"
done

echo "merging multi targets to a single nupkg"
Expand Down
8 changes: 1 addition & 7 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net7.0</TargetFrameworks>
<TargetFramework>netstandard2.0</TargetFramework>
<DebugType>embedded</DebugType>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Expand All @@ -16,12 +16,6 @@
<LangVersion>11</LangVersion>
</PropertyGroup>

<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>$(MSBuildProjectName).Tests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.81">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static class MemberPathCandidateBuilder
/// </summary>
/// <param name="name">The name to build candidates from.</param>
/// <returns>The joined member path groups.</returns>
internal static IEnumerable<IEnumerable<string>> BuildMemberPathCandidates(string name)
public static IEnumerable<IEnumerable<string>> BuildMemberPathCandidates(string name)
{
if (name.Length == 0)
yield break;
Expand Down
2 changes: 1 addition & 1 deletion src/Riok.Mapperly/Diagnostics/DiagnosticDescriptors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Riok.Mapperly.Diagnostics;

// cannot use target-typed new: https://github.com/dotnet/roslyn-analyzers/issues/5828
internal static class DiagnosticDescriptors
public static class DiagnosticDescriptors
{
public static readonly DiagnosticDescriptor UnsupportedMappingMethodSignature = new DiagnosticDescriptor(
"RMG001",
Expand Down
2 changes: 1 addition & 1 deletion src/Riok.Mapperly/Helpers/MethodNameBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Riok.Mapperly.Helpers;

internal class MethodNameBuilder : UniqueNameBuilder
public class MethodNameBuilder : UniqueNameBuilder
{
private const string MethodNamePrefix = "MapTo";
private const string ArrayTypeNameSuffix = "Array";
Expand Down
14 changes: 6 additions & 8 deletions src/Riok.Mapperly/Riok.Mapperly.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,14 @@
</ItemGroup>

<!--
This ensures the library will be packaged as a source generator when we use `dotnet pack`.
only to this for the tfm netstandard2.0, multi targeting is only used during development
to easily reference this project from tests, ...
This ensures the library will be packaged as a source generator when we use `dotnet pack`
-->
<ItemGroup Condition="'$(TargetFrameworks)' == 'netstandard2.0'">
<ItemGroup>
<None Include="../../README.md" Pack="true" PackagePath="\" />
<None Include="../../docs/static/img/logo.png" Pack="true" PackagePath="\" />
<None Include="$(OutputPath)\netstandard2.0\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/roslyn$(ROSLYN_VERSION)/dotnet/cs" Visible="false" />
<None Include="$(OutputPath)\netstandard2.0\$(AssemblyName).Abstractions.dll" Pack="true" PackagePath="analyzers/roslyn$(ROSLYN_VERSION)/dotnet/cs" Visible="false" />
<None Include="$(OutputPath)\netstandard2.0\$(AssemblyName).Abstractions.dll" Pack="true" PackagePath="lib\netstandard2.0" Visible="true" />
<None Include="$(OutputPath)\netstandard2.0\$(AssemblyName).Abstractions.xml" Pack="true" PackagePath="lib\netstandard2.0" Visible="true" />
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/roslyn$(ROSLYN_VERSION)/dotnet/cs" Visible="false" />
<None Include="$(OutputPath)\$(AssemblyName).Abstractions.dll" Pack="true" PackagePath="analyzers/roslyn$(ROSLYN_VERSION)/dotnet/cs" Visible="false" />
<None Include="$(OutputPath)\$(AssemblyName).Abstractions.dll" Pack="true" PackagePath="lib\netstandard2.0" Visible="true" />
<None Include="$(OutputPath)\$(AssemblyName).Abstractions.xml" Pack="true" PackagePath="lib\netstandard2.0" Visible="true" />
</ItemGroup>
</Project>
34 changes: 0 additions & 34 deletions test/Riok.Mapperly.Tests/Helpers/PriorityQueueExtensionsTest.cs

This file was deleted.

0 comments on commit 61b1c57

Please sign in to comment.