~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
ImportĀ upstreamĀ versionĀ 2.5.92+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
                TargetFramework defaultTargetFramework;
62
62
                
63
63
                string defaultPlatformTarget = "x86";
64
 
                public const string DefaultTargetFrameworkId = "3.5";
 
64
                public static readonly TargetFrameworkMoniker DefaultTargetFrameworkId = TargetFrameworkMoniker.NET_3_5;
65
65
                
66
66
                public const string BuildTarget = "Build";
67
67
                public const string CleanTarget = "Clean";
365
365
                        targetPath = Path.GetFullPath (targetPath);
366
366
                        
367
367
                        if (sourcePath != targetPath) {
368
 
                                if (!CopyFiles (monitor, obj, obj.GetItemFiles (true), targetPath))
 
368
                                if (!CopyFiles (monitor, obj, obj.GetItemFiles (true), targetPath, true))
369
369
                                        return null;
370
370
                                
371
371
                                string newFile = Path.Combine (targetPath, Path.GetFileName (rootSourceFile));
381
381
                                                obj.ConvertToFormat (format, true);
382
382
                                        obj.Save (monitor);
383
383
                                        List<FilePath> newFiles = obj.GetItemFiles (true);
 
384
                                        
 
385
                                        foreach (FilePath f in newFiles) {
 
386
                                                if (!f.IsChildPathOf (targetPath)) {
 
387
                                                        if (obj is Solution)
 
388
                                                                monitor.ReportError ("The solution '" + obj.Name + "' is referencing the file '" + f.FileName + "' which is located outside the root solution directory.", null);
 
389
                                                        else
 
390
                                                                monitor.ReportError ("The project '" + obj.Name + "' is referencing the file '" + f.FileName + "' which is located outside the project directory.", null);
 
391
                                                }
 
392
                                                oldFiles.Remove (f);
 
393
                                        }
384
394
        
385
395
                                        // Remove old files
386
396
                                        foreach (FilePath file in oldFiles) {
387
 
                                                if (newFiles.Contains (file))
388
 
                                                        continue;
389
 
                                                
390
397
                                                if (File.Exists (file)) {
391
398
                                                        File.Delete (file);
392
399
                                                
432
439
                        }
433
440
                }
434
441
 
435
 
                bool CopyFiles (IProgressMonitor monitor, IWorkspaceFileObject obj, List<FilePath> files, FilePath targetBasePath)
 
442
                bool CopyFiles (IProgressMonitor monitor, IWorkspaceFileObject obj, IEnumerable<FilePath> files, FilePath targetBasePath, bool ignoreExternalFiles)
436
443
                {
437
444
                        FilePath baseDir = obj.BaseDirectory.FullPath;
438
445
                        foreach (FilePath file in files) {
445
452
                                
446
453
                                // Can't export files from outside the root solution directory
447
454
                                if (!fname.IsChildPathOf (baseDir)) {
 
455
                                        if (ignoreExternalFiles)
 
456
                                                continue;
448
457
                                        if (obj is Solution)
449
458
                                                monitor.ReportError ("The solution '" + obj.Name + "' is referencing the file '" + Path.GetFileName (file) + "' which is located outside the root solution directory.", null);
450
459
                                        else
710
719
                                SolutionEntityItem entry = (SolutionEntityItem) item;
711
720
                                SolutionItemConfiguration conf = entry.GetConfiguration (configuration) as SolutionItemConfiguration;
712
721
                                if (conf != null && conf.CustomCommands.HasCommands (CustomCommandType.Execute))
713
 
                                        return conf.CustomCommands.CanExecute (CustomCommandType.Execute, context, configuration);
 
722
                                        return conf.CustomCommands.CanExecute (entry, CustomCommandType.Execute, context, configuration);
714
723
                                return entry.OnGetCanExecute (context, configuration);
715
724
                        }
716
725
                        else if (item is WorkspaceItem) {
768
777
                {
769
778
                        return callback (monitor, item, buildData);
770
779
                }
 
780
                
 
781
                public override void PopulateSupportFileList (Project project, FileCopySet list, ConfigurationSelector configuration)
 
782
                {
 
783
                        project.PopulateSupportFileList (list, configuration);
 
784
                }
 
785
                
 
786
                public override void PopulateOutputFileList (Project project, List<FilePath> list, ConfigurationSelector configuration)
 
787
                {
 
788
                        project.PopulateOutputFileList (list, configuration);
 
789
                }
771
790
        }       
772
791
        
773
792
        internal static class Counters
794
813
                public static TimerCounter DatabasesWritten = InstrumentationService.CreateTimerCounter ("Parser database written", "Parser Service");
795
814
                public static TimerCounter FileParse = InstrumentationService.CreateTimerCounter ("File parsed", "Parser Service");
796
815
                public static TimerCounter AssemblyParseTime = InstrumentationService.CreateTimerCounter ("Assembly parsed", "Parser Service");
 
816
                
 
817
                public static TimerCounter HelpServiceInitialization = InstrumentationService.CreateTimerCounter ("Help Service initialization", "IDE");
 
818
                public static TimerCounter ParserServiceInitialization = InstrumentationService.CreateTimerCounter ("Parser Service initialization", "IDE");
797
819
        }
798
820
}