[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:
Родитель
17aabebb03
Коммит
3046ebc1d6
|
@ -137,6 +137,7 @@
|
||||||
PlatformAssembly=$(_PlatformAssemblyName).dll
|
PlatformAssembly=$(_PlatformAssemblyName).dll
|
||||||
SdkVersion=$(_SdkVersion)
|
SdkVersion=$(_SdkVersion)
|
||||||
TargetArchitectures=$(TargetArchitectures)
|
TargetArchitectures=$(TargetArchitectures)
|
||||||
|
TargetFramework=$(_ComputedTargetFrameworkMoniker)
|
||||||
Verbosity=$(_BundlerVerbosity)
|
Verbosity=$(_BundlerVerbosity)
|
||||||
</_CustomLinkerOptions>
|
</_CustomLinkerOptions>
|
||||||
<_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --custom-data "LinkerOptionsFile=$(_CustomLinkerOptionsFile)"</_ExtraTrimmerArgs>
|
<_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --custom-data "LinkerOptionsFile=$(_CustomLinkerOptionsFile)"</_ExtraTrimmerArgs>
|
||||||
|
|
|
@ -37,10 +37,6 @@ namespace Xamarin.Bundler {
|
||||||
{
|
{
|
||||||
throw new NotImplementedException ();
|
throw new NotImplementedException ();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ApplePlatform Platform {
|
|
||||||
get { return Configuration.Platform; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public partial class Driver {
|
public partial class Driver {
|
||||||
|
|
|
@ -120,6 +120,11 @@ namespace Xamarin.Linker {
|
||||||
Abis.Add (a);
|
Abis.Add (a);
|
||||||
}
|
}
|
||||||
break;
|
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":
|
case "Verbosity":
|
||||||
if (!int.TryParse (value, out var verbosity))
|
if (!int.TryParse (value, out var verbosity))
|
||||||
throw new InvalidOperationException ($"Invalid Verbosity '{value}' in {linker_file}");
|
throw new InvalidOperationException ($"Invalid Verbosity '{value}' in {linker_file}");
|
||||||
|
@ -149,6 +154,9 @@ namespace Xamarin.Linker {
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Driver.TargetFramework.Platform != Platform)
|
||||||
|
throw ErrorHelper.CreateError (99, "Inconsistent platforms. TargetFramework={0}, Platform={1}", Driver.TargetFramework.Platform, Platform);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Write ()
|
public void Write ()
|
||||||
|
|
Загрузка…
Ссылка в новой задаче