GetOutputFileName() public method

public GetOutputFileName ( MonoDevelop.Projects.ConfigurationSelector configuration ) : FilePath
configuration MonoDevelop.Projects.ConfigurationSelector
return FilePath
Example #1
0
        void CheckSolutionBuildClean(Solution sol, string configuration)
        {
            SolutionConfigurationSelector config = (SolutionConfigurationSelector)configuration;
            string        tag  = "CheckSolutionBuildClean config=" + configuration;
            DotNetProject lib1 = (DotNetProject)sol.FindProjectByName("Lib1");
            DotNetProject lib2 = (DotNetProject)sol.FindProjectByName("Lib2");
            DotNetProject lib3 = (DotNetProject)sol.FindProjectByName("Lib3");
            DotNetProject lib4 = (DotNetProject)sol.FindProjectByName("Lib4");

            Assert.IsFalse(File.Exists(lib1.GetOutputFileName(config)), tag);
            Assert.IsFalse(File.Exists(lib2.GetOutputFileName(config)), tag);
            Assert.IsFalse(File.Exists(lib3.GetOutputFileName(config)), tag);
            Assert.IsFalse(File.Exists(lib4.GetOutputFileName(config)), tag);

            BuildResult res = sol.Build(Util.GetMonitor(), config);

            Assert.AreEqual(0, res.WarningCount, tag);
            Assert.AreEqual(0, res.ErrorCount, tag);

            Assert.IsTrue(File.Exists(lib1.GetOutputFileName(config)), tag);
            Assert.IsTrue(File.Exists(lib2.GetOutputFileName(config)), tag);
            Assert.IsTrue(File.Exists(lib3.GetOutputFileName(config)), tag);
            Assert.IsTrue(File.Exists(lib4.GetOutputFileName(config)), tag);

            sol.Clean(Util.GetMonitor(), config);

            Assert.IsFalse(File.Exists(lib1.GetOutputFileName(config)), tag);
            Assert.IsFalse(File.Exists(lib2.GetOutputFileName(config)), tag);
            Assert.IsFalse(File.Exists(lib3.GetOutputFileName(config)), tag);
            Assert.IsFalse(File.Exists(lib4.GetOutputFileName(config)), tag);
        }
Example #2
0
        async Task CheckProjectReferencesBuildClean(Solution sol, string configuration)
        {
            SolutionConfigurationSelector config = (SolutionConfigurationSelector)configuration;
            string        tag  = "CheckProjectReferencesBuildClean config=" + configuration;
            DotNetProject lib1 = (DotNetProject)sol.FindProjectByName("Lib1");
            DotNetProject lib2 = (DotNetProject)sol.FindProjectByName("Lib2");
            DotNetProject lib3 = (DotNetProject)sol.FindProjectByName("Lib3");
            DotNetProject lib4 = (DotNetProject)sol.FindProjectByName("Lib4");

            Assert.IsFalse(File.Exists(lib1.GetOutputFileName(config)), tag);
            Assert.IsFalse(File.Exists(lib2.GetOutputFileName(config)), tag);
            Assert.IsFalse(File.Exists(lib3.GetOutputFileName(config)), tag);
            Assert.IsFalse(File.Exists(lib4.GetOutputFileName(config)), tag);

            BuildResult res = await lib1.Build(Util.GetMonitor(), config, true);

            Assert.AreEqual(0, res.WarningCount, tag);
            Assert.AreEqual(0, res.ErrorCount, tag + " " + res.CompilerOutput);

            Assert.IsTrue(File.Exists(lib1.GetOutputFileName(config)), tag);
            Assert.IsTrue(File.Exists(lib2.GetOutputFileName(config)), tag);
            Assert.IsTrue(File.Exists(lib3.GetOutputFileName(config)), tag);
            Assert.IsTrue(File.Exists(lib4.GetOutputFileName(config)), tag);

            await sol.Clean(Util.GetMonitor(), config);
        }
		void CheckProjectBuildClean (DotNetProject lib, string configuration)
		{
			SolutionConfigurationSelector config = (SolutionConfigurationSelector) configuration;
			string tag = "CheckProjectBuildClean lib=" + lib.Name + " config=" + configuration;
			
			Assert.IsFalse (File.Exists (lib.GetOutputFileName (config)), tag);
			
			BuildResult res = lib.Build (Util.GetMonitor (), config, false);
			Assert.AreEqual (0, res.WarningCount, tag);
			Assert.AreEqual (0, res.ErrorCount, tag);
			
			Assert.IsTrue (File.Exists (lib.GetOutputFileName (config)), tag);
			
			lib.Clean (Util.GetMonitor (), config);
			Assert.IsFalse (File.Exists (lib.GetOutputFileName (config)), tag);
		}
