private static string BuildPlatformToString(SpatialBuildPlatforms value) { if (value == SpatialBuildPlatforms.Current) { return($"Current ({WorkerBuilder.GetCurrentBuildPlatform()})"); } return(value.ToString()); }
public Worker Construct(WorkerBuilder workerBuilder) { workerBuilder.CreateWorker(); workerBuilder.TeachWorker(); workerBuilder.TrainWorker(); workerBuilder.CertifyWorker(); return(workerBuilder.GetWorker()); }
private void ConfigureBuildPlatforms(BuildEnvironmentConfig environmentConfiguration) { using (IndentLevelScope(1)) { var buildPlatformsString = EnumFlagToString(environmentConfiguration.BuildPlatforms, BuildPlatformToString); EditorGUI.BeginChangeCheck(); var showBuildPlatforms = EditorGUILayout.Foldout(environmentConfiguration.ShowBuildPlatforms, "Build Platforms: " + buildPlatformsString); SpatialBuildPlatforms newBuildPlatforms = environmentConfiguration.BuildPlatforms; if (showBuildPlatforms) { newBuildPlatforms = EnumFlagsToggleField(environmentConfiguration.BuildPlatforms, BuildPlatformToString); } var currentAdjustedPlatforms = newBuildPlatforms; if ((currentAdjustedPlatforms & SpatialBuildPlatforms.Current) != 0) { currentAdjustedPlatforms &= ~SpatialBuildPlatforms.Current; currentAdjustedPlatforms |= WorkerBuilder.GetCurrentBuildPlatform(); } if ((currentAdjustedPlatforms & SpatialBuildPlatforms.Windows32) != 0 && (currentAdjustedPlatforms & SpatialBuildPlatforms.Windows64) != 0) { EditorGUILayout.HelpBox( "\n" + WorkerBuilder.IncompatibleWindowsPlatformsErrorMessage + "\n", MessageType.Error); } if (EditorGUI.EndChangeCheck()) { // build platforms have changed EditorUtility.SetDirty(target); Undo.RecordObject(target, "Configure build platforms for worker"); environmentConfiguration.ShowBuildPlatforms = showBuildPlatforms; environmentConfiguration.BuildPlatforms = newBuildPlatforms; } } }
private void ConfigureBuildPlatforms(BuildEnvironmentConfig environmentConfiguration) { using (IndentLevelScope(1)) { EditorGUI.BeginChangeCheck(); var buildPlatformsString = SelectedPlatformsToString(environmentConfiguration.BuildPlatforms); var newBuildPlatforms = environmentConfiguration.BuildPlatforms; var showBuildPlatforms = EditorGUILayout.Foldout(environmentConfiguration.ShowBuildPlatforms, "Build Platforms: " + buildPlatformsString); if (showBuildPlatforms) { newBuildPlatforms = EnumFlagsToggleField(environmentConfiguration.BuildPlatforms); } var currentAdjustedPlatforms = newBuildPlatforms; if ((currentAdjustedPlatforms & SpatialBuildPlatforms.Current) != 0) { currentAdjustedPlatforms |= WorkerBuilder.GetCurrentBuildPlatform(); } if ((currentAdjustedPlatforms & SpatialBuildPlatforms.Windows32) != 0 && (currentAdjustedPlatforms & SpatialBuildPlatforms.Windows64) != 0) { EditorGUILayout.HelpBox(WorkerBuilder.IncompatibleWindowsPlatformsErrorMessage, MessageType.Error); } var buildTargetsMissingBuildSupport = BuildSupportChecker.GetBuildTargetsMissingBuildSupport(WorkerBuilder.GetUnityBuildTargets(newBuildPlatforms)); if (buildTargetsMissingBuildSupport.Length > 0) { EditorGUILayout.HelpBox($"Missing build support for {string.Join(", ", buildTargetsMissingBuildSupport)}", MessageType.Error); } if (EditorGUI.EndChangeCheck()) { EditorUtility.SetDirty(target); Undo.RecordObject(target, "Configure build platforms for worker"); environmentConfiguration.ShowBuildPlatforms = showBuildPlatforms; environmentConfiguration.BuildPlatforms = newBuildPlatforms; } } }
public static string[] FilterWorkerTypes(BuildEnvironment environment, string[] desiredWorkerTypes) { return(desiredWorkerTypes.Where(wantedWorkerType => { var buildTargetsForWorker = WorkerBuilder.GetBuildTargetsForWorkerForEnvironment(wantedWorkerType, environment); var buildTargetsMissingBuildSupport = GetBuildTargetsMissingBuildSupport(buildTargetsForWorker); if (buildTargetsMissingBuildSupport.Length > 0) { Debug.LogError(ConstructMissingSupportMessage(wantedWorkerType, environment, buildTargetsMissingBuildSupport)); return false; } return true; }).ToArray()); }
private static void Execute(Operation Operation, string InputFileName, string OutputFileName) { using var inputFile = File.OpenRead(InputFileName); using var outputFile = File.Create(OutputFileName); var workerBuilder = Operation switch { Operation.Compress => WorkerBuilder.Compressor(_blockSize), Operation.Decompress => WorkerBuilder.Decompressor(), _ => throw new Exception("Неподдерживаемая операция") }; var worker = workerBuilder.Parallel() .BuildFor(inputFile, outputFile); worker.Run(); } }
public void Configure(WorkerBuilder builder) { var configurator = new ConsumerWorkerConnector <TConsumer>(ReferenceFactory, _consumerFactory); builder.Add(configurator); }
private static void MenuCleanAll() { WorkerBuilder.Clean(); Debug.Log("Clean completed"); }
private static void MenuBuildCloud(string[] filteredWorkerTypes) { WorkerBuilder.MenuBuild(BuildEnvironment.Cloud, filteredWorkerTypes); }
private static void MenuBuildLocal(string[] filteredWorkerTypes) { WorkerBuilder.MenuBuild(BuildEnvironment.Local, filteredWorkerTypes); }
public void Configure(WorkerBuilder builder) { var configurator = new HandlerWorkerConnector <TMessage>(_handler, ReferenceFactory); builder.Add(configurator); }
private static void MenuBuild(BuildContextSettings buildContextSettings) { WorkerBuilder.MenuBuild(buildContextSettings); }
public void Configure(WorkerBuilder builder) { var configurator = new SagaWorkerConnector <TSaga>(ReferenceFactory, _sagaRepository); builder.Add(configurator); }