Example #1
0
 public SpecExecution(SpecExecutionRequest request, StopConditions stopConditions, IExecutionLogger logger)
 {
     Request = request;
     StopConditions = stopConditions;
     Logger = logger;
     Mode = request.Mode;
 }
Example #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;
 }
Example #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;
 }
Example #6
0
        public abstract Task InstallPackage(
            PackageIdentity id,

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

            IExecutionLogger logger,
            CancellationToken cancelToken);
Example #7
0
        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;
        }
Example #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));
        }
Example #11
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);
        }
Example #12
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;
 }
Example #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));
            }
        }
Example #15
0
 public abstract Task UninstallPackage(PackageIdentity id, IExecutionLogger logger, CancellationToken cancelToken);
 public SvnRepositoryService(IExecutionLogger executionLogger)
     : this()
 {
     ExecutionLogger = executionLogger;
 }
Example #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;
 }
Example #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)
 {
 }
Example #28
0
 protected DriverService(IExecutionLogger logger)
 {
     Logger = logger;
 }
Example #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)
 {
 }
Example #32
0
 public ShimLogger(IExecutionLogger logger)
 {
     _logger = logger;
 }
Example #33
0
 public ShimLogger(IExecutionLogger logger)
 {
     _logger = logger;
 }
 public IntegerFactorizationJobService(IDataService <ExecutionMessage> executionMessageDataService,
                                       IDataService <IntegerFactorization> integerFactorizationDataService, IExecutionLogger logger) :
     base(executionMessageDataService, logger)
 {
     _integerFactorizationDataService = integerFactorizationDataService;
 }