Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<IsReferenceAssembly Condition="'$(IsReferenceAssembly)' == '' and '$([System.IO.Path]::GetFileName($(MSBuildProjectDirectory)))' == 'ref'">true</IsReferenceAssembly>
</PropertyGroup>
<PropertyGroup Condition=" '$(IsReferenceAssembly)' == 'true' ">
<!-- Since .NET 5 reference assemblies are always produced -->
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<ProduceOnlyReferenceAssembly>true</ProduceOnlyReferenceAssembly>
<!-- Used by Arcade to compute OutputPath, IntermediateOutputPath, etc. early in the import chain. -->
<OutDirName>$(MSBuildProjectName)/ref</OutDirName>
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<!-- see https://github.com/dotnet/runtime/issues/1338 -->
<MicrosoftNETCoreILAsmVersion>$(MicrosoftNETSdkILPackageVersion)</MicrosoftNETCoreILAsmVersion>
<!-- These should match the SDK version at https://github.com/dotnet/sdk/blob/master/eng/Versions.props -->
<SystemReflectionMetadataVersion>1.5.0</SystemReflectionMetadataVersion>
<SystemReflectionMetadataVersion>1.8.0</SystemReflectionMetadataVersion>
<MicrosoftBuildFrameworkVersion>15.4.8</MicrosoftBuildFrameworkVersion>
<MicrosoftBuildUtilitiesCoreVersion>15.4.8</MicrosoftBuildUtilitiesCoreVersion>
<MicrosoftDotNetApiCompatVersion>5.0.0-beta.20427.5</MicrosoftDotNetApiCompatVersion>
Expand Down
2 changes: 1 addition & 1 deletion eng/ilasm.ilproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
project. -->

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<Target Name="CopyILAsmTool" DependsOnTargets="ResolveIlasmToolPaths" Condition="'$(MonoBuild)' == ''">
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"tools": {
"dotnet": "5.0.100-preview.6.20310.4",
"dotnet": "5.0.100-rc.1.20454.5",
"runtimes": {
"dotnet": [
"3.0.0"
"5.0.0-rc.1.20451.14"
]
}
},
Expand Down
4 changes: 2 additions & 2 deletions src/ILLink.Tasks/ILLink.Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<!-- Keep these in sync with _ILLinkTasksTFM in Sdk.props. -->
<!-- Keep the netcoreapp TFM in sync with the Mono.Linker.csproj condition below. -->
<TargetFrameworks>netcoreapp3.0;net472</TargetFrameworks>
<TargetFrameworks>net5.0;net472</TargetFrameworks>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend to use an msbuild property for the used .NETCoreApp version to keep changes as small as possible in the future.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea - we should probably do that as a follow-up - the plan is to try to backport this to 5.0 release, so I would like to keep the changes to minimum.

<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<Description>MSBuild tasks for running the IL Linker</Description>
<LangVersion>latest</LangVersion>
Expand Down Expand Up @@ -36,7 +36,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="../linker/Mono.Linker.csproj" PrivateAssets="All" Condition=" '$(TargetFramework)' == 'netcoreapp3.0' " />
<ProjectReference Include="../linker/Mono.Linker.csproj" PrivateAssets="All" Condition=" '$(TargetFramework)' == 'net5.0' " />
<PackageReference Condition="'$(UseCecilPackage)' == 'true'" Include="Mono.Cecil" Version="$(MonoCecilVersion)" PrivateAssets="All" Publish="True" />
<ProjectReference Condition="'$(UseCecilPackage)' != 'true'" Include="../../external/cecil/Mono.Cecil.csproj" PrivateAssets="All" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/ILLink.Tasks/LinkTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public string ILLinkPath {

var taskDirectory = Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location);
// The linker always runs on .NET Core, even when using desktop MSBuild to host ILLink.Tasks.
_illinkPath = Path.Combine (Path.GetDirectoryName (taskDirectory), "netcoreapp3.0", "illink.dll");
_illinkPath = Path.Combine (Path.GetDirectoryName (taskDirectory), "net5.0", "illink.dll");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proposed msbuild property for the used .NETCoreApp version can also flow into this file by supplying the constant in the project file.