Example #4
0
		string GetConfigFolderName (DotNetProject lib, string conf)
		{
			return Path.GetFileName (Path.GetDirectoryName (lib.GetOutputFileName ((SolutionConfigurationSelector)conf)));
		}
Example #5
0
		void CheckProjectBuildClean (DotNetProject lib, string configuration)
		{
			SolutionConfigurationSelector config = (SolutionConfigurationSelector) configuration;
			string tag = "CheckProjectBuildClean lib=" + lib.Name + " config=" + configuration;
			
			Assert.IsFalse (File.Exists (lib.GetOutputFileName (config)), tag);
			
			BuildResult res = lib.Build (Util.GetMonitor (), config, false);
			Assert.AreEqual (0, res.WarningCount, tag);
			Assert.AreEqual (0, res.ErrorCount, tag);
			
			Assert.IsTrue (File.Exists (lib.GetOutputFileName (config)), tag);
			
			lib.Clean (Util.GetMonitor (), config);
			Assert.IsFalse (File.Exists (lib.GetOutputFileName (config)), tag);
		}
Example #6
0
 string GetConfigFolderName(DotNetProject lib, string conf)
 {
     return(Path.GetFileName(Path.GetDirectoryName(lib.GetOutputFileName((SolutionConfigurationSelector)conf))));
 }
		static void CheckProjectOutput (DotNetProject project, bool autoUpdate)
		{
			if (project == null)
				throw new ArgumentNullException ("project");
			if (IsOutputTrackedProject (project)) {
				var fileName = project.GetOutputFileName (IdeApp.Workspace.ActiveConfiguration);
				if (!File.Exists (fileName))
					return;
				FileService.NotifyFileChanged (fileName);
				if (autoUpdate) {
					// update documents
					foreach (var openDocument in IdeApp.Workbench.Documents) {
						openDocument.ReparseDocument ();
					}
				}
			}
		}
Example #8
0
		/// <summary>
		/// Determines which analyzers to run, which rule sets to use (TODO)
		/// and invokes the runners.
		/// </summary>
		static IEnumerable<IViolation> RunAnalyzers (DotNetProject project, double work)
		{
			string dll = project.GetOutputFileName (ConfigurationSelector.Default);
			if (!File.Exists (dll))
				yield break;
			
			LoadAnalyzersIfNeccessary ();
			
			if (analyzers.Count == 0)
				yield break;
			
			double analyzerWork = work / analyzers.Count;			
			
			foreach (IAnalyzer analyzer in analyzers) {
				IEnumerable<IRule> ruleSet = GetRuleSet (project, analyzer.GetRuleLoader ());
				IRunner runner = analyzer.GetRunner ();
				
				IEnumerable<IViolation> violations = runner.Run (dll, ruleSet);
				foreach (IViolation vio in violations)
						yield return vio;
				
				ResultsReporter.WorkComplete += analyzerWork;
			}
		}
        static void Swizzle(DotNetProject project, ConfigurationSelector configSelector)
        {
            var appdir = Path.ChangeExtension (
                project.GetOutputFileName (configSelector),
                "app");
            var appAssemblyDirs = GetAppBundleAssemblyDirectories (appdir).ToArray ();

            var mscorlib = project
                .AssemblyContext
                .GetAssemblies (project.TargetFramework)
                .FirstOrDefault (asm => asm.Name == "mscorlib");

            var targetFrameworkPath = Path.Combine (
                Path.GetDirectoryName (mscorlib.Location),
                "repl");

            foreach (var asm in Directory.EnumerateFiles (targetFrameworkPath, "*.dll"))
            {
                foreach (var appAssemblyDir in appAssemblyDirs)
                {
                    File.Copy (asm, Path.Combine (appAssemblyDir, Path.GetFileName (asm)), true);
                    var mdb = asm + ".mdb";
                    if (File.Exists (mdb))
                        File.Copy (mdb, Path.Combine (appAssemblyDir, Path.GetFileName (mdb)), true);
                }
            }
        }
