Example #1
0
        /// <summary>
        /// Generates the command line for the tool.
        /// </summary>
        private string GenerateCommands()
        {
            PostProcessSwitchList();

            CommandLineGenerator generator = new CommandLineGenerator(_activeToolSwitches, SwitchOrderList);

            generator.CommandLineTemplate = this.CommandLineTemplate;
            generator.AdditionalOptions   = _additionalOptions;

            CommandLine = generator.GenerateCommandLine();
            return(CommandLine);
        }
        private CommandLineGenerator CreateGenerator()
        {
            Rule rule = XamlReader.Parse(testXamlFile) as Rule;

            Dictionary<string, Object> switchValues = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
            switchValues["Program"] = true;
            switchValues["Debug"] = false;
            switchValues["Subst"] = "SubstituteThis!";
            switchValues["Subst2"] = "SubstituteThis!AsWell";
            switchValues["Subst3"] = "Substitute\\";
            switchValues["SubstInt"] = (int)42;
            switchValues["Strings"] = new string[] { "one", "two", "three" };
            ITaskItem[] sources = new ITaskItem[]
            {
                new TaskItem("a.cs"),
                new TaskItem("b.cs")
            };

            switchValues["Sources"] = sources;
            switchValues["DebugInformationFormat"] = "OldStyle";
            switchValues["EmptyTest"] = "Empty";

            CommandLineGenerator generator = new CommandLineGenerator(rule, switchValues);
            return generator;
        }
        /// <summary>
        /// Generates the command line for the tool.
        /// </summary>
        private string GenerateCommands()
        {
            PostProcessSwitchList();

            CommandLineGenerator generator = new CommandLineGenerator(_activeToolSwitches, SwitchOrderList);
            generator.CommandLineTemplate = this.CommandLineTemplate;
            generator.AdditionalOptions = _additionalOptions;

            CommandLine = generator.GenerateCommandLine();
            return CommandLine;
        }
Example #4
0
        public string GenCmdLine(string xaml)
        {
            object rootObject = XamlServices.Load(new StreamReader(xaml));
            XamlTypes.ProjectSchemaDefinitions schemas = rootObject as XamlTypes.ProjectSchemaDefinitions;
            if (schemas != null)
            {
                foreach (XamlTypes.IProjectSchemaNode node in schemas.Nodes)
                {
                    XamlTypes.Rule rule = node as XamlTypes.Rule;
                    if (rule != null)
                    {
                        var parameterValues = parseParameters(rule);
                        CommandLineGenerator generator = new CommandLineGenerator(rule, parameterValues);
                        generator.CommandLineTemplate = this.CommandLineTemplate;
                        generator.AdditionalOptions = AdditionalOptions;

                        return generator.GenerateCommandLine();
                    }
                }
            }
            return null;
        }
Example #5
0
        public override bool Execute()
        {
            if (!String.IsNullOrEmpty(TrackerLogDirectory))
                TrackFileAccess = true;

            object rootObject = XamlServices.Load(new StreamReader(Xaml));
            XamlTypes.ProjectSchemaDefinitions schemas = rootObject as XamlTypes.ProjectSchemaDefinitions;
            if (schemas != null)
            {
                foreach (XamlTypes.IProjectSchemaNode node in schemas.Nodes)
                {
                    XamlTypes.Rule rule = node as XamlTypes.Rule;
                    if (rule != null)
                    {
                        parseParameters(rule);
                        CommandLineGenerator generator = new CommandLineGenerator(rule, parameterValues);
                        generator.CommandLineTemplate = this.CommandLineTemplate;
                        generator.AdditionalOptions = AdditionalOptions;

                        CommandLine = generator.GenerateCommandLine();
                        return base.Execute();
                    }
                }
            }
            return false;
        }