Ejemplo n.º 1
0
        internal IEnumerable<ICommand> PrepareCommands(DNXSettings dnxSettings, StepSettings stepSettings, EnvironmentSettings envSettings, int result)
        {
            this.stepSettings = stepSettings;
            productInfo = new ProjectsInfo(envSettings.ProductConfig, dnxSettings.Framework);
            envSettings.SetBranchVersion(productInfo.ReleaseVersion);

            factory = new CommandFactory(envSettings, productInfo);
            List<ICommand> commands = new List<ICommand>();

            if (stepSettings.EnvironmentInitialization)
                commands.Add(factory.InstallEnvironment(dnxSettings));

            if (stepSettings.Build || stepSettings.RunTests)
                commands.Add(new ActionCommand("init dnx and dnu paths", new Action(envSettings.FindPathToDNX)));

            if (stepSettings.CopyDirs)
                commands.Add(factory.CopyProjects(stepSettings.CopyPath, true));

            if (stepSettings.RemoveProjectsDirectories)
                commands.Add(factory.RemoveProjects());

            if (stepSettings.GetProjectsFromDXVCS)
                commands.Add(factory.GetProjectsFromVCS());

            if (stepSettings.Build) 
                commands.Add(factory.BuildProjects());

            if (stepSettings.RunTests)
                commands.Add(factory.RunTests());

            if (stepSettings.CollectArtifats)
                commands.Add(factory.CollectArtifacts(envSettings, envSettings.BuildArtifactsFolder, dnxSettings.Framework));

            return commands;
        }
 public CommandFactory(EnvironmentSettings settings, ProjectsInfo productInfo)
 {
     this.envSettings = settings;
     this.productInfo = productInfo;
 }