Beispiel #1
0
 public ScriptServices(
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver,
     IScriptExecutor executor,
     IRepl repl,
     IScriptEngine engine,
     IFilePreProcessor filePreProcessor,
     IScriptPackResolver scriptPackResolver,
     IPackageInstaller packageInstaller,
     IObjectSerializer objectSerializer,
     ILog logger,
     IAssemblyResolver assemblyResolver,
     IEnumerable <IReplCommand> replCommands,
     IFileSystemMigrator fileSystemMigrator,
     IConsole console = null,
     IInstallationProvider installationProvider = null)
 {
     FileSystem = fileSystem;
     PackageAssemblyResolver = packageAssemblyResolver;
     Executor             = executor;
     Repl                 = repl;
     Engine               = engine;
     FilePreProcessor     = filePreProcessor;
     ScriptPackResolver   = scriptPackResolver;
     PackageInstaller     = packageInstaller;
     ObjectSerializer     = objectSerializer;
     Logger               = logger;
     Console              = console;
     AssemblyResolver     = assemblyResolver;
     InstallationProvider = installationProvider;
     ReplCommands         = replCommands;
     FileSystemMigrator   = fileSystemMigrator;
 }
Beispiel #2
0
 public ScriptServices(
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver,
     IScriptExecutor executor,
     IRepl repl,
     IScriptEngine engine,
     IFilePreProcessor filePreProcessor,
     IScriptPackResolver scriptPackResolver,
     IPackageInstaller packageInstaller,
     IObjectSerializer objectSerializer,
     ILog logger,
     IAssemblyResolver assemblyResolver,
     IEnumerable<IReplCommand> replCommands,
     IConsole console = null,
     IInstallationProvider installationProvider = null)
 {
     FileSystem = fileSystem;
     PackageAssemblyResolver = packageAssemblyResolver;
     Executor = executor;
     Repl = repl;
     Engine = engine;
     FilePreProcessor = filePreProcessor;
     ScriptPackResolver = scriptPackResolver;
     PackageInstaller = packageInstaller;
     ObjectSerializer = objectSerializer;
     Logger = logger;
     Console = console;
     AssemblyResolver = assemblyResolver;
     InstallationProvider = installationProvider;
     ReplCommands = replCommands;
 }
 public ScriptServices(
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver,
     IScriptExecutor executor,
     IScriptEngine engine,
     IFilePreProcessor filePreProcessor,
     IReplCommandService replCommandService,
     IScriptPackResolver scriptPackResolver,
     IPackageInstaller packageInstaller,
     ILog logger,
     IAssemblyResolver assemblyResolver,
     IConsole console = null,
     IInstallationProvider installationProvider = null
     )
 {
     FileSystem = fileSystem;
     PackageAssemblyResolver = packageAssemblyResolver;
     Executor             = executor;
     Engine               = engine;
     FilePreProcessor     = filePreProcessor;
     ReplCommandService   = replCommandService;
     ScriptPackResolver   = scriptPackResolver;
     PackageInstaller     = packageInstaller;
     Logger               = logger;
     Console              = console;
     AssemblyResolver     = assemblyResolver;
     InstallationProvider = installationProvider;
 }
Beispiel #4
0
        public AssemblyResolver(
            IFileSystem fileSystem,
            IPackageAssemblyResolver packageAssemblyResolver,
            IAssemblyUtility assemblyUtility,
            ILogProvider logProvider)
        {
            if (fileSystem == null)
            {
                throw new ArgumentNullException(nameof(fileSystem));
            }
            if (packageAssemblyResolver == null)
            {
                throw new ArgumentNullException(nameof(packageAssemblyResolver));
            }
            if (assemblyUtility == null)
            {
                throw new ArgumentNullException(nameof(assemblyUtility));
            }
            if (logProvider == null)
            {
                throw new ArgumentNullException(nameof(logProvider));
            }

            _fileSystem = fileSystem;
            _packageAssemblyResolver = packageAssemblyResolver;
            _assemblyUtility         = assemblyUtility;
            _logger = logProvider.ForCurrentType();
        }
Beispiel #5
0
 public RestoreCommand(string scriptName, IFileSystem fileSystem, IPackageAssemblyResolver packageAssemblyResolver, ILog logger)
 {
     _scriptName = scriptName;
     _fileSystem = fileSystem;
     _packageAssemblyResolver = packageAssemblyResolver;
     _logger = logger;
 }
