예제 #1
0
        //taken from monodevelop.aspnet.mvc
        protected override void PopulateSupportFileList(MonoDevelop.Projects.FileCopySet list, ConfigurationSelector solutionConfiguration)
        {
            base.PopulateSupportFileList(list, solutionConfiguration);

            //HACK: workaround for MD not local-copying package references
            foreach (var projectReference in References)
            {
                if (projectReference.Package != null && projectReference.Package.Name == "monomac")
                {
                    if (projectReference.ReferenceType == ReferenceType.Gac)
                    {
                        foreach (var assem in projectReference.Package.Assemblies)
                        {
                            list.Add(assem.Location);
                            var cfg = (MonoMacProjectConfiguration)solutionConfiguration.GetConfiguration(this);
                            if (cfg.DebugMode)
                            {
                                var mdbFile = TargetRuntime.GetAssemblyDebugInfoFile(assem.Location);
                                if (File.Exists(mdbFile))
                                {
                                    list.Add(mdbFile);
                                }
                            }
                        }
                    }
                    break;
                }
            }
        }
 protected override void PopulateSupportFileList(FileCopySet list, ConfigurationSelector configuration)
 {
     base.PopulateSupportFileList(list, configuration);
     foreach (var projectReference in References)
     {
         if (projectReference != null && projectReference.Package.Name == "monogame")
         {
             if (projectReference.ReferenceType == ReferenceType.Gac)
             {
                 foreach (var assem in projectReference.Package.Assemblies)
                 {
                     list.Add(assem.Location);
                     var cfg = (MonoGameProjectConfiguration)configuration.GetConfiguration(this);
                     if (cfg.DebugMode)
                     {
                         var mdbFile = TargetRuntime.GetAssemblyDebugInfoFile(assem.Location);
                         if (System.IO.File.Equals(mdbFile))
                         {
                             list.Add(mdbFile);
                         }
                     }
                 }
             }
             break;
         }
     }
 }
예제 #3
0
        protected override bool CheckNeedsBuild(ConfigurationSelector configuration)
        {
            if (base.CheckNeedsBuild(configuration))
            {
                return(true);
            }

            DotNetProjectConfiguration configObj = (DotNetProjectConfiguration)GetConfiguration(configuration);

            if (GeneratesDebugInfoFile && configObj != null && configObj.DebugMode)
            {
                string file = GetOutputFileName(configuration);
                if (file != null)
                {
                    file = TargetRuntime.GetAssemblyDebugInfoFile(file);
                    FileInfo finfo = new FileInfo(file);
                    if (!finfo.Exists)
                    {
                        return(true);
                    }
                    else if (finfo.LastWriteTime < GetLastBuildTime(configuration))
                    {
                        return(true);
                    }
                }
            }

            foreach (ProjectFile file in Files)
            {
                if (file.BuildAction == BuildAction.EmbeddedResource && String.Compare(Path.GetExtension(file.FilePath), ".resx", true) == 0 && MD1DotNetProjectHandler.IsResgenRequired(file.FilePath))
                {
                    return(true);
                }
            }

            return(false);
        }
예제 #4
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);
                    }
                }
            }
        }