GetCommandArgs() public méthode

public GetCommandArgs ( WorkspaceObject entry, MonoDevelop.Projects.ConfigurationSelector configuration ) : string
entry WorkspaceObject
configuration MonoDevelop.Projects.ConfigurationSelector
Résultat string
        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();
        }
Exemple #2
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));
		}