Beispiel #6
0
 public RestoreCommand(string scriptName, IFileSystem fileSystem, IPackageAssemblyResolver packageAssemblyResolver, ILog logger)
 {
     _scriptName = scriptName;
     _fileSystem = fileSystem;
     _packageAssemblyResolver = packageAssemblyResolver;
     _logger = logger;
 }
 public ScriptServices(
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver, 
     IScriptExecutor executor,
     IScriptEngine engine,
     IFilePreProcessor filePreProcessor,
     IReplCommandService replCommandService,
     IScriptPackResolver scriptPackResolver, 
     IPackageInstaller packageInstaller,
     ILog logger,
     IAssemblyResolver assemblyResolver,
     IConsole console = null,
     IInstallationProvider installationProvider = null 
     )
 {
     FileSystem = fileSystem;
     PackageAssemblyResolver = packageAssemblyResolver;
     Executor = executor;
     Engine = engine;
     FilePreProcessor = filePreProcessor;
     ReplCommandService = replCommandService;
     ScriptPackResolver = scriptPackResolver;
     PackageInstaller = packageInstaller;
     Logger = logger;
     Console = console;
     AssemblyResolver = assemblyResolver;
     InstallationProvider = installationProvider;
 }
Beispiel #8
0
 public AssemblyResolver(
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver,
     IAssemblyUtility assemblyUtility,
     Common.Logging.ILog logger)
     :this(fileSystem,packageAssemblyResolver,assemblyUtility,new CommonLoggingLogProvider(logger))
 {
 }
Beispiel #9
0
 public AssemblyResolver(
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver,
     IAssemblyUtility assemblyUtility,
     Common.Logging.ILog logger)
     : this(fileSystem, packageAssemblyResolver, assemblyUtility, new CommonLoggingLogProvider(logger))
 {
 }
Beispiel #10
0
 public InstallCommand(
     IPackageInstaller packageInstaller,
     IPackageAssemblyResolver packageAssemblyResolver,
     Common.Logging.ILog logger,
     IInstallationProvider installationProvider)
     : this(packageInstaller, packageAssemblyResolver, new CommonLoggingLogProvider(logger), installationProvider)
 {
 }
Beispiel #11
0
 public InstallCommand(
     IPackageInstaller packageInstaller,
     IPackageAssemblyResolver packageAssemblyResolver,
     Common.Logging.ILog logger,
     IInstallationProvider installationProvider)
     :this(packageInstaller, packageAssemblyResolver,new CommonLoggingLogProvider(logger), installationProvider)
 {
 }
Beispiel #12
0
        public SaveCommand(IPackageAssemblyResolver packageAssemblyResolver, IFileSystem fileSystem, ILog logger)
        {
            Guard.AgainstNullArgument("packageAssemblyResolver", packageAssemblyResolver);
            Guard.AgainstNullArgument("fileSystem", fileSystem);

            _packageAssemblyResolver = packageAssemblyResolver;
            _fileSystem = fileSystem;
            _logger     = logger;
        }
Beispiel #13
0
        public SaveCommand(IPackageAssemblyResolver packageAssemblyResolver, IFileSystem fileSystem, ILog logger)
        {
            Guard.AgainstNullArgument("packageAssemblyResolver", packageAssemblyResolver);
            Guard.AgainstNullArgument("fileSystem", fileSystem);

            _packageAssemblyResolver = packageAssemblyResolver;
            _fileSystem = fileSystem;
            _logger = logger;
        }
Beispiel #14
0
        public SaveCommand(IPackageAssemblyResolver packageAssemblyResolver, IFileSystem fileSystem, ILogProvider logProvider)
        {
            Guard.AgainstNullArgument("packageAssemblyResolver", packageAssemblyResolver);
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgument("logProvider", logProvider);

            _packageAssemblyResolver = packageAssemblyResolver;
            _fileSystem = fileSystem;
            _logger     = logProvider.ForCurrentType();
        }
Beispiel #15
0
        public SaveCommand(IPackageAssemblyResolver packageAssemblyResolver, IFileSystem fileSystem, ILogProvider logProvider)
        {
            Guard.AgainstNullArgument("packageAssemblyResolver", packageAssemblyResolver);
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgument("logProvider", logProvider);

            _packageAssemblyResolver = packageAssemblyResolver;
            _fileSystem = fileSystem;
            _logger = logProvider.ForCurrentType();
        }
Beispiel #16
0
        public IPackageAssemblyResolver GetPackageAssemblyResolver()
        {
            if (_packageAssemblyResolver == null)
            {
                this.Logger.Debug("Resolving Package Assembly Resolver");
                _packageAssemblyResolver = Container.Resolve <IPackageAssemblyResolver>();
            }

            return(_packageAssemblyResolver);
        }
