public SpecExecution(SpecExecutionRequest request, StopConditions stopConditions, IExecutionLogger logger)
 {
     Request = request;
     StopConditions = stopConditions;
     Logger = logger;
     Mode = request.Mode;
 }
Beispiel #2
0
        public override Task InstallPackage(
            PackageIdentity id,
            IEnumerable <FrameworkName> packageSupportedFrameworks,
            IExecutionLogger logger,
            CancellationToken cancelToken)
        {
            var args = new Dictionary <string, object>();
            var projectFrameworks = _nugetAwareProject.GetSupportedFrameworksAsync(cancelToken).Result;

            args["Frameworks"] = projectFrameworks.Where(
                projectFramework =>
                NuGet.VersionUtility.IsCompatible(
                    projectFramework,
                    packageSupportedFrameworks)).ToArray();
            var task = _nugetAwareProject.InstallPackageAsync(
                new NuGetPackageMoniker
            {
                Id      = id.Id,
                Version = id.Version.ToString()
            },
                args,
                logger: null,
                progress: null,
                cancellationToken: cancelToken);

            return(task);
        }
 public SpecExecution(SpecExecutionRequest request, StopConditions stopConditions, IExecutionLogger logger)
 {
     Request        = request;
     StopConditions = stopConditions;
     Logger         = logger;
     Mode           = request.Mode;
 }
Beispiel #4
0
 public SolutionController(IDataService <DiscreteLogarithm> discreteLogarithmDataService,
                           IDataService <IntegerFactorization> integerFactorizationDataService, IExecutionLogger executionLogger)
 {
     _discreteLogarithmDataService    = discreteLogarithmDataService;
     _integerFactorizationDataService = integerFactorizationDataService;
     _executionLogger = executionLogger;
 }
 public override Task InstallPackage(
     PackageIdentity id, 
     IEnumerable<FrameworkName> packageSupportedFrameworks,
     IExecutionLogger logger, 
     CancellationToken cancelToken)
 {
     var args = new Dictionary<string, object>();
     var projectFrameworks = _nugetAwareProject.GetSupportedFrameworksAsync(cancelToken).Result;
     args["Frameworks"] = projectFrameworks.Where(
         projectFramework =>
             NuGet.VersionUtility.IsCompatible(
                 projectFramework,
                 packageSupportedFrameworks)).ToArray();
     var task = _nugetAwareProject.InstallPackageAsync(
         new NuGetPackageMoniker
         {
             Id = id.Id,
             Version = id.Version.ToString()
         },
         args,
         logger: null,
         progress: null,
         cancellationToken: cancelToken);
     return task;
 }
Beispiel #6
0
        public abstract Task InstallPackage(
            PackageIdentity id,

            // the supported frameworks of the package
            IEnumerable <FrameworkName> frameworks,

            IExecutionLogger logger,
            CancellationToken cancelToken);
        public abstract Task InstallPackage(
            PackageIdentity id,

            // the supported frameworks of the package
            IEnumerable<FrameworkName> frameworks,

            IExecutionLogger logger,             
            CancellationToken cancelToken);
        public ProductionDiagnosticEnvelopeContext(ILogger logger, ISystemTime systemTime, IChainInvoker invoker, IOutgoingSender outgoing, IHandlerPipeline pipeline, Envelope envelope, IExecutionLogger executionLogger) : base(logger, systemTime, invoker, outgoing, pipeline)
        {
            _envelope        = envelope;
            _executionLogger = executionLogger;
            _log             = new ChainExecutionLog();

            _envelope.Log = _log;
        }
        public ProductionDiagnosticEnvelopeContext(ILogger logger, ISystemTime systemTime, IChainInvoker invoker, IOutgoingSender outgoing, IHandlerPipeline pipeline, Envelope envelope, IExecutionLogger executionLogger)
            : base(logger, systemTime, invoker, outgoing, pipeline)
        {
            _envelope = envelope;
            _executionLogger = executionLogger;
            _log = new ChainExecutionLog();

            _envelope.Log = _log;
        }
