示例#1
0
 private static void ProcessInput(ToolContext context)
 {
     if (context.Arguments.Target == OutputTarget.Manifest)
     {
         LoadInputAssembly(context);
         LoadActors(context);
     }
 }
示例#2
0
        private static void ProcessArguments(ToolContext context)
        {
            if (string.IsNullOrEmpty(context.Arguments.OutputPath))
            {
                context.Arguments.OutputPath = Directory.GetCurrentDirectory();
            }

            // validate the arguments
        }
示例#3
0
 private static void GenerateOutput(ToolContext context)
 {
     if (context.Arguments.Target == OutputTarget.Manifest)
     {
         GenerateManifest(context);
         AddParametersToLocalFiveNodeAppParamFile(context);
         AddParametersToLocalOneNodeAppParamFile(context);
         return;
     }
 }
示例#4
0
        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);
        }
示例#5
0
        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);
        }
示例#6
0
        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);
        }
示例#7
0
        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));
            }
        }
示例#8
0
 private static void LoadInputAssembly(ToolContext context)
 {
     context.InputAssembly = Assembly.LoadFrom(context.Arguments.InputAssembly);
 }