Beispiel #17
0
 public AssemblyResolver(
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver,
     IAssemblyUtility assemblyUtility,
     ILog logger)
 {
     _fileSystem = fileSystem;
     _packageAssemblyResolver = packageAssemblyResolver;
     _logger          = logger;
     _assemblyUtility = assemblyUtility;
 }
Beispiel #18
0
 public AssemblyResolver(
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver,
     IAssemblyUtility assemblyUtility,
     ILog logger)
 {
     _fileSystem = fileSystem;
     _packageAssemblyResolver = packageAssemblyResolver;
     _logger = logger;
     _assemblyUtility = assemblyUtility;
 }
 public InstallCommand(
     IPackageInstaller packageInstaller,
     IPackageAssemblyResolver packageAssemblyResolver,
     ILog logger,
     IInstallationProvider installationProvider)
 {
     _packageInstaller = packageInstaller;
     _packageAssemblyResolver = packageAssemblyResolver;
     _logger = logger;
     _installationProvider = installationProvider;
 }
Beispiel #20
0
 public MetadataReferenceLoader(
     IAssemblyLoader assemblyLoader,
     IPackageAssemblyResolver packageAssemblyResolver,
     IPackagesIntegrityValidator packagesIntegrityValidator,
     IPackageManager packageManager)
 {
     _assemblyLoader             = assemblyLoader ?? throw new ArgumentNullException(nameof(assemblyLoader));
     _packageAssemblyResolver    = packageAssemblyResolver ?? throw new ArgumentNullException(nameof(packageAssemblyResolver));
     _packagesIntegrityValidator = packagesIntegrityValidator ?? throw new ArgumentNullException(nameof(packagesIntegrityValidator));
     _packageManager             = packageManager ?? throw new ArgumentNullException(nameof(packageManager));
 }
Beispiel #21
0
 public ScriptServiceRoot(
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver, 
     IScriptExecutor executor, 
     IScriptPackResolver scriptPackResolver, IPackageInstaller packageInstaller)
 {
     FileSystem = fileSystem;
     PackageAssemblyResolver = packageAssemblyResolver;
     Executor = executor;
     ScriptPackResolver = scriptPackResolver;
     PackageInstaller = packageInstaller;
 }
Beispiel #22
0
 public ExecuteScriptCs(IFileSystem fileSystem,
                        IPackageAssemblyResolver packageAssemblyResolver,
                        IPackageInstaller packageInstaller, IScriptPackResolver scriptPackResolver,
                        IScriptExecutor scriptExecutor)
 {
     //this.logger = logger;
     this.fileSystem = fileSystem;
     this.packageAssemblyResolver = packageAssemblyResolver;
     this.packageInstaller        = packageInstaller;
     this.scriptPackResolver      = scriptPackResolver;
     this.scriptExecutor          = scriptExecutor;
 }
Beispiel #23
0
        public ExecuteScriptCs(IFileSystem fileSystem,
														IPackageAssemblyResolver packageAssemblyResolver,
														IPackageInstaller packageInstaller, IScriptPackResolver scriptPackResolver,
														IScriptExecutor scriptExecutor)
        {
            //this.logger = logger;
            this.fileSystem = fileSystem;
            this.packageAssemblyResolver = packageAssemblyResolver;
            this.packageInstaller = packageInstaller;
            this.scriptPackResolver = scriptPackResolver;
            this.scriptExecutor = scriptExecutor;
        }