Beispiel #10
0
        public async Task <IEnumerable <PackageAction> > ResolveActionsAsync(IExecutionLogger logger)
        {
            var model  = (DetailControlModel)DataContext;
            var action = model.SelectedAction == Resx.Resources.Action_Uninstall ?
                         PackageActionType.Uninstall :
                         PackageActionType.Install;

            // Create resolver
            var repo = Control.CreateActiveRepository();

            if (action == PackageActionType.Uninstall)
            {
                // for uninstall, use local repo
                repo = Control.Target.TryGetFeature <SourceRepository>();
            }
            if (repo == null)
            {
                throw new InvalidOperationException(Resx.Resources.Error_NoActiveRepository);
            }

            var dependencyResolutionRepo = Control.CreateAggregateSourceRepository();
            var resolver = new ActionResolver(
                repo,
                dependencyResolutionRepo,
                new ResolutionContext()
            {
                DependencyBehavior = model.Options.SelectedDependencyBehavior.Behavior,
                AllowPrerelease    = Control.IncludePrerelease,
                ForceRemove        = model.Options.ForceRemove,
                RemoveDependencies = model.Options.RemoveDependencies
            });

            resolver.Logger = logger;

            IEnumerable <Project> targetProjects;
            var solutionModel = DataContext as PackageSolutionDetailControlModel;

            if (solutionModel != null)
            {
                targetProjects = solutionModel.Projects
                                 .Where(p => p.Selected)
                                 .Select(p => p.Project);
            }
            else
            {
                var project = Control.Target as Project;
                targetProjects = new[] { project };
                Debug.Assert(project != null);
            }

            return(await resolver.ResolveActionsAsync(
                       new PackageIdentity(model.Id, model.SelectedVersion.Version),
                       action,
                       targetProjects,
                       Control.Target.OwnerSolution));
        }
        public async Task<IEnumerable<PackageAction>> ResolveActionsAsync(IExecutionLogger logger)
        {
            var model = (DetailControlModel)DataContext;
            var action = model.SelectedAction == Resx.Resources.Action_Uninstall ?
                PackageActionType.Uninstall :
                PackageActionType.Install;

            // Create resolver
            var repo = Control.CreateActiveRepository();
            if (action == PackageActionType.Uninstall)
            {
                // for uninstall, use local repo
                repo = Control.Target.TryGetFeature<SourceRepository>();
            }
            if (repo == null)
            {
                throw new InvalidOperationException(Resx.Resources.Error_NoActiveRepository);
            }

            var dependencyResolutionRepo = Control.CreateAggregateSourceRepository();
            var resolver = new ActionResolver(
                repo,
                dependencyResolutionRepo,
                new ResolutionContext()
                {
                    DependencyBehavior = model.Options.SelectedDependencyBehavior.Behavior,
                    AllowPrerelease = Control.IncludePrerelease,
                    ForceRemove = model.Options.ForceRemove,
                    RemoveDependencies = model.Options.RemoveDependencies
                });
            resolver.Logger = logger;

            IEnumerable<Project> targetProjects;
            var solutionModel = DataContext as PackageSolutionDetailControlModel;
            if (solutionModel != null)
            {
                targetProjects = solutionModel.Projects
                   .Where(p => p.Selected)
                   .Select(p => p.Project);
            }
            else
            {
                var project = Control.Target as Project;
                targetProjects = new[] { project };
                Debug.Assert(project != null);
            }

            return await resolver.ResolveActionsAsync(
                new PackageIdentity(model.Id, model.SelectedVersion.Version),
                action,
                targetProjects,
                Control.Target.OwnerSolution);
        }
 public override Task UninstallPackage(PackageIdentity id, IExecutionLogger logger, CancellationToken cancelToken)
 {
     var args = new Dictionary<string, object>();
     var task = _nugetAwareProject.UninstallPackageAsync(
         new NuGetPackageMoniker
         {
             Id = id.Id,
             Version = id.Version.ToString()
         },
         args,
         logger: null,
         progress: null,
         cancellationToken: cancelToken);
     return task;
 }
Beispiel #13
0
        public override Task UninstallPackage(PackageIdentity id, IExecutionLogger logger, CancellationToken cancelToken)
        {
            var args = new Dictionary <string, object>();
            var task = _nugetAwareProject.UninstallPackageAsync(
                new NuGetPackageMoniker
            {
                Id      = id.Id,
                Version = id.Version.ToString()
            },
                args,
                logger: null,
                progress: null,
                cancellationToken: cancelToken);

            return(task);
        }
        public override void ExecuteScript(string packageInstallPath, string scriptRelativePath, object package, InstallationTarget target, IExecutionLogger logger)
        {
            IPackage packageObject = (IPackage)package;

            // If we don't have a project, we're at solution level
            string projectName = target.Name;
            FrameworkName targetFramework = target.GetSupportedFrameworks().FirstOrDefault();

            VsProject targetProject = target as VsProject;
            Project dteProject = targetProject == null ? null : targetProject.DteProject;

            string fullPath = Path.Combine(packageInstallPath, scriptRelativePath);
            if (!File.Exists(fullPath))
            {
                VsNuGetTraceSources.VsPowerShellScriptExecutionFeature.Error(
                    "missing_script",
                    "[{0}] Unable to locate expected script file: {1}",
                    projectName,
                    fullPath);
            }
            else
            {
                VsNuGetTraceSources.VsPowerShellScriptExecutionFeature.Info(
                    "executing",
                    "[{0}] Executing script file: {1}",
                    projectName,
                    fullPath);

                _scriptExecutor.ExecuteResolvedScript(
                    fullPath,
                    packageInstallPath,
                    packageObject,
                    dteProject,
                    targetFramework,
                    new ShimLogger(logger));
            }
        }
