Skip to content

Commit 6d60ecc

Browse files
committed
fixes
1 parent 91a59d1 commit 6d60ecc

File tree

8 files changed

+12
-9
lines changed

8 files changed

+12
-9
lines changed

tools/assembly-preparer/Scaffolding/Application.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Xamarin.Bundler;
44

55
public class Application {
6-
Application () {}
6+
public Application () {}
77
public ApplePlatform Platform { get => throw new NotImplementedException (); }
88
public string ProductName => throw new NotImplementedException ();
99
public void LoadSymbols ()

tools/assembly-preparer/Scaffolding/DerivedLinkContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Xamarin.Tuner;
99
public class DerivedLinkContext : LinkContext {
1010
public RegistrarMode Registrar { get => Configuration.Registrar; }
1111

12-
public Target Target { get => throw new NotImplementedException (); }
12+
public Application App => Configuration.App;
1313

1414
public DerivedLinkContext (LinkerConfiguration configuration) : base (configuration)
1515
{

tools/assembly-preparer/Scaffolding/LinkerConfiguration.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
namespace Xamarin.Bundler;
1010

1111
public class LinkerConfiguration {
12+
public Application App { get; private set; } = new Application ();
13+
1214
List<ProductException> exceptions = new List<ProductException> ();
1315
public List<ProductException> Exceptions {
1416
get {

tools/assembly-preparer/assembly-preparer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<AssemblyName>assembly-preparer</AssemblyName>
55
<TargetFrameworks>net$(BundledNETCoreAppTargetFrameworkVersion);netstandard2.0</TargetFrameworks>
6-
<DefineConstants>$(DefineConstants);PRETRIM;ASSEMBLY_PREPARER</DefineConstants>
6+
<DefineConstants>$(DefineConstants);BUNDLER;ASSEMBLY_PREPARER</DefineConstants>
77
<OutputType>Library</OutputType>
88
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
99
<LangVersion>latest</LangVersion>

tools/common/Application.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,8 @@
2626

2727
#if LEGACY_TOOLS
2828
using PlatformResolver = MonoTouch.Tuner.MonoTouchResolver;
29-
#elif NET
30-
using PlatformResolver = Xamarin.Linker.DotNetResolver;
31-
#elif PRETRIM
3229
#else
33-
#error Invalid defines
30+
using PlatformResolver = Xamarin.Linker.DotNetResolver;
3431
#endif
3532

3633
// Disable until we get around to enable + fix any issues.

tools/common/cache.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class Cache {
1313
const string NAME = "mtouch";
1414
#elif BUNDLER
1515
const string NAME = "dotnet-linker";
16-
#elif PRETRIM
16+
#elif ASSEMBLY_PREPARER
1717
const string NAME = "assembly-preparer";
1818
#else
1919
#error Wrong defines

tools/linker/CoreOptimizeGeneratedCode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ int ProcessBlockLiteralConstructor (MethodDefinition caller, Instruction ins)
949949
return 0;
950950
}
951951

952-
var userDelegateType = LinkContext.Target.StaticRegistrar.GetUserDelegateType (trampolineMethod);
952+
var userDelegateType = LinkContext.App.StaticRegistrar.GetUserDelegateType (trampolineMethod);
953953
MethodReference? userMethod = null;
954954
var blockSignature = true;
955955
if (userDelegateType is not null) {

tools/mtouch/mtouch.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@
1010

1111
using Mono.Options;
1212

13+
using Xamarin.Utils;
14+
1315
namespace Xamarin.Bundler {
1416
public partial class Driver {
1517
internal const string NAME = "mtouch";
1618

1719
static int Main2 (string [] args)
1820
{
21+
ErrorHelper.Platform = ApplePlatform.iOS;
22+
1923
var app = new Application ();
2024
var os = new OptionSet ();
2125
ParseOptions (app, os, args);

0 commit comments

Comments
 (0)