public static void Protocol() { _colorify.Clear(); try { Section.Header("SONAR CONFIGURATION", "PROTOCOL"); Section.SelectedProject(); Section.CurrentConfiguration(_config.personal.menu.sonarValidation, _config.personal.menu.sonarConfiguration); if (!String.IsNullOrEmpty(_config.personal.menu.sonarConfiguration)) { _colorify.Write($"{" Current Configuration:",-25}", txtMuted); _colorify.WriteLine($"{_config.personal.menu.sonarConfiguration}"); } string opt = Selector.Start(Selector.Protocol, "2"); Number.IsOnRange(1, Convert.ToInt32(opt), 2); _config.personal.sonar.protocol = Selector.Name(Selector.Protocol, opt); Menu.Status(); Select(); } catch (Exception Ex) { Exceptions.General(Ex); } }
public static void InternalPath() { _colorify.Clear(); try { Section.Header("SONAR CONFIGURATION", "INTERNAL PATH"); Section.SelectedProject(); Section.CurrentConfiguration(_config.personal.menu.sonarValidation, _config.personal.menu.sonarConfiguration); _colorify.BlankLines(); _colorify.WriteLine($" Write an internal path inside your project.", txtPrimary); _colorify.WriteLine($" Don't use / (slash character) at start or end.", txtPrimary); _colorify.BlankLines(); _colorify.WriteLine($"{"[EMPTY] Remove",82}", txtWarning); Section.HorizontalRule(); _colorify.Write($"{" Make your choice: ",-25}", txtInfo); string opt = Console.ReadLine().Trim(); _config.personal.sonar.internalPath = $"{opt}"; Menu.Status(); Select(); } catch (Exception Ex) { Exceptions.General(Ex); } }
public static void Domain() { _colorify.Clear(); try { Section.Header("SONAR CONFIGURATION", "SERVER", "DOMAIN"); Section.SelectedProject(); Section.CurrentConfiguration(_config.personal.menu.sonarValidation, _config.personal.menu.sonarConfiguration); _colorify.BlankLines(); _colorify.WriteLine($" Write server domain.", txtPrimary); _colorify.BlankLines(); _colorify.WriteLine($"{"[EMPTY] Cancel",82}", txtDanger); Section.HorizontalRule(); _colorify.Write($"{" Make your choice: ",-25}", txtInfo); string opt = Console.ReadLine().Trim(); if (!String.IsNullOrEmpty(opt)) { _config.personal.sonar.domain = opt; } Menu.Status(); Server(); } catch (Exception Ex) { Exceptions.General(Ex); } }
public static void Make() { _colorify.Clear(); try { Section.Header("TASK", "MAKE"); Section.SelectedProject(); Section.CurrentConfiguration(_config.personal.menu.serverValidation, _config.personal.menu.serverConfiguration); string dirPath = _path.Combine(_config.path.development, _config.path.workspace, _config.path.project, _config.personal.selected.project); _colorify.BlankLines(); _colorify.WriteLine($" --> Making...", txtInfo); CmdMake(dirPath); Section.HorizontalRule(); Section.Pause(); Menu.Start(); } catch (Exception Ex) { Exceptions.General(Ex); } }
public static void Revert() { _colorify.Clear(); try { Section.Header("TASK", "REVERT"); Section.SelectedProject(); Section.CurrentConfiguration(_config.personal.menu.serverValidation, _config.personal.menu.serverConfiguration); string dirPath = _path.Combine(_config.path.development, _config.path.workspace, _config.path.project, _config.personal.selected.project, _config.project.androidPath, _config.project.androidHybridPath); string dirSource = _path.Combine(Variables.Value("task_project"), "service/www"); _colorify.BlankLines(); _colorify.WriteLine($" --> Reverting...", txtInfo); _colorify.Write($"{" From:",-8}", txtMuted); _colorify.WriteLine($"{dirSource}"); _colorify.Write($"{" To:",-8}", txtMuted); _colorify.WriteLine($"{dirPath}"); _disk.CopyAll(dirSource, dirPath, true); Section.HorizontalRule(); Section.Pause(); Menu.Start(); } catch (Exception Ex) { Exceptions.General(Ex); } }
public static void Select() { _colorify.Clear(); try { Section.Header("BUILD CONFIGURATION"); Section.SelectedProject(); Section.CurrentConfiguration( _config.personal.menu.buildValidation, _config.personal.menu.buildConfiguration); _colorify.BlankLines(); string buildType = Selector.Name(Selector.Type, _config.personal.build.type); _colorify.Write($"{" [T] Type:",-25}", txtPrimary); _colorify.WriteLine($"{buildType}"); _colorify.Write($"{" [D] Dimension:",-25}", txtPrimary); _colorify.WriteLine($"{_config.personal.build.dimension}"); string buildFlavor = Selector.Name(Selector.Flavor, _config.personal.build.flavor); _colorify.Write($"{" [F] Flavor:",-25}", txtPrimary); _colorify.WriteLine($"{buildFlavor}"); string buildMode = Selector.Name(Selector.Mode, _config.personal.build.mode); _colorify.Write($"{" [M] Mode:",-25}", txtPrimary); _colorify.WriteLine($"{buildMode}"); _colorify.WriteLine($"{"[EMPTY] Exit",82}", txtDanger); Section.HorizontalRule(); _colorify.Write($"{" Make your choice:",-25}", txtInfo); string opt = Console.ReadLine()?.ToLower(); if (String.IsNullOrEmpty(opt)) { Menu.Start(); } else { Menu.Route($"b>{opt}", "b"); } Message.Error(); } catch (Exception Ex) { Exceptions.General(Ex); } }
public static void Compress() { _colorify.Clear(); try { Section.Header("PROJECT", "COMPRESS FILE"); Section.SelectedProject(); Section.CurrentConfiguration(_config.personal.menu.serverValidation, _config.personal.menu.serverConfiguration); string dirPath = _path.Combine( _config.path.development, _config.path.workspace, _config.path.project, _config.personal.selected.project, _config.project.androidPath, _config.project.androidBuildPath, _config.personal.selected.path ); string fileName = _path.GetFileNameWithoutExtension( _path.Combine( dirPath, _config.personal.selected.file ) ); _colorify.BlankLines(); _colorify.WriteLine($" --> Compressing...", txtInfo); CmdCompress(dirPath, fileName); Section.HorizontalRule(); Section.Pause(); Menu.Start(); } catch (Exception Ex) { Exceptions.General(Ex); } }
public static void ServerNumber() { _colorify.Clear(); try { Section.Header("TASK", "SERVER", "NUMBER"); Section.SelectedProject(); Section.CurrentConfiguration(_config.personal.menu.serverValidation, _config.personal.menu.serverConfiguration); _config.personal.webServer.number = Selector.Start(Selector.Number, "1"); Menu.Status(); Select(); } catch (Exception Ex) { Exceptions.General(Ex); } }
public static void Open() { _colorify.Clear(); try { Section.Header("TASK", "SERVER", "OPEN"); Section.SelectedProject(); Section.CurrentConfiguration(_config.personal.menu.serverValidation, _config.personal.menu.serverConfiguration); string opt = Selector.Start(Selector.Logical, "y"); _config.personal.webServer.open = (opt == "y"); Menu.Status(); Select(); } catch (Exception Ex) { Exceptions.General(Ex); } }
public static void Port() { _colorify.Clear(); try { Section.Header("SONAR CONFIGURATION", "SERVER", "PORT"); Section.SelectedProject(); Section.CurrentConfiguration(_config.personal.menu.sonarValidation, _config.personal.menu.sonarConfiguration); _colorify.BlankLines(); _colorify.WriteLine($" Write server port.", txtPrimary); _colorify.Write($" Between 0 and 65536.", txtPrimary); _colorify.Write($" 9000 (Default)", txtInfo); _colorify.BlankLines(); _colorify.WriteLine($"{"[EMPTY] Default",82}", txtInfo); Section.HorizontalRule(); _colorify.Write($"{" Make your choice: ",-25}", txtInfo); string opt = Console.ReadLine().Trim(); if (!String.IsNullOrEmpty(opt)) { Number.IsOnRange(0, Convert.ToInt32(opt), 65536); _config.personal.sonar.port = opt; } else { _config.personal.sonar.port = "9000"; } Menu.Status(); Server(); } catch (Exception Ex) { Exceptions.General(Ex); } }
public static void Properties() { _colorify.Clear(); try { Section.Header("BUILD CONFIGURATION", "PROPERTIES"); Section.SelectedProject(); Section.CurrentConfiguration( _config.personal.menu.buildValidation, _config.personal.menu.buildConfiguration); string sourcePath = propertiesSource(); string destinationPath = _path.Combine( _config.path.development, _config.path.workspace, _config.path.project, _config.personal.selected.project, _config.project.androidPath); _colorify.BlankLines(); List <string> filter = _disk.FilterCreator(true, ".properties"); _colorify.WriteLine($" --> Copying...", txtInfo); _colorify.BlankLines(); _colorify.Write($"{" From:",-8}", txtMuted); _colorify.WriteLine($"{sourcePath}"); _colorify.Write($"{" To:",-8}", txtMuted); _colorify.WriteLine($"{destinationPath}"); _disk.CopyAll(sourcePath, destinationPath, true, filter); Section.HorizontalRule(); Section.Pause(); Menu.Start(); } catch (Exception Ex) { Exceptions.General(Ex); } }
public static void Mode() { _colorify.Clear(); try { Section.Header("BUILD CONFIGURATION", "MODE"); Section.SelectedProject(); Section.CurrentConfiguration( _config.personal.menu.buildValidation, _config.personal.menu.buildConfiguration); _config.personal.build.mode = Selector.Start(Selector.Mode, "d"); Menu.Status(); Select(); } catch (Exception Ex) { Exceptions.General(Ex); } }
public static void Dimension() { _colorify.Clear(); try { Section.Header("BUILD CONFIGURATION", "DIMENSION"); Section.SelectedProject(); Section.CurrentConfiguration( _config.personal.menu.buildValidation, _config.personal.menu.buildConfiguration); _colorify.BlankLines(); _colorify.WriteLine($" Write a project dimension:", txtPrimary); _colorify.BlankLines(); _colorify.WriteLine($"{"[EMPTY] Remove",82}", txtWarning); Section.HorizontalRule(); _colorify.Write($"{" Make your choice: ",-25}", txtInfo); string opt = Console.ReadLine().Trim(); if (!String.IsNullOrEmpty(opt)) { _config.personal.build.dimension = $"{opt}"; } else { _config.personal.build.dimension = $""; } Menu.Status(); Select(); } catch (Exception Ex) { Exceptions.General(Ex); } }
public static void Select() { _colorify.Clear(); try { Section.Header("SONAR CONFIGURATION"); Section.SelectedProject(); Section.CurrentConfiguration(_config.personal.menu.sonarValidation, _config.personal.menu.sonarConfiguration); _colorify.BlankLines(); _colorify.Write($"{" [P] Protocol:",-25}", txtPrimary); _colorify.WriteLine($"{_config.personal.sonar.protocol}"); _colorify.Write($"{" [S] Server:",-25}", txtPrimary); _colorify.WriteLine($"{_config.personal.sonar.domain}{(!String.IsNullOrEmpty(_config.personal.sonar.port) ? ":" + _config.personal.sonar.port : "")}"); _colorify.Write($"{" [I] Internal Path:",-25}", txtPrimary); _colorify.WriteLine($"{_config.personal.sonar.internalPath}"); _colorify.WriteLine($"{"[EMPTY] Exit",82}", txtDanger); Section.HorizontalRule(); _colorify.Write($"{" Make your choice:",-25}", txtInfo); string opt = Console.ReadLine()?.ToLower(); if (String.IsNullOrEmpty(opt)) { Menu.Start(); } else { Menu.Route($"s>{opt}", "s"); } Message.Error(); } catch (Exception Ex) { Exceptions.General(Ex); } }
public static void Obfuscate() { _colorify.Clear(); try { Section.Header("TASK", "OBFUSCATE"); Section.SelectedProject(); Section.CurrentConfiguration(_config.personal.menu.serverValidation, _config.personal.menu.serverConfiguration); string dirPath = _path.Combine(_config.path.development, _config.path.workspace, _config.path.project, _config.personal.selected.project, _config.project.androidPath, _config.project.androidHybridPath); string[] dirs = new string[] { _path.Combine(Variables.Value("task_project"), "service/www"), _path.Combine(Variables.Value("task_project"), "service/bld"), }; _colorify.BlankLines(); _colorify.WriteLine($" --> Cleaning...", txtInfo); foreach (var dir in dirs) { _disk.DeleteAll(dir, true); Directory.CreateDirectory(dir); } _colorify.BlankLines(); List <string> filter = _disk.FilterCreator(true, _config.project.filterFiles); _colorify.WriteLine($" --> Copying...", txtInfo); _colorify.Write($"{" From:",-8}", txtMuted); _colorify.WriteLine($"{dirPath}"); _colorify.Write($"{" To:",-8}", txtMuted); _colorify.WriteLine($"{dirs[0]}"); _disk.CopyAll(dirPath, dirs[0], true, filter); _colorify.Write($"{" To:",-8}", txtMuted); _colorify.WriteLine($"{dirs[1]}"); _disk.CopyAll(dirPath, dirs[1], true, filter); _colorify.BlankLines(); _colorify.WriteLine($" --> Obfuscate...", txtInfo); string type = "lite"; if (_config.personal.menu.selectedVariant == "c") { type = "complete"; } Response result = CmdObfuscate(type); if (result.code == 0) { _colorify.BlankLines(); _colorify.WriteLine($" --> Replacing...", txtInfo); _colorify.Write($"{" From:",-8}", txtMuted); _colorify.WriteLine($"{dirs[1]}"); _colorify.Write($"{" To:",-8}", txtMuted); _colorify.WriteLine($"{dirPath}"); _disk.CopyAll(dirs[1], dirPath, true); } Section.HorizontalRule(); Section.Pause(); Menu.Start(); } catch (Exception Ex) { Exceptions.General(Ex); } }
public static void ConfigurationFile() { _colorify.Clear(); try { Section.Header("TASK", "SERVER", "FILE"); Section.SelectedProject(); Section.CurrentConfiguration(_config.personal.menu.serverValidation, _config.personal.menu.serverConfiguration); _colorify.BlankLines(); string dirPath = _path.Combine(Variables.Value("task_project"), _config.task.webFolder); dirPath.Exists("Please review your configuration file."); List <string> files = dirPath.Files($"*{_config.task.extension}"); if (files.Count < 1) { _config.personal.webServer.file = ""; } else { var i = 1; foreach (var file in files) { string f = file; _colorify.WriteLine($" {i,2}] {Transform.RemoveWords(_path.GetFileName(f), _config.task.extension)}", txtPrimary); i++; } if (!String.IsNullOrEmpty(_config.personal.webServer.file)) { _colorify.BlankLines(); _colorify.WriteLine($"{"[EMPTY] Current",82}", txtInfo); } Section.HorizontalRule(); _colorify.Write($"{" Make your choice: ",-25}", txtInfo); string opt = Console.ReadLine().Trim(); if (!String.IsNullOrEmpty(opt)) { Number.IsOnRange(1, Convert.ToInt32(opt), files.Count); var sel = files[Convert.ToInt32(opt) - 1]; _config.personal.webServer.file = Transform.RemoveWords(_path.GetFileName(sel), _config.task.extension); } else { if (String.IsNullOrEmpty(_config.personal.webServer.file)) { Message.Error(); } } } Menu.Status(); Select(); } catch (Exception Ex) { Exceptions.General(Ex); } }