private static void ProcessInput(ToolContext context) { if (context.Arguments.Target == OutputTarget.Manifest) { LoadInputAssembly(context); LoadActors(context); } }
private static void ProcessArguments(ToolContext context) { if (string.IsNullOrEmpty(context.Arguments.OutputPath)) { context.Arguments.OutputPath = Directory.GetCurrentDirectory(); } // validate the arguments }
private static void GenerateOutput(ToolContext context) { if (context.Arguments.Target == OutputTarget.Manifest) { GenerateManifest(context); AddParametersToLocalFiveNodeAppParamFile(context); AddParametersToLocalOneNodeAppParamFile(context); return; } }
private static void AddParametersToLocalOneNodeAppParamFile(ToolContext context) { if (string.IsNullOrEmpty(context.Arguments.Local1NodeAppParamFile)) { return; } var updaterArgs = new AppParameterFileUpdater.Arguments() { ActorTypes = context.ActorTypes, AppParamFilePath = context.Arguments.Local1NodeAppParamFile }; AppParameterFileUpdater.AddParameterValuesToLocalOneNodeParamFile(updaterArgs); }
private static void GenerateManifest(ToolContext context) { var generatorArgs = new ManifestGenerator.Arguments() { ApplicationPrefix = context.Arguments.ApplicationPrefix, ServicePackageNamePrefix = context.Arguments.ServicePackagePrefix, InputAssembly = context.InputAssembly, ActorTypes = context.ActorTypes, OutputPath = context.Arguments.OutputPath, ApplicationPackagePath = context.Arguments.ApplicationPackagePath, ServicePackagePath = context.Arguments.ServicePackagePath, Version = context.Arguments.Version }; ManifestGenerator.Generate(generatorArgs); }
public static void Run(ToolArguments arguments) { // create tool context var context = new ToolContext { Arguments = arguments }; // process the arguments ProcessArguments(context); // process the input ProcessInput(context); // generate the output GenerateOutput(context); }
private static void LoadActors(ToolContext context) { var inputAssembly = context.InputAssembly; var actorTypes = context.ActorTypes; IList <string> actorFilters = null; if ((context.Arguments.Actors != null) && (context.Arguments.Actors.Length > 0)) { actorFilters = new List <string>(context.Arguments.Actors); } LoadActors(inputAssembly, actorFilters, actorTypes); // check if all specified actor types were loaded or not if ((actorFilters != null) && (actorFilters.Count > 0)) { throw new TypeLoadException( string.Format(CultureInfo.CurrentCulture, SR.ErrorNotAnActor, actorFilters[0], typeof(Actor).FullName)); } }
private static void LoadInputAssembly(ToolContext context) { context.InputAssembly = Assembly.LoadFrom(context.Arguments.InputAssembly); }