CreateConfiguration() публичный Метод

public CreateConfiguration ( string name ) : MonoDevelop.Projects.SolutionItemConfiguration
name string
Результат MonoDevelop.Projects.SolutionItemConfiguration
Пример #1
0
        public void CustomCommands()
        {
            DotNetProject p = Services.ProjectService.CreateDotNetProject("C#");

            p.Name = "SomeProject";
            DotNetProjectConfiguration c = (DotNetProjectConfiguration)p.CreateConfiguration("First");

            CustomCommand cmd = new CustomCommand();

            cmd.Command = "aa bb cc";
            Assert.AreEqual("aa", cmd.GetCommandFile(p, c.Selector));
            Assert.AreEqual("bb cc", cmd.GetCommandArgs(p, c.Selector));

            cmd.Command = "\"aa bb\" cc dd";
            Assert.AreEqual("aa bb", cmd.GetCommandFile(p, c.Selector));
            Assert.AreEqual("cc dd", cmd.GetCommandArgs(p, c.Selector));

            cmd.Command = "\"aa ${ProjectName}\" cc ${ProjectName}";
            Assert.AreEqual("aa SomeProject", cmd.GetCommandFile(p, c.Selector));
            Assert.AreEqual("cc SomeProject", cmd.GetCommandArgs(p, c.Selector));

            cmd.WorkingDir = NormalizePath("/some/${ProjectName}/place");
            Assert.AreEqual(Path.GetFullPath(NormalizePath("/some/SomeProject/place")), (string)cmd.GetCommandWorkingDir(p, c.Selector));
            p.Dispose();
        }
Пример #2
0
        protected SolutionItemConfiguration CreateConfigurationBlock(MonoDevelop.Projects.DotNetProject project, Config ConfigBlock, string AssemblyName, string OuputType, IProgressMonitor monitor)
        {
            DotNetProjectConfiguration confObj = project.CreateConfiguration(ConfigBlock.Name) as DotNetProjectConfiguration;

            confObj.RunWithWarnings = false;
            confObj.DebugMode       = ConfigBlock.DebugSymbols;
            project.CompileTarget   = (CompileTarget)Enum.Parse(typeof(CompileTarget), OuputType, true);

            string dir = MapPath(project.BaseDirectory, ConfigBlock.OutputPath);

            if (dir == null)
            {
                dir = Path.Combine("bin", ConfigBlock.Name);
                monitor.ReportWarning(string.Format(GettextCatalog.GetString("Output directory '{0}' can't be mapped to a local directory. The directory '{1}' will be used instead"), ConfigBlock.OutputPath, dir));
            }
            confObj.OutputDirectory = dir;
            confObj.OutputAssembly  = AssemblyName;

            CSharpCompilerParameters compilerParams = new CSharpCompilerParameters();

            compilerParams.WarningLevel           = ConfigBlock.WarningLevel;
            compilerParams.NoWarnings             = "";
            compilerParams.Optimize               = ConfigBlock.Optimize;
            compilerParams.DefineSymbols          = ConfigBlock.DefineConstants;
            compilerParams.UnsafeCode             = ConfigBlock.AllowUnsafeBlocks;
            compilerParams.GenerateOverflowChecks = ConfigBlock.CheckForOverflowUnderflow;

            return(confObj);
        }
Пример #3
0
        public void NewConfigurationsHaveAnAssemblyName()
        {
            DotNetProject p = Services.ProjectService.CreateDotNetProject("C#");

            p.Name = "HiThere";
            DotNetProjectConfiguration c = (DotNetProjectConfiguration)p.CreateConfiguration("First");

            Assert.AreEqual("HiThere", c.OutputAssembly);
        }