return _illinkPath;
}
set => _illinkPath = value;
Expand Down
2 changes: 1 addition & 1 deletion src/analyzer/analyzer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<PropertyGroup Condition="'$(MonoBuild)' == ''">
<DefineConstants>$(DefineConstants);FEATURE_ILLINK</DefineConstants>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(MonoBuild)' != ''">
Expand Down
2 changes: 1 addition & 1 deletion src/analyzer/common/Mono.Options/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ public string OptionName {
get {return this.option;}
}

#if !PCL
#if !PCL && !NETCOREAPP
#pragma warning disable 618 // SecurityPermissionAttribute is obsolete
[SecurityPermission (SecurityAction.LinkDemand, SerializationFormatter = true)]
#pragma warning restore 618
Expand Down
1 change: 0 additions & 1 deletion src/linker/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<PropertyGroup Condition="'$(MonoBuild)' == ''">
<AssemblyName>illink</AssemblyName>
<Description>IL Linker</Description>
<TargetFramework>netcoreapp3.0</TargetFramework>
<PackageId>Microsoft.NET.ILLink</PackageId>
</PropertyGroup>

Expand Down
2 changes: 2 additions & 0 deletions src/linker/Mono.Linker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
</PropertyGroup>

<PropertyGroup Condition="'$(MonoBuild)' == ''">
<TargetFramework>net5.0</TargetFramework>
<DefineConstants>$(DefineConstants);FEATURE_ILLINK</DefineConstants>
<IsPackable>true</IsPackable>
<!-- Nuget issues a warning about missing <reference> items in the generated nuspec,
Expand All @@ -31,6 +32,7 @@
<Compile Remove="Linker.Steps\PreserveCalendarsStep.cs" />
<Compile Remove="Linker.Steps\RemoveFeaturesStep.cs" />
<Compile Remove="Linker.Steps\ResolveFromXApiStep.cs" />
<Compile Remove="System.Diagnostics.CodeAnalysis\*.cs" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/linker/ref/Mono.Linker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<BuildOutputTargetFolder>ref</BuildOutputTargetFolder>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/ILLink.Tasks.Tests/ILLink.Tasks.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
</PropertyGroup>

<PropertyGroup Condition="'$(MonoBuild)' == ''">
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(MonoBuild)' != ''">
<TargetFramework>net471</TargetFramework>
</PropertyGroup>

<ItemGroup Condition="'$(MonoBuild)' == ''">
<Compile Remove="System.Diagnostics.CodeAnalysis\*.cs" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions test/Mono.Linker.Tests.Cases/Mono.Linker.Tests.Cases.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<WarningLevel>0</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<LangVersion>8.0</LangVersion>
<LangVersion>Latest</LangVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(MonoBuild)' == ''">
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<DefineConstants>$(DefineConstants);ILLINK</DefineConstants>
</PropertyGroup>

Expand Down
4 changes: 1 addition & 3 deletions test/Mono.Linker.Tests/Mono.Linker.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
</PropertyGroup>

<PropertyGroup Condition="'$(MonoBuild)' == ''">
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<DefineConstants>$(DefineConstants);ILLINK</DefineConstants>
<DefineConstants Condition="'$(Configuration)' == 'Debug'">$(DefineConstants);DEBUG</DefineConstants>
<!-- Simulate https://github.com/dotnet/sdk/pull/2073 until it ships. -->
<DefineConstants Condition="'$(TargetFramework)' == 'netcoreapp3.0'">$(DefineConstants);NETCOREAPP</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(MonoBuild)' != ''">
Expand Down
6 changes: 4 additions & 2 deletions test/Mono.Linker.Tests/TestCases/TestDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,14 @@ static void GetDirectoryPaths (out string rootSourceDirectory, out string testCa
var configDirectoryName = "Release";
#endif

#if NETCOREAPP3_0
#if NET5_0
var tfm = "net5.0";
#elif NETCOREAPP3_0
var tfm = "netcoreapp3.0";
#elif NET471
var tfm = "net471";
#else
var tfm = "";
#error "Unknown TFM"
#endif

#if ILLINK
Expand Down
2 changes: 1 addition & 1 deletion test/Mono.Linker.Tests/TestCasesRunner/TestCaseSandbox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public virtual void Populate (TestCaseMetadaProvider metadataProvider)

private static NPath GetExpectationsAssemblyPath ()
{
return new Uri (typeof (KeptAttribute).Assembly.CodeBase).LocalPath.ToNPath ();
return new Uri (typeof (KeptAttribute).Assembly.Location).LocalPath.ToNPath ();
}

protected void CopyToInputAndExpectations (NPath source)
Expand Down