Beispiel #24
0
 public InstallCommand(
     string name,
     bool allowPre,
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver,
     IPackageInstaller packageInstaller)
 {
     _name = name;
     _allowPre = allowPre;
     _fileSystem = fileSystem;
     _packageAssemblyResolver = packageAssemblyResolver;
     _packageInstaller = packageInstaller;
 }
        public ScriptLibraryComposer(IFileSystem fileSystem, IFilePreProcessor preProcessor, IPackageContainer packageContainer, IPackageAssemblyResolver packageAssemblyResolver, ILog logger)
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgument("preProcessor", preProcessor);
            Guard.AgainstNullArgument("packageContainer", packageContainer);
            Guard.AgainstNullArgument("packageAssemblyResolver", packageAssemblyResolver);
            Guard.AgainstNullArgument("logger", logger);

            _fileSystem              = fileSystem;
            _preProcessor            = preProcessor;
            _packageContainer        = packageContainer;
            _packageAssemblyResolver = packageAssemblyResolver;
            _logger = logger;
        }
        public ScriptLibraryComposer(IFileSystem fileSystem, IFilePreProcessor preProcessor, IPackageContainer packageContainer, IPackageAssemblyResolver packageAssemblyResolver, ILog logger)
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgument("preProcessor", preProcessor);
            Guard.AgainstNullArgument("packageContainer", packageContainer);
            Guard.AgainstNullArgument("packageAssemblyResolver", packageAssemblyResolver);
            Guard.AgainstNullArgument("logger", logger);

            _fileSystem = fileSystem;
            _preProcessor = preProcessor;
            _packageContainer = packageContainer;
            _packageAssemblyResolver = packageAssemblyResolver;
            _logger = logger;
        }
        public AssemblyResolver(
            IFileSystem fileSystem,
            IPackageAssemblyResolver packageAssemblyResolver,
            IAssemblyUtility assemblyUtility,
            ILog logger)
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgumentProperty("fileSystem", "PackagesFolder", fileSystem.PackagesFolder);
            Guard.AgainstNullArgumentProperty("fileSystem", "BinFolder", fileSystem.BinFolder);

            _fileSystem = fileSystem;
            _packageAssemblyResolver = packageAssemblyResolver;
            _logger          = logger;
            _assemblyUtility = assemblyUtility;
        }
Beispiel #28
0
 public InstallCommand(
     string name,
     bool allowPre,
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver,
     IPackageInstaller packageInstaller,
     ILog logger)
 {
     _name       = name;
     _allowPre   = allowPre;
     _fileSystem = fileSystem;
     _packageAssemblyResolver = packageAssemblyResolver;
     _packageInstaller        = packageInstaller;
     _logger = logger;
 }
Beispiel #29
0
        public InstallCommand(
            IPackageInstaller packageInstaller,
            IPackageAssemblyResolver packageAssemblyResolver,
            ILogProvider logProvider,
            IInstallationProvider installationProvider)
        {
            Guard.AgainstNullArgument("packageInstaller", packageInstaller);
            Guard.AgainstNullArgument("packageAssemblyResolver", packageAssemblyResolver);
            Guard.AgainstNullArgument("logProvider", logProvider);
            Guard.AgainstNullArgument("installationProvider", installationProvider);

            _packageInstaller        = packageInstaller;
            _packageAssemblyResolver = packageAssemblyResolver;
            _logger = logProvider.ForCurrentType();
            _installationProvider = installationProvider;
        }
Beispiel #30
0
        public AssemblyResolver(
            IFileSystem fileSystem,
            IPackageAssemblyResolver packageAssemblyResolver,
            IAssemblyUtility assemblyUtility,
            ILog logger)
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgumentProperty("fileSystem", "PackagesFolder", fileSystem.PackagesFolder);
            Guard.AgainstNullArgumentProperty("fileSystem", "BinFolder", fileSystem.BinFolder);

            _fileSystem = fileSystem;
            _packageAssemblyResolver = packageAssemblyResolver;
            _logger = logger;
            _assemblyUtility = assemblyUtility;

        }
Beispiel #31
0
        public InstallCommand(
            IPackageInstaller packageInstaller,
            IPackageAssemblyResolver packageAssemblyResolver,
            ILog logger,
            IInstallationProvider installationProvider)
        {
            Guard.AgainstNullArgument("packageInstaller", packageInstaller);
            Guard.AgainstNullArgument("packageAssemblyResolver", packageAssemblyResolver);
            Guard.AgainstNullArgument("logger", logger);
            Guard.AgainstNullArgument("installationProvider", installationProvider);

            _packageInstaller = packageInstaller;
            _packageAssemblyResolver = packageAssemblyResolver;
            _logger = logger;
            _installationProvider = installationProvider;
        }
