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

« back to all changes in this revision

Viewing changes to src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment/DefaultDeployServiceExtension.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2009-02-18 08:40:51 UTC
  • mfrom: (1.2.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090218084051-gh8m6ukvokbwj7cf
Tags: 1.9.2+dfsg-1ubuntu1
* Merge from Debian Experimental (LP: #330519), remaining Ubuntu changes:
  + debian/control:
    - Update for Gnome# 2.24
    - Add libmono-cairo1.0-cil to build-deps to fool pkg-config check

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
{
9
9
        class DefaultDeployServiceExtension: DeployServiceExtension
10
10
        {
11
 
                public override DeployFileCollection GetDeployFiles (DeployContext ctx, CombineEntry entry)
 
11
                public override DeployFileCollection GetDeployFiles (DeployContext ctx, SolutionItem entry, string configuration)
12
12
                {
13
13
                        if (entry is IDeployable)
14
 
                                return new DeployFileCollection (((IDeployable)entry).GetDeployFiles ());
 
14
                                return new DeployFileCollection (((IDeployable)entry).GetDeployFiles (configuration));
15
15
                        
16
 
                        return base.GetDeployFiles (ctx, entry);
 
16
                        return base.GetDeployFiles (ctx, entry, configuration);
17
17
                }
18
18
                
19
 
                public override DeployFileCollection GetProjectDeployFiles (DeployContext ctx, Project project)
 
19
                public override DeployFileCollection GetProjectDeployFiles (DeployContext ctx, Project project, string solutionConfiguration)
20
20
                {
21
21
                        DeployFileCollection deployFiles = new DeployFileCollection ();
22
 
                        
 
22
                        base.GetProjectDeployFiles (ctx, project, solutionConfiguration);
23
23
                        // Add the compiled output file
24
24
                        
25
 
                        string outputFile = project.GetOutputFileName ();
 
25
                        string outputFile = project.GetOutputFileName (solutionConfiguration);
26
26
                        if (!string.IsNullOrEmpty (outputFile))
27
27
                                deployFiles.Add (new DeployFile (project, outputFile, Path.GetFileName (outputFile), TargetDirectory.ProgramFiles));
28
28
                        
29
29
                        // Collect deployable files
30
 
                        
31
 
                        foreach (ProjectFile file in project.ProjectFiles) {
32
 
                                if (file.BuildAction == BuildAction.FileCopy) {
 
30
                        foreach (ProjectFile file in project.Files) {
 
31
                                // skip CopyToOutputDirectory files when it's just a project build, because 
 
32
                                // MonoDevelop.Project.Projects already copies these files using more subtle overwriting
 
33
                                // semantics
 
34
                                if (file.CopyToOutputDirectory != FileCopyMode.None)
 
35
                                        continue;
 
36
                                    
 
37
                                DeployProperties props = new DeployProperties (file);
 
38
                                if (props.ShouldDeploy) {
33
39
                                        DeployFile dp = new DeployFile (file);
34
40
                                        deployFiles.Add (dp);
35
41
                                        
36
 
                                        if (Path.GetFileName (dp.SourcePath) == "app.config" && Path.GetFileName (dp.RelativeTargetPath) == "app.config") {
 
42
                                        if (string.Compare (Path.GetFileName (dp.SourcePath), "app.config", true)==0 && string.Compare (Path.GetFileName (dp.RelativeTargetPath), "app.config", true)==0) {
37
43
                                                string newName = Path.GetFileName (outputFile) + ".config";
38
44
                                                dp.RelativeTargetPath = Path.Combine (Path.GetDirectoryName (dp.RelativeTargetPath), newName);
39
45
                                        }
40
46
                                }
41
47
                        }
42
 
 
43
 
                        // Collect referenced assemblies
44
 
                        
45
 
                        foreach (string refFile in project.GetReferenceDeployFiles (false)) {
46
 
                                deployFiles.Add (new DeployFile (project, refFile, Path.GetFileName (refFile), TargetDirectory.ProgramFiles));
 
48
                        
 
49
                        foreach (FileCopySet.Item item in project.GetSupportFileList (solutionConfiguration)) {
 
50
                                 deployFiles.Add (new DeployFile (project, item.Src, item.Target, TargetDirectory.ProgramFiles));
 
51
                        }
 
52
                        
 
53
                        DotNetProject netProject = project as DotNetProject;
 
54
                        if (netProject != null) {
 
55
                                DotNetProjectConfiguration conf = (DotNetProjectConfiguration) project.GetActiveConfiguration (solutionConfiguration);
 
56
                                if (conf.DebugMode) {
 
57
                                        string mdbFile = conf.CompiledOutputName + ".mdb";
 
58
                                        deployFiles.Add (new DeployFile (project, mdbFile, Path.GetFileName (mdbFile), TargetDirectory.ProgramFiles));
 
59
                                }
47
60
                        }
48
61
                        
49
62
                        return deployFiles;