9
9
class DefaultDeployServiceExtension: DeployServiceExtension
11
public override DeployFileCollection GetDeployFiles (DeployContext ctx, CombineEntry entry)
11
public override DeployFileCollection GetDeployFiles (DeployContext ctx, SolutionItem entry, string configuration)
13
13
if (entry is IDeployable)
14
return new DeployFileCollection (((IDeployable)entry).GetDeployFiles ());
14
return new DeployFileCollection (((IDeployable)entry).GetDeployFiles (configuration));
16
return base.GetDeployFiles (ctx, entry);
16
return base.GetDeployFiles (ctx, entry, configuration);
19
public override DeployFileCollection GetProjectDeployFiles (DeployContext ctx, Project project)
19
public override DeployFileCollection GetProjectDeployFiles (DeployContext ctx, Project project, string solutionConfiguration)
21
21
DeployFileCollection deployFiles = new DeployFileCollection ();
22
base.GetProjectDeployFiles (ctx, project, solutionConfiguration);
23
23
// Add the compiled output file
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));
29
29
// Collect deployable files
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
34
if (file.CopyToOutputDirectory != FileCopyMode.None)
37
DeployProperties props = new DeployProperties (file);
38
if (props.ShouldDeploy) {
33
39
DeployFile dp = new DeployFile (file);
34
40
deployFiles.Add (dp);
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);
43
// Collect referenced assemblies
45
foreach (string refFile in project.GetReferenceDeployFiles (false)) {
46
deployFiles.Add (new DeployFile (project, refFile, Path.GetFileName (refFile), TargetDirectory.ProgramFiles));
49
foreach (FileCopySet.Item item in project.GetSupportFileList (solutionConfiguration)) {
50
deployFiles.Add (new DeployFile (project, item.Src, item.Target, TargetDirectory.ProgramFiles));
53
DotNetProject netProject = project as DotNetProject;
54
if (netProject != null) {
55
DotNetProjectConfiguration conf = (DotNetProjectConfiguration) project.GetActiveConfiguration (solutionConfiguration);
57
string mdbFile = conf.CompiledOutputName + ".mdb";
58
deployFiles.Add (new DeployFile (project, mdbFile, Path.GetFileName (mdbFile), TargetDirectory.ProgramFiles));
49
62
return deployFiles;