@@ -44,6 +44,8 @@ public class Compiler {
4444
4545 static string kSystemBin = "/usr/bin/" ;
4646 public const string kSystemLib = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/macosx" ;
47+ public static string kSwiftRuntimeOutputDirectory = Path . Combine ( TestContext . CurrentContext . TestDirectory , $ "../../../../../SwiftRuntimeLibrary/bin/Debug/net{ Compiler . kframeWorkVersion } ") ;
48+ public const string kSwiftRuntimeLibrary = "SwiftRuntimeLibrary" ;
4749
4850 [ ThreadStatic ]
4951 static SwiftCompilerLocation systemCompilerLocation ;
@@ -329,29 +331,20 @@ static string BuildCSCompileArgs (string [] sourceFiles, string outputFile, stri
329331 }
330332 sb . Append ( ' ' ) ;
331333 switch ( platform ) {
332- case PlatformName . macOS :
333- sb . Append ( $ "-lib:{ ConstructorTests . kSwiftRuntimeMacOutputDirectory } ") ;
334- sb . Append ( $ "-r:{ ConstructorTests . kSwiftRuntimeLibraryMac } .dll ") ;
335- sb . Append ( $ "-lib:{ ConstructorTests . kXamarinMacDir } ") ;
336- sb . Append ( $ "-r:Xamarin.Mac.dll ") ;
337- break ;
338- case PlatformName . iOS :
339- sb . Append ( $ "-lib:{ ConstructorTests . kSwiftRuntimeiOSOutputDirectory } ") ;
340- sb . Append ( $ "-r:{ ConstructorTests . kSwiftRuntimeLibraryiOS } .dll ") ;
341- sb . Append ( $ "-lib:{ ConstructorTests . kXamariniOSDir } ") ;
342- sb . Append ( $ "-r:Xamarin.iOS.dll ") ;
343- break ;
344334 case PlatformName . None :
345335 var referenceAssemblyDir = GetReferenceAssemblyLocation ( ) ;
346- sb . Append ( $ "-lib:{ ConstructorTests . kSwiftRuntimeOutputDirectory } ") ;
347- sb . Append ( $ "-r:{ ConstructorTests . kSwiftRuntimeLibrary } .dll ") ;
336+ sb . Append ( $ "-lib:{ kSwiftRuntimeOutputDirectory } ") ;
337+ sb . Append ( $ "-r:{ kSwiftRuntimeLibrary } .dll ") ;
348338 sb . Append ( $ "-r:{ Path . Combine ( referenceAssemblyDir , "System.dll" ) } ") ;
349339 sb . Append ( $ "-r:{ Path . Combine ( referenceAssemblyDir , "System.Console.dll" ) } ") ;
350340 sb . Append ( $ "-r:{ Path . Combine ( referenceAssemblyDir , "System.Runtime.dll" ) } ") ;
351341 sb . Append ( $ "-r:{ Path . Combine ( referenceAssemblyDir , "System.Runtime.InteropServices.dll" ) } ") ;
352342 sb . Append ( $ "-r:{ Path . Combine ( referenceAssemblyDir , "mscorlib.dll" ) } ") ;
353343 sb . Append ( $ "-r:{ Path . Combine ( referenceAssemblyDir , "System.Text.Encoding.Extensions.dll" ) } ") ;
354344 break ;
345+ case PlatformName . macOS :
346+ case PlatformName . iOS :
347+ throw new NotImplementedException ( $ "This code path is obsolete for { platform } - how did you get here?") ;
355348 default :
356349 throw new NotImplementedException ( platform . ToString ( ) ) ;
357350 }
@@ -666,12 +659,8 @@ public static string RunWithDotnet (string filename, string workingDirectory = n
666659 env . Add ( "DYLD_LIBRARY_PATH" , AddOrAppendPathTo ( Environment . GetEnvironmentVariables ( ) , "DYLD_LIBRARY_PATH" , $ "/usr/lib/swift:{ kSwiftRuntimeGlueDirectory } ") ) ;
667660 switch ( platform ) {
668661 case PlatformName . macOS :
669- // This is really a hack, any tests needing to use XM, should create a proper .app using mmp instead.
670- env . Add ( "MONO_PATH" , AddOrAppendPathTo ( Environment . GetEnvironmentVariables ( ) , "MONO_PATH" , $ "{ ConstructorTests . kSwiftRuntimeMacOutputDirectory } ") ) ;
671- env [ "DYLD_LIBRARY_PATH" ] = AddOrAppendPathTo ( env , "DYLD_LIBRARY_PATH" , "/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib" ) ;
672662 break ;
673663 case PlatformName . None :
674- env . Add ( "MONO_PATH" , AddOrAppendPathTo ( Environment . GetEnvironmentVariables ( ) , "MONO_PATH" , $ "{ ConstructorTests . kSwiftRuntimeOutputDirectory } ") ) ;
675664 env [ "DYLD_LIBRARY_PATH" ] = AddOrAppendPathTo ( env , "DYLD_LIBRARY_PATH" , "." ) ;
676665 if ( workingDirectory != null )
677666 env [ "DYLD_LIBRARY_PATH" ] = AddOrAppendPathTo ( env , "DYLD_LIBRARY_PATH" , workingDirectory ) ;
0 commit comments