Beispiel #32
0
        // prepare NuGet dependencies, download them if required
        private static IEnumerable <string> PreparePackages(
            string scriptPath,
            IFileSystem fileSystem, IPackageAssemblyResolver packageAssemblyResolver,
            IPackageInstaller packageInstaller)
        {
            var workingDirectory = Path.GetDirectoryName(scriptPath);
            var binDirectory     = Path.Combine(workingDirectory, @"bin\debug");         //TODO : ScriptCs.Constants.BinFolder

            var packages = packageAssemblyResolver.GetPackages(workingDirectory);

            packageInstaller.InstallPackages(
                packages,
                allowPreRelease: true);

            // current implementeation of RoslynCTP required dependencies to be in 'bin' folder
            if (!fileSystem.DirectoryExists(binDirectory))
            {
                fileSystem.CreateDirectory(binDirectory);
            }

            // copy dependencies one by one from 'packages' to 'bin'
            foreach (var assemblyName
                     in packageAssemblyResolver.GetAssemblyNames(workingDirectory))
            {
                var assemblyFileName = Path.GetFileName(assemblyName);
                var destFile         = Path.Combine(binDirectory, assemblyFileName);

                var sourceFileLastWriteTime = fileSystem.GetLastWriteTime(assemblyName);
                var destFileLastWriteTime   = fileSystem.GetLastWriteTime(destFile);

                if (sourceFileLastWriteTime == destFileLastWriteTime)
                {
                    //outputCallback(string.Format("Skipped: '{0}' because it is already exists", assemblyName));
                }
                else
                {
                    fileSystem.Copy(assemblyName, destFile, overwrite: true);

                    //if (outputCallback != null)
                    //{
                    //	outputCallback(string.Format("Copy: '{0}' to '{1}'", assemblyName, destFile));
                    //}
                }

                yield return(destFile);
            }
        }
Beispiel #33
0
        // prepare NuGet dependencies, download them if required
        private static IEnumerable<string> PreparePackages(
														string scriptPath,
														IFileSystem fileSystem, IPackageAssemblyResolver packageAssemblyResolver,
														IPackageInstaller packageInstaller)
        {
            var workingDirectory = Path.GetDirectoryName(scriptPath);
            var binDirectory = Path.Combine(workingDirectory, @"bin\debug"); //TODO : ScriptCs.Constants.BinFolder

            var packages = packageAssemblyResolver.GetPackages(workingDirectory);

            packageInstaller.InstallPackages(
                                                    packages,
                                                    allowPreRelease: true);

            // current implementeation of RoslynCTP required dependencies to be in 'bin' folder
            if (!fileSystem.DirectoryExists(binDirectory))
            {
                fileSystem.CreateDirectory(binDirectory);
            }

            // copy dependencies one by one from 'packages' to 'bin'
            foreach (var assemblyName
                                    in packageAssemblyResolver.GetAssemblyNames(workingDirectory))
            {
                var assemblyFileName = Path.GetFileName(assemblyName);
                var destFile = Path.Combine(binDirectory, assemblyFileName);

                var sourceFileLastWriteTime = fileSystem.GetLastWriteTime(assemblyName);
                var destFileLastWriteTime = fileSystem.GetLastWriteTime(destFile);

                if (sourceFileLastWriteTime == destFileLastWriteTime)
                {
                    //outputCallback(string.Format("Skipped: '{0}' because it is already exists", assemblyName));
                }
                else
                {
                    fileSystem.Copy(assemblyName, destFile, overwrite: true);

                    //if (outputCallback != null)
                    //{
                    //	outputCallback(string.Format("Copy: '{0}' to '{1}'", assemblyName, destFile));
                    //}
                }

                yield return destFile;
            }
        }
Beispiel #34
0
 public InstallCommand(
     string name,
     string version,
     bool allowPre,
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver,
     IPackageInstaller packageInstaller,
     ILog logger)
 {
     _name = name;
     _version = version ?? "";
     _allowPre = allowPre;
     _fileSystem = fileSystem;
     _packageAssemblyResolver = packageAssemblyResolver;
     _packageInstaller = packageInstaller;
     _logger = logger;
 }
Beispiel #35
0
 public InstallCommand(
     string name,
     string version,
     bool allowPre,
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver,
     IPackageInstaller packageInstaller,
     IScriptLibraryComposer composer,
     ILogProvider logger)
 {
     _name       = name;
     _version    = version ?? string.Empty;
     _allowPre   = allowPre;
     _fileSystem = fileSystem;
     _packageAssemblyResolver = packageAssemblyResolver;
     _packageInstaller        = packageInstaller;
     _composer = composer;
     _logger   = logger.ForCurrentType();
 }
Beispiel #36
0
 public InstallCommand(
     string name,
     string version,
     bool allowPre,
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver,
     IPackageInstaller packageInstaller,
     IScriptLibraryComposer composer,
     ILog logger)
 {
     _name = name;
     _version = version ?? string.Empty;
     _allowPre = allowPre;
     _fileSystem = fileSystem;
     _packageAssemblyResolver = packageAssemblyResolver;
     _packageInstaller = packageInstaller;
     _composer = composer;
     _logger = logger;
 }
