[dotnet-linker] Add TargetFramework to the configuration and set Driver.TargetFramework.

This way we can use the shared Application.Platform implementation.
This commit is contained in:
Rolf Bjarne Kvinge 2020-08-13 18:56:36 +02:00
Родитель 17aabebb03
Коммит 3046ebc1d6
3 изменённых файлов: 9 добавлений и 4 удалений

Просмотреть файл

@ -137,6 +137,7 @@
PlatformAssembly=$(_PlatformAssemblyName).dll
SdkVersion=$(_SdkVersion)
TargetArchitectures=$(TargetArchitectures)
TargetFramework=$(_ComputedTargetFrameworkMoniker)
Verbosity=$(_BundlerVerbosity)
</_CustomLinkerOptions>
<_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --custom-data "LinkerOptionsFile=$(_CustomLinkerOptionsFile)"</_ExtraTrimmerArgs>

Просмотреть файл

@ -37,10 +37,6 @@ namespace Xamarin.Bundler {
{
throw new NotImplementedException ();
}
public ApplePlatform Platform {
get { return Configuration.Platform; }
}
}
public partial class Driver {

Просмотреть файл

@ -120,6 +120,11 @@ namespace Xamarin.Linker {
Abis.Add (a);
}
break;
case "TargetFramework":
if (!TargetFramework.TryParse (value, out var tf))
throw new InvalidOperationException ($"Invalid TargetFramework '{value}' in {linker_file}");
Driver.TargetFramework = TargetFramework.Parse (value);
break;
case "Verbosity":
if (!int.TryParse (value, out var verbosity))
throw new InvalidOperationException ($"Invalid Verbosity '{value}' in {linker_file}");
@ -149,6 +154,9 @@ namespace Xamarin.Linker {
default:
break;
}
if (Driver.TargetFramework.Platform != Platform)
throw ErrorHelper.CreateError (99, "Inconsistent platforms. TargetFramework={0}, Platform={1}", Driver.TargetFramework.Platform, Platform);
}
public void Write ()