Exemplo n.º 1
0
 public CustomSwiftCompiler(SwiftTargetCompilerInfo compilerInfo,
                            DisposableTempDirectory fileProvider,          // can be null
                            bool disposeSuppliedDirectory)
 {
     CompilerInfo         = compilerInfo;
     tempDirectory        = fileProvider ?? new DisposableTempDirectory(null, true);
     disposeTempDirectory = fileProvider != null ? disposeSuppliedDirectory : true;
 }
Exemplo n.º 2
0
        void CompileAllFiles(TempDirectorySwiftClassFileProvider fileProvider, string moduleName, string outputLibraryName,
                             string outputLibraryPath, string [] inputModulePaths, string [] inputLibraryPaths, string [] inputModuleNames, string target,
                             bool outputIsFramework)
        {
            SwiftTargetCompilerInfo compilerInfo = CompilerLocation.GetTargetInfo(target);

            using (CustomSwiftCompiler compiler = new CustomSwiftCompiler(compilerInfo, fileProvider, false)) {
                compiler.Verbose = verbose;
                string []            sourceFiles = fileProvider.CompletedFileNames.ToArray();
                SwiftCompilerOptions options     = new SwiftCompilerOptions(moduleName, inputModulePaths, inputLibraryPaths, inputModuleNames);
                compiler.Compile(options, outputIsFramework, sourceFiles);
            }
        }
        public SwiftTargetCompilerInfo GetTargetInfo(string target)
        {
            target = target ?? "";             // Null target valid but used as a key into dictionary

            if (TargetInfo.TryGetValue(target, out SwiftTargetCompilerInfo value))
            {
                return(value);
            }

            var info = SwiftTargetCompilerInfo.Create(this, target);

            TargetInfo.Add(target, info);
            return(info);
        }