Beispiel #37
0
        public AssemblyResolver(
            IFileSystem fileSystem,
            IPackageAssemblyResolver packageAssemblyResolver,
            IAssemblyUtility assemblyUtility,
            ILogProvider logProvider)
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgumentProperty("fileSystem", "PackagesFolder", fileSystem.PackagesFolder);
            Guard.AgainstNullArgumentProperty("fileSystem", "BinFolder", fileSystem.BinFolder);

            Guard.AgainstNullArgument("packageAssemblyResolver", packageAssemblyResolver);
            Guard.AgainstNullArgument("assemblyUtility", assemblyUtility);
            Guard.AgainstNullArgument("logProvider", logProvider);

            _fileSystem = fileSystem;
            _packageAssemblyResolver = packageAssemblyResolver;
            _assemblyUtility = assemblyUtility;
            _logger = logProvider.ForCurrentType();
        }
Beispiel #38
0
        public AssemblyResolver(
            IFileSystem fileSystem,
            IPackageAssemblyResolver packageAssemblyResolver,
            IAssemblyUtility assemblyUtility,
            ILogProvider logProvider)
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgumentProperty("fileSystem", "PackagesFolder", fileSystem.PackagesFolder);
            Guard.AgainstNullArgumentProperty("fileSystem", "BinFolder", fileSystem.BinFolder);

            Guard.AgainstNullArgument("packageAssemblyResolver", packageAssemblyResolver);
            Guard.AgainstNullArgument("assemblyUtility", assemblyUtility);
            Guard.AgainstNullArgument("logProvider", logProvider);

            _fileSystem = fileSystem;
            _packageAssemblyResolver = packageAssemblyResolver;
            _assemblyUtility         = assemblyUtility;
            _logger = logProvider.ForCurrentType();
        }
Beispiel #39
0
 public ScriptServiceRoot(
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver, 
     IScriptExecutor executor,
     IScriptEngine engine,
     IFilePreProcessor filePreProcessor,
     IScriptPackResolver scriptPackResolver, 
     IPackageInstaller packageInstaller,
     ILog logger,
     IConsole console = null)
 {
     FileSystem = fileSystem;
     PackageAssemblyResolver = packageAssemblyResolver;
     Executor = executor;
     Engine = engine;
     FilePreProcessor = filePreProcessor;
     ScriptPackResolver = scriptPackResolver;
     PackageInstaller = packageInstaller;
     Logger = logger;
     Console = console;
 }
Beispiel #40
0
        public InstallCommand(
            string name,
            string version,
            bool allowPre,
            IFileSystem fileSystem,
            IPackageAssemblyResolver packageAssemblyResolver,
            IPackageInstaller packageInstaller,
            ILog logger,
            IFileSystemMigrator fileSystemMigrator)
        {
            Guard.AgainstNullArgument("fileSystemMigrator", fileSystemMigrator);

            _name       = name;
            _version    = version ?? string.Empty;
            _allowPre   = allowPre;
            _fileSystem = fileSystem;
            _packageAssemblyResolver = packageAssemblyResolver;
            _packageInstaller        = packageInstaller;
            _logger             = logger;
            _fileSystemMigrator = fileSystemMigrator;
        }
 public MetadataGenerator(
     ICakeSourceGeneratorService cakeSourceGenerator,
     ICakeSyntaxRewriterService cakeSyntaxRewriterService,
     IPackageManager packageManager,
     IDependencyResolver dependencyResolver,
     IPackageAssemblyResolver packageAssemblyResolver,
     ICompiler compiler,
     IMetadataReferenceLoader metadataReferenceLoader,
     ICompilationProvider compilationProvider,
     IFileSystem fileSystem)
 {
     _cakeSourceGenerator       = cakeSourceGenerator ?? throw new ArgumentNullException(nameof(cakeSourceGenerator));
     _cakeSyntaxRewriterService = cakeSyntaxRewriterService ?? throw new ArgumentNullException(nameof(cakeSyntaxRewriterService));
     _packageManager            = packageManager ?? throw new ArgumentNullException(nameof(packageManager));
     _dependencyResolver        = dependencyResolver ?? throw new ArgumentNullException(nameof(dependencyResolver));
     _packageAssemblyResolver   = packageAssemblyResolver ?? throw new ArgumentNullException(nameof(packageAssemblyResolver));
     _compiler = compiler ?? throw new ArgumentNullException(nameof(compiler));
     _metadataReferenceLoader = metadataReferenceLoader ?? throw new ArgumentNullException(nameof(metadataReferenceLoader));
     _compilationProvider     = compilationProvider ?? throw new ArgumentNullException(nameof(compilationProvider));
     _fileSystem = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem));
 }
