public void BasicCommandLine()
        {
            CommandLineGenerator generator = CreateGenerator();
            string commandLine             = generator.GenerateCommandLine();

            Assert.Equal("/P /SSubstituteThis!_postfix SubstituteThis!AsWell /AtEndSubstitute\\ /I42_postfix /Xone /Xtwo /Xthree a.cs b.cs /Z7", commandLine);
        }
示例#2
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);
        }
        public void TemplateParametersAreCaseInsensitive()
        {
            CommandLineGenerator generator = CreateGenerator();

            generator.CommandLineTemplate = "[sources]";
            string commandLine = generator.GenerateCommandLine();

            Assert.Equal("a.cs b.cs", commandLine);
        }
        public void TemplatedCommandLine()
        {
            CommandLineGenerator generator = CreateGenerator();

            generator.CommandLineTemplate = "[Sources] [Program]";
            string commandLine = generator.GenerateCommandLine();

            Assert.Equal("a.cs b.cs /P", commandLine);
        }
示例#5
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);
        }