예제 #1
0
        public IScriptServicesBuilder LoadModules(string extension, params string[] moduleNames)
        {
            moduleNames = moduleNames.Union(new[] { GetEngineModule(moduleNames) }).ToArray();
            var config = new ModuleConfiguration(_cache, _scriptName, _repl, _logLevel, _debug, Overrides);
            var loader = InitializationServices.GetModuleLoader();

            var fs = InitializationServices.GetFileSystem();

            var folders = new[] { fs.GlobalFolder };

            loader.Load(config, folders, InitializationServices.GetFileSystem().HostBin, extension, moduleNames);
            return(this);
        }
예제 #2
0
        public IScriptServicesBuilder LoadModules(string extension, params string[] moduleNames)
        {
            var engineModule = _typeResolver.ResolveType("Mono.Runtime") != null || moduleNames.Contains("mono")
                ? "mono"
                : "roslyn";

            moduleNames = moduleNames.Union(new[] { engineModule }).ToArray();
            var config = new ModuleConfiguration(_cache, _scriptName, _repl, _logLevel, _debug, Overrides);
            var loader = InitializationServices.GetModuleLoader();

            var fs = InitializationServices.GetFileSystem();

            var folders = new[] { fs.GlobalFolder };

            loader.Load(config, folders, InitializationServices.GetFileSystem().HostBin, extension, moduleNames);
            return(this);
        }