Beispiel #42
0
 public ScriptServiceRoot(
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver,
     IScriptExecutor executor,
     IScriptEngine engine,
     IFilePreProcessor filePreProcessor,
     IScriptPackResolver scriptPackResolver,
     IPackageInstaller packageInstaller,
     ILog logger,
     IConsole console = null)
 {
     FileSystem = fileSystem;
     PackageAssemblyResolver = packageAssemblyResolver;
     Executor           = executor;
     Engine             = engine;
     FilePreProcessor   = filePreProcessor;
     ScriptPackResolver = scriptPackResolver;
     PackageInstaller   = packageInstaller;
     Logger             = logger;
     Console            = console;
 }
Beispiel #43
0
        public ReplExecutor(
            IRepl repl,
            IObjectSerializer serializer,
            IFileSystem fileSystem,
            IFilePreProcessor filePreProcessor,
            IScriptEngine scriptEngine,
            IPackageInstaller packageInstaller,
            IPackageAssemblyResolver resolver,
            ILog logger)
            : base(fileSystem, filePreProcessor, scriptEngine, logger)
        {
            this.repl = repl;
            this.serializer = serializer;
            this.packageInstaller = packageInstaller;
            this.resolver = resolver;

            replCompletion = new CSharpCompletion(true);
            replCompletion.AddReferences(GetReferencesAsPaths());

            //since it's quite expensive to initialize the "System." references we clone the REPL code completion
            documentCompletion = replCompletion.Clone();
        }
Beispiel #44
0
        public ScriptServices(
            IFileSystem fileSystem,
            IPackageAssemblyResolver packageAssemblyResolver,
            IScriptExecutor executor,
            IRepl repl,
            IScriptEngine engine,
            IFilePreProcessor filePreProcessor,
            IScriptPackResolver scriptPackResolver,
            IPackageInstaller packageInstaller,
            IObjectSerializer objectSerializer,
            ILogProvider logProvider,
            IAssemblyResolver assemblyResolver,
            IEnumerable <IReplCommand> replCommands,
            IFileSystemMigrator fileSystemMigrator,
            IConsole console = null,
            IInstallationProvider installationProvider   = null,
            IScriptLibraryComposer scriptLibraryComposer = null
            )
        {
            FileSystem = fileSystem;
            PackageAssemblyResolver = packageAssemblyResolver;
            Executor           = executor;
            Repl               = repl;
            Engine             = engine;
            FilePreProcessor   = filePreProcessor;
            ScriptPackResolver = scriptPackResolver;
            PackageInstaller   = packageInstaller;
            ObjectSerializer   = objectSerializer;
            LogProvider        = logProvider;
#pragma warning disable 618
            Logger = new ScriptCsLogger(logProvider.ForCurrentType());
#pragma warning restore 618
            Console               = console;
            AssemblyResolver      = assemblyResolver;
            InstallationProvider  = installationProvider;
            ReplCommands          = replCommands;
            FileSystemMigrator    = fileSystemMigrator;
            ScriptLibraryComposer = scriptLibraryComposer;
        }
Beispiel #45
0
        public ScriptServices(
            IFileSystem fileSystem,
            IPackageAssemblyResolver packageAssemblyResolver,
            IScriptExecutor executor,
            IRepl repl,
            IScriptEngine engine,
            IFilePreProcessor filePreProcessor,
            IScriptPackResolver scriptPackResolver,
            IPackageInstaller packageInstaller,
            IObjectSerializer objectSerializer,
            ILogProvider logProvider,
            IAssemblyResolver assemblyResolver,
            IEnumerable<IReplCommand> replCommands,
            IFileSystemMigrator fileSystemMigrator,
            IConsole console = null,
            IInstallationProvider installationProvider = null,
            IScriptLibraryComposer scriptLibraryComposer = null
            )
        {
            FileSystem = fileSystem;
            PackageAssemblyResolver = packageAssemblyResolver;
            Executor = executor;
            Repl = repl;
            Engine = engine;
            FilePreProcessor = filePreProcessor;
            ScriptPackResolver = scriptPackResolver;
            PackageInstaller = packageInstaller;
            ObjectSerializer = objectSerializer;
            LogProvider = logProvider;
#pragma warning disable 618
            Logger = new ScriptCsLogger(logProvider.ForCurrentType());
#pragma warning restore 618
            Console = console;
            AssemblyResolver = assemblyResolver;
            InstallationProvider = installationProvider;
            ReplCommands = replCommands;
            FileSystemMigrator = fileSystemMigrator;
            ScriptLibraryComposer = scriptLibraryComposer;
        }
Beispiel #46
0
 public ScriptServices(
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver,
     IScriptExecutor executor,
     IRepl repl,
     IScriptEngine engine,
     IFilePreProcessor filePreProcessor,
     IScriptPackResolver scriptPackResolver,
     IPackageInstaller packageInstaller,
     IObjectSerializer objectSerializer,
     Common.Logging.ILog logger,
     IAssemblyResolver assemblyResolver,
     IEnumerable<IReplCommand> replCommands,
     IFileSystemMigrator fileSystemMigrator,
     IConsole console = null,
     IInstallationProvider installationProvider = null,
     IScriptLibraryComposer scriptLibraryComposer = null
     )
     : this(
         fileSystem,
         packageAssemblyResolver,
         executor,
         repl,
         engine,
         filePreProcessor,
         scriptPackResolver,
         packageInstaller,
         objectSerializer,
         new CommonLoggingLogProvider(logger),
         assemblyResolver,
         replCommands,
         fileSystemMigrator,
         console,
         installationProvider,
         scriptLibraryComposer
     )
 {
 }
Beispiel #47
0
 public ScriptServices(
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver,
     IScriptExecutor executor,
     IRepl repl,
     IScriptEngine engine,
     IFilePreProcessor filePreProcessor,
     IScriptPackResolver scriptPackResolver,
     IPackageInstaller packageInstaller,
     IObjectSerializer objectSerializer,
     Common.Logging.ILog logger,
     IAssemblyResolver assemblyResolver,
     IEnumerable <IReplCommand> replCommands,
     IFileSystemMigrator fileSystemMigrator,
     IConsole console = null,
     IInstallationProvider installationProvider   = null,
     IScriptLibraryComposer scriptLibraryComposer = null
     )
     : this(
         fileSystem,
         packageAssemblyResolver,
         executor,
         repl,
         engine,
         filePreProcessor,
         scriptPackResolver,
         packageInstaller,
         objectSerializer,
         new CommonLoggingLogProvider(logger),
         assemblyResolver,
         replCommands,
         fileSystemMigrator,
         console,
         installationProvider,
         scriptLibraryComposer
         )
 {
 }
Beispiel #48
0
 public SaveCommand(IPackageAssemblyResolver packageAssemblyResolver)
 {
     _packageAssemblyResolver = packageAssemblyResolver;
 }
 public SaveCommand(IPackageAssemblyResolver packageAssemblyResolver, ILog logger)
 {
     _packageAssemblyResolver = packageAssemblyResolver;
     _logger = logger;
 }
Beispiel #50
0
 public ScriptLibraryComposer(IFileSystem fileSystem, IFilePreProcessor preProcessor, IPackageContainer packageContainer, IPackageAssemblyResolver packageAssemblyResolver, Common.Logging.ILog logger)
     : this(fileSystem, preProcessor, packageContainer, packageAssemblyResolver, new CommonLoggingLogProvider(logger))
 {
 }
 public ScriptLibraryComposer(IFileSystem fileSystem, IFilePreProcessor preProcessor, IPackageContainer packageContainer, IPackageAssemblyResolver packageAssemblyResolver, Common.Logging.ILog logger)
     : this(fileSystem, preProcessor, packageContainer, packageAssemblyResolver, new CommonLoggingLogProvider(logger))
 {
 }
        public IPackageAssemblyResolver GetPackageAssemblyResolver()
        {
            if (_packageAssemblyResolver == null)
            {
                this.Logger.Debug("Resolving Package Assembly Resolver");
                _packageAssemblyResolver = Container.Resolve<IPackageAssemblyResolver>();
            }

            return _packageAssemblyResolver;
        }
Beispiel #53
0
 public CleanCommand(string scriptName, IFileSystem fileSystem, IPackageAssemblyResolver packageAssemblyResolver)
 {
     _scriptName = scriptName;
     _fileSystem = fileSystem;
     _packageAssemblyResolver = packageAssemblyResolver;
 }
Beispiel #54
0
 public SaveCommand(IPackageAssemblyResolver packageAssemblyResolver, ILog logger)
 {
     _packageAssemblyResolver = packageAssemblyResolver;
     _logger = logger;
 }
Beispiel #55
0
 public SaveCommand(IPackageAssemblyResolver packageAssemblyResolver)
 {
     _packageAssemblyResolver = packageAssemblyResolver;
 }