Example #10
0
        void PopulateSupportFileList(FileCopySet list, ConfigurationSelector configuration, int referenceDistance)
        {
            if (referenceDistance < 2)
            {
                base.PopulateSupportFileList(list, configuration);
            }

            //rename the app.config file
            FileCopySet.Item appConfig = list.Remove("app.config");
            if (appConfig == null)
            {
                appConfig = list.Remove("App.config");
            }
            if (appConfig != null)
            {
                string output = Path.GetFileName(GetOutputFileName(configuration));
                list.Add(appConfig.Src, appConfig.CopyOnlyIfNewer, output + ".config");
            }

            //collect all the "local copy" references and their attendant files
            foreach (ProjectReference projectReference in References)
            {
                if (!projectReference.LocalCopy || ParentSolution == null)
                {
                    continue;
                }

                if (projectReference.ReferenceType == ReferenceType.Project)
                {
                    DotNetProject p = ParentSolution.FindProjectByName(projectReference.Reference) as DotNetProject;

                    if (p == null)
                    {
                        LoggingService.LogWarning("Project '{0}' referenced from '{1}' could not be found", projectReference.Reference, this.Name);
                        continue;
                    }

                    string refOutput = p.GetOutputFileName(configuration);
                    if (string.IsNullOrEmpty(refOutput))
                    {
                        LoggingService.LogWarning("Project '{0}' referenced from '{1}' has an empty output filename", p.Name, this.Name);
                        continue;
                    }

                    list.Add(refOutput);

                    //VS COMPAT: recursively copy references's "local copy" files
                    //but only copy the "copy to output" files from the immediate references
                    p.PopulateSupportFileList(list, configuration, referenceDistance + 1);

                    DotNetProjectConfiguration refConfig = p.GetConfiguration(configuration) as DotNetProjectConfiguration;

                    if (refConfig != null && refConfig.DebugMode)
                    {
                        string mdbFile = TargetRuntime.GetAssemblyDebugInfoFile(refOutput);
                        if (File.Exists(mdbFile))
                        {
                            list.Add(mdbFile);
                        }
                    }
                }
                else if (projectReference.ReferenceType == ReferenceType.Assembly)
                {
                    // VS COMPAT: Copy the assembly, but also all other assemblies referenced by it
                    // that are located in the same folder
                    foreach (string file in GetAssemblyRefsRec(projectReference.Reference, new HashSet <string> ()))
                    {
                        list.Add(file);
                        if (File.Exists(file + ".config"))
                        {
                            list.Add(file + ".config");
                        }
                        string mdbFile = TargetRuntime.GetAssemblyDebugInfoFile(file);
                        if (File.Exists(mdbFile))
                        {
                            list.Add(mdbFile);
                        }
                    }
                }
                else if (projectReference.ReferenceType == ReferenceType.Custom)
                {
                    foreach (string refFile in projectReference.GetReferencedFileNames(configuration))
                    {
                        list.Add(refFile);
                    }
                }
            }
        }