@@ -44,6 +44,8 @@ public class Compiler {
44
44
45
45
static string kSystemBin = "/usr/bin/" ;
46
46
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" ;
47
49
48
50
[ ThreadStatic ]
49
51
static SwiftCompilerLocation systemCompilerLocation ;
@@ -329,29 +331,20 @@ static string BuildCSCompileArgs (string [] sourceFiles, string outputFile, stri
329
331
}
330
332
sb . Append ( ' ' ) ;
331
333
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 ;
344
334
case PlatformName . None :
345
335
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 ") ;
348
338
sb . Append ( $ "-r:{ Path . Combine ( referenceAssemblyDir , "System.dll" ) } ") ;
349
339
sb . Append ( $ "-r:{ Path . Combine ( referenceAssemblyDir , "System.Console.dll" ) } ") ;
350
340
sb . Append ( $ "-r:{ Path . Combine ( referenceAssemblyDir , "System.Runtime.dll" ) } ") ;
351
341
sb . Append ( $ "-r:{ Path . Combine ( referenceAssemblyDir , "System.Runtime.InteropServices.dll" ) } ") ;
352
342
sb . Append ( $ "-r:{ Path . Combine ( referenceAssemblyDir , "mscorlib.dll" ) } ") ;
353
343
sb . Append ( $ "-r:{ Path . Combine ( referenceAssemblyDir , "System.Text.Encoding.Extensions.dll" ) } ") ;
354
344
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?") ;
355
348
default :
356
349
throw new NotImplementedException ( platform . ToString ( ) ) ;
357
350
}
@@ -666,12 +659,8 @@ public static string RunWithDotnet (string filename, string workingDirectory = n
666
659
env . Add ( "DYLD_LIBRARY_PATH" , AddOrAppendPathTo ( Environment . GetEnvironmentVariables ( ) , "DYLD_LIBRARY_PATH" , $ "/usr/lib/swift:{ kSwiftRuntimeGlueDirectory } ") ) ;
667
660
switch ( platform ) {
668
661
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" ) ;
672
662
break ;
673
663
case PlatformName . None :
674
- env . Add ( "MONO_PATH" , AddOrAppendPathTo ( Environment . GetEnvironmentVariables ( ) , "MONO_PATH" , $ "{ ConstructorTests . kSwiftRuntimeOutputDirectory } ") ) ;
675
664
env [ "DYLD_LIBRARY_PATH" ] = AddOrAppendPathTo ( env , "DYLD_LIBRARY_PATH" , "." ) ;
676
665
if ( workingDirectory != null )
677
666
env [ "DYLD_LIBRARY_PATH" ] = AddOrAppendPathTo ( env , "DYLD_LIBRARY_PATH" , workingDirectory ) ;
0 commit comments