-
-
Notifications
You must be signed in to change notification settings - Fork 633
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
Include Mono.Cecil.Tests.csproj in netstandard build #444
Conversation
40d90fd
to
8677d74
Compare
</PropertyGroup> | ||
<Import Project="Mono.Cecil.props" /> | ||
<ItemGroup> | ||
<PropertyGroup Condition="'$(NetStandard)' == 'true'"> | ||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need binding redirects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case we cross-target tests to also run on .NET Framework when building netstandard_debug configuration. I have removed the cross-targeting for now since it was breaking VS editing experience (VS project system doesn't like conditional cross-targeting).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tmat so we can remove this and the workaround below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather keep it. It makes it easier to switch the target to net462 temporarily when debugging issues on .NET Framework. I'll follow up on the cross-targeting issue with Project System team.
</PropertyGroup> | ||
<PropertyGroup Condition=" $(Configuration.StartsWith('net_4_0')) "> | ||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | ||
<DefineConstants>$(DefineConstants);NET_4_0;</DefineConstants> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" $(NetStandard) "> | ||
<TargetFramework>netstandard1.3</TargetFramework> | ||
<PropertyGroup Condition="'$(NetStandard)' == 'true'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use $(NetStandard)
and ! $(NetStandard)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most msbuild targets use "'$(Var)' == 'true'"
to allow the variable to be empty. Empty string is not auto-converted to boolean false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok thanks!
Test/Mono.Cecil.Tests/Extensions.cs
Outdated
#else | ||
public static SR.Assembly LoadAssembly (MemoryStream stream) | ||
{ | ||
return SR.Assembly.Load(stream.ToArray ()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Load (
Thanks for contributing this! |
Also let's move to net standard 2.0 and avoid the |
Makes sense - i'll port to netstandard 2.0. I have made the change when 2.0 wasn't released yet. |
8677d74
to
58a7dcf
Compare
@jbevain PR updated. Now targeting netstandard 2.0. All tests pass on Core CLR. |
58a7dcf
to
01886f0
Compare
Mono.Cecil.Cil/Symbols.cs
Outdated
@@ -826,7 +826,7 @@ static SR.AssemblyName GetSymbolAssemblyName (SymbolKind kind) | |||
|
|||
var suffix = GetSymbolNamespace (kind); | |||
|
|||
var cecil_name = typeof (SymbolProvider).Assembly ().GetName (); | |||
var cecil_name = typeof (SymbolProvider).GetTypeInfo ().Assembly.GetName (); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove all the GetTypeInfo()
in favor of the existing API in netstd2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only tests target netstandard2.0. the product binary still targets netstandard1.3. I don't think we want to move to netstandard2.0 yet for the product binary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because not everyone can move their apps to netstandard2.0. VS, for example, is on netstandard1.3 right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that, but do we actually have any tool that has a dependency on the netstd1.3 version of Cecil that can't move to 2.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know any specific one. Hard to say. I think it's better to be conservative. There is not that many of these APIs to be worth preventing people from using Cecil in their apps that can't move to 2.0 yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather consider removing the net35 and net40 targets ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I mean potentially in future, not in this PR).
@jbevain Any more feedback? |
@tmat yes: please do switch Mono.Cecil to be built on netstandard 2.0 in this PR. Any previous usage of 0.10 was in beta and I want to release 0.10 to target netstd 2.0. After that we'll clean up a few tidbits and we should be good to go. Thanks again for contributing this! |
@jbevain Since there are currently consumers who need this change when targeting net46, for which netstandard2.0 doesn't work (ILLinker) and also other PRs in progress that completely revamp the projects (e.g. #442) I think it would be best to keep netstandard1.3 for now and move to netstandard2.0 later, once the other PRs are merged. Otherwise we'll run into all sorts of issues. Either the build won't support net46 for a while or I'd need to update the configurations to cross-target and thus collide even more with #442 than I already do. Sounds reasonable? |
Sounds like a plan. I'll look into merging this tonight. Thanks! |
@jbevain Thanks! |
@jbevain Gentle reminder :) |
Thanks for your contribution! |
@jbevain Thanks for feedback and reviews! |
Makes Mono.Cecil.Tests project portable targeting netstandard2.0 and tests runnable by
dotnet test
: