@@ -17,6 +17,11 @@ public class AssemblyPreparer : IDisposable {
1717
1818 public string MakeReproPath { get ; set ; } = string . Empty ;
1919
20+ public RegistrarMode Registrar {
21+ get => configuration . Registrar ;
22+ set => configuration . Registrar = value ;
23+ }
24+
2025 public AssemblyPreparerInfo [ ] Assemblies { get ; set ; }
2126
2227 public AssemblyPreparer ( AssemblyPreparerInfo [ ] assemblies , ApplePlatform platform )
@@ -42,6 +47,7 @@ bool SaveToReproPath (List<ProductException> exceptions)
4247 Directory . CreateDirectory ( MakeReproPath ) ;
4348 var lines = new List < string > ( ) ;
4449 lines . Add ( $ "Platform: { configuration . Platform } ") ;
50+ lines . Add ( $ "Registrar: { configuration . Registrar } ") ;
4551 foreach ( var assembly in Assemblies ) {
4652 lines . Add ( $ "Assembly: { Path . GetFileName ( assembly . InputPath ) } ") ;
4753 File . Copy ( assembly . InputPath , Path . Combine ( MakeReproPath , Path . GetFileName ( assembly . InputPath ) ) ) ;
@@ -69,6 +75,13 @@ public static AssemblyPreparer LoadFromReproPath (string reproPath)
6975 platform = Enum . Parse < ApplePlatform > ( platformStr ) ;
7076#else
7177 platform = ( ApplePlatform ) Enum . Parse ( typeof ( ApplePlatform ) , platformStr ) ;
78+ #endif
79+ } else if ( line . StartsWith ( "Registrar: " ) ) {
80+ var registrarStr = line . Substring ( "Registrar: " . Length ) ;
81+ #if NET
82+ registrar = Enum . Parse < RegistrarMode > ( registrarStr ) ;
83+ #else
84+ registrar = ( RegistrarMode ) Enum . Parse ( typeof ( RegistrarMode ) , registrarStr ) ;
7285#endif
7386 } else if ( line . StartsWith ( "Assembly: " ) ) {
7487 var assembly = line . Substring ( "Assembly: " . Length ) ;
@@ -90,13 +103,17 @@ public bool Prepare (out List<ProductException> exceptions)
90103 {
91104 exceptions = configuration . Exceptions ;
92105
106+ if ( Registrar == RegistrarMode . Default ) {
107+ exceptions . Add ( ErrorHelper . CreateError ( 99 , "RegistrarMode must be explicitly set." ) ) ;
108+ return false ;
93109 }
94110
95111 if ( ! string . IsNullOrEmpty ( MakeReproPath ) && ! SaveToReproPath ( exceptions ) )
96112 return false ;
97113
98114 var markHandlers = new IMarkHandler [ ] {
99115 new PreserveBlockCodeHandler ( ) ,
116+ new MarkIProtocolHandler ( ) ,
100117 } ;
101118
102119 var linkContext = new DerivedLinkContext ( configuration ) ;
@@ -109,12 +126,9 @@ public bool Prepare (out List<ProductException> exceptions)
109126
110127 // load assemblies
111128
112- var assemblyResolver = new DefaultAssemblyResolver ( ) ;
113- // var metadataResolver = new DefaultMetadataResolver ();
114-
115129 var parameters = new ReaderParameters {
116- AssemblyResolver = assemblyResolver ,
117- // MetadataResolver = metadataResolver ,
130+ AssemblyResolver = configuration . AssemblyResolver ,
131+ MetadataResolver = configuration . MetadataResolver ,
118132 ReadSymbols = true ,
119133 SymbolReaderProvider = new DefaultSymbolReaderProvider ( throwIfNoSymbol : false ) ,
120134 } ;
0 commit comments