Beispiel #1
0
        public void RunPublishSettings()
        {
            var publishSetting = SettingsIO.ReadSetting <PublishSetting>(Path.Combine(_rootPath, Constants.SettingFolderName, Constants.PublishSettingFileName));
            var executor       = new PublishSettingExecutor(publishSetting);

            executor.Execute(_rootPath);
        }
Beispiel #2
0
        public void RunInstallSettings()
        {
            var installSetting = SettingsIO.ReadSetting <InstallSetting>(Path.Combine(_rootPath, Constants.SettingFolderName, Constants.InstallSettingFileName));
            var executor       = new InstallSettingExecutor(installSetting);

            executor.Execute(_rootPath);
        }
Beispiel #3
0
        public void RunAlgBuildSettings()
        {
            var algBuildSetting = SettingsIO.ReadSetting <AlgBuildSetting>(Path.Combine(_rootPath, Constants.SettingFolderName, Constants.AlgBuildSettingFileName));
            var executor        = new AlgBuildSettingExecutor(algBuildSetting);

            executor.Execute(_rootPath);
        }
Beispiel #4
0
        public string RunCustomInstallSettings(string referralName)
        {
            var customInstallSetting = SettingsIO.ReadSetting <CustomInstallSetting>(Path.Combine(_rootPath, Constants.SettingFolderName, Constants.CustomInstallSettingFileName));
            var publishSetting       = SettingsIO.ReadSetting <PublishSetting>(Path.Combine(_rootPath, Constants.SettingFolderName, Constants.PublishSettingFileName));
            var installSetting       = SettingsIO.ReadSetting <InstallSetting>(Path.Combine(_rootPath, Constants.SettingFolderName, Constants.InstallSettingFileName));
            var executor             = new CustomInstallSettingExecutor(customInstallSetting, publishSetting, installSetting);

            return(executor.Execute(_rootPath, referralName));
        }
Beispiel #5
0
        public void WriteTestSettings()
        {
            var testAlgBuildSettings =
                new AlgBuildSetting
            {
                RegeditFrameworkPath = @"SOFTWARE\Microsoft\MSBuild\ToolsVersions\2.0",
                RegeditFrameworkKey  = "MSBuildToolsPath",

                AlgMsBuildSetting = new AlgMsBuildSetting
                {
                    SolutionPath      = @"Algoritm 2\Algoritm 2.sln",
                    BaseMsBuildParams = "/p:Configuration=Release /t:Rebuild /clp:ErrorsOnly",
                    FinalExePath      = @"Algoritm 2\Slot\bin\Release",
                },


                BuildSettingItems = new List <AlgBuildSettingItem>
                {
                    new AlgBuildSettingItem
                    {
                        VersionType      = VersionType.Free,
                        Lang             = Lang.Ru,
                        AddMsBuilsParams = "/p:DefineConstants=\"Ver=Free;Lang=Ru\""
                    }
                }
            };

            var testPathSettings = new PathSetting()
            {
                PathSettings =
                    new List <PathSettingItem>
                {
                    new PathSettingItem
                    {
                        Name        = "CompilExe",
                        VersionType = VersionType.All,
                        Lang        = Lang.Ru,
                        SourcePath  = "sf",
                        TargetPath  = "",
                        Directories = new List <string> {
                            "a", "b"
                        },
                        Files = new List <string> {
                            "dfa", "bdf"
                        },
                    }
                }
            };

            var testInstallSettings = new InstallSetting()
            {
                InnoSetupCompilerPath = @"C:\Program Files (x86)\Inno Setup 5"
            };

            var testPublishSettings = new PublishSetting
            {
                PublishFtpSetting = new PublishFtpSetting
                {
                    FtpUrl      = "ftp://algoritm2.ru/www/algoritm2.ru",
                    FtpUsername = "******",
                    FtpPassword = "******",
                },

                PublishSettings =
                    new List <PublishSettingItem>
                {
                    new PublishSettingItem
                    {
                        VersionType = VersionType.Free,
                        Lang        = Lang.Ru,
                        TargetPath  = "download",
                        TargetName  = "Algoritm2RuLastTest.exe"
                    },
                }
            };


            var testSettingPath = Path.Combine(_rootPath, Constants.SettingFolderName, "Test{0}");

            SettingsIO.WriteSetting(string.Format(testSettingPath, Constants.AlgBuildSettingFileName), testAlgBuildSettings);
            SettingsIO.WriteSetting(string.Format(testSettingPath, Constants.PathSettingFileName), testPathSettings);
            SettingsIO.WriteSetting(string.Format(testSettingPath, Constants.InstallSettingFileName), testInstallSettings);
            SettingsIO.WriteSetting(string.Format(testSettingPath, Constants.PublishSettingFileName), testPublishSettings);
        }
Beispiel #6
0
 public Executor()
 {
     _rootPath = SettingsIO.FindSettingsRoot(Environment.CurrentDirectory, Constants.SettingFolderName);
 }