Beispiel #15
0
 public abstract Task UninstallPackage(PackageIdentity id, IExecutionLogger logger, CancellationToken cancelToken);
 public SvnRepositoryService(IExecutionLogger executionLogger)
     : this()
 {
     ExecutionLogger = executionLogger;
 }
Beispiel #17
0
 public abstract Task UninstallPackage(PackageIdentity id, IExecutionLogger logger, CancellationToken cancelToken);
 public void SetLogger(IExecutionLogger logger) => _logger = logger;
 public DiscreteLogarithmJob(IExecutionLogger logger, IDataService <DiscreteLogarithm> dataService)
 {
     _logger      = logger;
     _dataService = dataService;
     _hadWarnings = false;
 }
 public IntegerFactorizationController(IDataService <IntegerFactorization> integerFactorizationDataService, IExecutionLogger executionLogger) :
     base(integerFactorizationDataService, executionLogger, GetResourceRouteName)
 {
 }
 protected BaseController(IDataService <TEntity> resourceDataService, IExecutionLogger executionLogger, string getResourceRouteName)
 {
     ResourceDataService   = resourceDataService;
     ExecutionLogger       = executionLogger;
     _getResourceRouteName = getResourceRouteName;
 }
Beispiel #22
0
 public DiscreteLogarithmController(IDataService <DiscreteLogarithm> discreteLogarithmDataService, IExecutionLogger executionLogger) :
     base(discreteLogarithmDataService, executionLogger, GetResourceRouteName)
 {
 }
 public DiscreteLogarithmJobService(IDataService <ExecutionMessage> executionMessageDataService,
                                    IDataService <DiscreteLogarithm> discreteLogarithmDataService, IExecutionLogger logger) : base(executionMessageDataService, logger)
 {
     _discreteLogarithmDataService = discreteLogarithmDataService;
 }
 // The type of parameter package should be IPackage but we use object instead since we
 // don't want to expose IPackage.
 public abstract void ExecuteScript(string packageInstallPath, string scriptRelativePath, object package, InstallationTarget target, IExecutionLogger logger);
 public IntegerFactorizationJob(IExecutionLogger logger, IDataService<IntegerFactorization> dataService)
 {
     _logger = logger;
     _dataService = dataService;
     _hadWarnings = false;
 }
        public override void ExecuteScript(string packageInstallPath, string scriptRelativePath, object package, InstallationTarget target, IExecutionLogger logger)
        {
            IPackage packageObject = (IPackage)package;

            // If we don't have a project, we're at solution level
            string        projectName     = target.Name;
            FrameworkName targetFramework = target.GetSupportedFrameworks().FirstOrDefault();

            VsProject targetProject = target as VsProject;
            Project   dteProject    = targetProject == null ? null : targetProject.DteProject;

            string fullPath = Path.Combine(packageInstallPath, scriptRelativePath);

            if (!File.Exists(fullPath))
            {
                VsNuGetTraceSources.VsPowerShellScriptExecutionFeature.Error(
                    "missing_script",
                    "[{0}] Unable to locate expected script file: {1}",
                    projectName,
                    fullPath);
            }
            else
            {
                VsNuGetTraceSources.VsPowerShellScriptExecutionFeature.Info(
                    "executing",
                    "[{0}] Executing script file: {1}",
                    projectName,
                    fullPath);

                _scriptExecutor.ExecuteResolvedScript(
                    fullPath,
                    packageInstallPath,
                    packageObject,
                    dteProject,
                    targetFramework,
                    new ShimLogger(logger));
            }
        }
 public VerboseDiagnosticEnvelopeContext(ILogger logger, ISystemTime systemTime, IChainInvoker invoker, IOutgoingSender outgoing, IHandlerPipeline pipeline, Envelope envelope, IExecutionLogger executionLogger) : base(logger, systemTime, invoker, outgoing, pipeline, envelope, executionLogger)
 {
 }
Beispiel #28
0
 protected DriverService(IExecutionLogger logger)
 {
     Logger = logger;
 }
Beispiel #29
0
 protected JobService(IDataService <ExecutionMessage> executionMessageDataService, IExecutionLogger logger)
 {
     ExecutionMessageDataService = executionMessageDataService;
     Logger = logger;
 }
 public PeriodEstimationDriver(IExecutionLogger logger)
 {
     _logger = logger;
 }
 public PeriodEstimationDriverService(IExecutionLogger logger) : base(logger)
 {
 }
Beispiel #32
0
 public ShimLogger(IExecutionLogger logger)
 {
     _logger = logger;
 }
Beispiel #33
0
 public ShimLogger(IExecutionLogger logger)
 {
     _logger = logger;
 }
 public IntegerFactorizationJobService(IDataService <ExecutionMessage> executionMessageDataService,
                                       IDataService <IntegerFactorization> integerFactorizationDataService, IExecutionLogger logger) :
     base(executionMessageDataService, logger)
 {
     _integerFactorizationDataService = integerFactorizationDataService;
 }