示例#1
0
        public override DeployFileCollection GetProjectDeployFiles(DeployContext ctx, Project project, ConfigurationSelector configuration)
        {
            DeployFileCollection deployFiles = new DeployFileCollection();

            base.GetProjectDeployFiles(ctx, project, configuration);
            // Add the compiled output file

            string outputFile = project.GetOutputFileName(configuration);

            if (!string.IsNullOrEmpty(outputFile))
            {
                deployFiles.Add(new DeployFile(project, outputFile, Path.GetFileName(outputFile), TargetDirectory.ProgramFiles));
            }

            // Collect deployable files
            foreach (ProjectFile file in project.Files)
            {
                // skip CopyToOutputDirectory files when it's just a project build, because
                // MonoDevelop.Project.Projects already copies these files using more subtle overwriting
                // semantics
                if (file.CopyToOutputDirectory != FileCopyMode.None)
                {
                    continue;
                }

                DeployProperties props = new DeployProperties(file);
                if (props.ShouldDeploy)
                {
                    DeployFile dp = new DeployFile(file);
                    deployFiles.Add(dp);

                    if (string.Compare(Path.GetFileName(dp.SourcePath), "app.config", true) == 0 && string.Compare(Path.GetFileName(dp.RelativeTargetPath), "app.config", true) == 0)
                    {
                        string newName = Path.GetFileName(outputFile) + ".config";
                        dp.RelativeTargetPath = Path.Combine(Path.GetDirectoryName(dp.RelativeTargetPath), newName);
                    }
                }
            }

            foreach (FileCopySet.Item item in project.GetSupportFileList(configuration))
            {
                deployFiles.Add(new DeployFile(project, item.Src, item.Target, TargetDirectory.ProgramFiles));
            }

            DotNetProject netProject = project as DotNetProject;

            if (netProject != null)
            {
                DotNetProjectConfiguration conf = (DotNetProjectConfiguration)project.GetConfiguration(configuration);
                if (conf.DebugMode)
                {
                    string mdbFile = netProject.TargetRuntime.GetAssemblyDebugInfoFile(conf.CompiledOutputName);
                    deployFiles.Add(new DeployFile(project, mdbFile, Path.GetFileName(mdbFile), TargetDirectory.ProgramFiles));
                }
            }

            return(deployFiles);
        }
示例#2
0
		public static DeployProperties GetDeployProperties (ProjectFile file)
		{
			DeployProperties props = (DeployProperties) file.ExtendedProperties [typeof(DeployProperties)];
			if (props != null)
				return props;
			props = new DeployProperties (file);
			file.ExtendedProperties [typeof(DeployProperties)] = props;
			return props;
		}
示例#3
0
        public static DeployProperties GetDeployProperties(ProjectFile file)
        {
            DeployProperties props = (DeployProperties)file.ExtendedProperties [typeof(DeployProperties)];

            if (props != null)
            {
                return(props);
            }
            props = new DeployProperties(file);
            file.ExtendedProperties [typeof(DeployProperties)] = props;
            return(props);
        }
示例#4
0
        public DeployFile(ProjectFile pfile)
        {
            DeployProperties props = DeployService.GetDeployProperties(pfile);

            this.targetDirectoryID  = props.TargetDirectory;
            this.sourcePath         = pfile.FilePath;
            this.relativeTargetPath = props.RelativeDeployPath;
            this.attributes         = props.FileAttributes;
            if (props.HasPathReferences)
            {
                isTemplate = true;
            }
            sourceSolutionItem = pfile.Project;
        }
		public override DeployFileCollection GetProjectDeployFiles (DeployContext ctx, Project project, ConfigurationSelector configuration)
		{
			DeployFileCollection deployFiles = new DeployFileCollection ();
			base.GetProjectDeployFiles (ctx, project, configuration);
			// Add the compiled output file
			
			string outputFile = project.GetOutputFileName (configuration);
			if (!string.IsNullOrEmpty (outputFile))
				deployFiles.Add (new DeployFile (project, outputFile, Path.GetFileName (outputFile), TargetDirectory.ProgramFiles));
			
			// Collect deployable files
			foreach (ProjectFile file in project.Files) {
				// skip CopyToOutputDirectory files when it's just a project build, because 
				// MonoDevelop.Project.Projects already copies these files using more subtle overwriting
				// semantics
				if (file.CopyToOutputDirectory != FileCopyMode.None)
					continue;
				    
				DeployProperties props = new DeployProperties (file);
				if (props.ShouldDeploy) {
					DeployFile dp = new DeployFile (file);
					deployFiles.Add (dp);
					
					if (string.Compare (Path.GetFileName (dp.SourcePath), "app.config", true)==0 && string.Compare (Path.GetFileName (dp.RelativeTargetPath), "app.config", true)==0) {
						string newName = Path.GetFileName (outputFile) + ".config";
						dp.RelativeTargetPath = Path.Combine (Path.GetDirectoryName (dp.RelativeTargetPath), newName);
					}
				}
			}
			
			foreach (FileCopySet.Item item in project.GetSupportFileList (configuration)) {
				 deployFiles.Add (new DeployFile (project, item.Src, item.Target, TargetDirectory.ProgramFiles));
			}
			
			DotNetProject netProject = project as DotNetProject;
			if (netProject != null) {
				DotNetProjectConfiguration conf = (DotNetProjectConfiguration) project.GetConfiguration (configuration);
				if (conf.DebugMode) {
					string mdbFile = netProject.TargetRuntime.GetAssemblyDebugInfoFile (conf.CompiledOutputName);
					deployFiles.Add (new DeployFile (project, mdbFile, Path.GetFileName (mdbFile), TargetDirectory.ProgramFiles));
				}
			}
			
			return deployFiles;
		}
        public override DeployFileCollection GetProjectDeployFiles(DeployContext ctx, Project project, ConfigurationSelector configuration)
        {
            DeployFileCollection deployFiles = new DeployFileCollection();

            base.GetProjectDeployFiles(ctx, project, configuration);

            // Add the compiled output files

            ProjectConfiguration pconf  = (ProjectConfiguration)project.GetConfiguration(configuration);
            FilePath             outDir = pconf.OutputDirectory;

            foreach (FilePath file in project.GetOutputFiles(configuration))
            {
                deployFiles.Add(new DeployFile(project, file, file.ToRelative(outDir), TargetDirectory.ProgramFiles));
            }

//			FilePath outputFile = project.GetOutputFileName (configuration);

            // Collect deployable files
            foreach (ProjectFile file in project.Files)
            {
                // skip CopyToOutputDirectory files when it's just a project build, because
                // MonoDevelop.Project.Projects already copies these files using more subtle overwriting
                // semantics
                if (file.CopyToOutputDirectory != FileCopyMode.None)
                {
                    continue;
                }

                DeployProperties props = new DeployProperties(file);
                if (props.ShouldDeploy)
                {
                    DeployFile dp = new DeployFile(file);
                    deployFiles.Add(dp);
                }
            }

            foreach (FileCopySet.Item item in project.GetSupportFileList(configuration))
            {
                deployFiles.Add(new DeployFile(project, item.Src, item.Target, TargetDirectory.ProgramFiles));
            }

            return(deployFiles);
        }
		public override DeployFileCollection GetProjectDeployFiles (DeployContext ctx, Project project, ConfigurationSelector configuration)
		{
			DeployFileCollection deployFiles = new DeployFileCollection ();
			base.GetProjectDeployFiles (ctx, project, configuration);
			
			// Add the compiled output files
			
			ProjectConfiguration pconf = (ProjectConfiguration) project.GetConfiguration (configuration);
			FilePath outDir = pconf.OutputDirectory;
			foreach (FilePath file in project.GetOutputFiles (configuration)) {
				deployFiles.Add (new DeployFile (project, file, file.ToRelative (outDir), TargetDirectory.ProgramFiles));
			}
			
			FilePath outputFile = project.GetOutputFileName (configuration);
			
			// Collect deployable files
			foreach (ProjectFile file in project.Files) {
				// skip CopyToOutputDirectory files when it's just a project build, because 
				// MonoDevelop.Project.Projects already copies these files using more subtle overwriting
				// semantics
				if (file.CopyToOutputDirectory != FileCopyMode.None)
					continue;
				    
				DeployProperties props = new DeployProperties (file);
				if (props.ShouldDeploy) {
					DeployFile dp = new DeployFile (file);
					deployFiles.Add (dp);
					
					if (string.Compare (Path.GetFileName (dp.SourcePath), "app.config", true)==0 && string.Compare (Path.GetFileName (dp.RelativeTargetPath), "app.config", true)==0) {
						string newName = Path.GetFileName (outputFile) + ".config";
						dp.RelativeTargetPath = Path.Combine (Path.GetDirectoryName (dp.RelativeTargetPath), newName);
					}
				}
			}
			
			foreach (FileCopySet.Item item in project.GetSupportFileList (configuration)) {
				 deployFiles.Add (new DeployFile (project, item.Src, item.Target, TargetDirectory.ProgramFiles));
			}
			
			return deployFiles;
		}
        public override DeployFileCollection GetProjectDeployFiles(DeployContext ctx, Project project, ConfigurationSelector configuration)
        {
            var deployFiles = new DeployFileCollection();

            base.GetProjectDeployFiles(ctx, project, configuration);

            // Add the compiled output files

            var pconf   = (ProjectConfiguration)project.GetConfiguration(configuration);
            var evalCtx = new TargetEvaluationContext();

            evalCtx.ItemsToEvaluate.Add("AllPublishItemsFullPathWithTargetPath");

            if (project.MSBuildProject.UseMSBuildEngine)
            {
                var result = project.RunTarget(new ProgressMonitor(), "GetCopyToPublishDirectoryItems", configuration, evalCtx).Result;
                foreach (var item in result.Items)
                {
                    if (item.Name == "AllPublishItemsFullPathWithTargetPath")
                    {
                        var fromPath = MSBuildProjectService.FromMSBuildPath(project.ItemDirectory, item.Include);
                        var toPath   = item.Metadata.GetPathValue("TargetPath", relativeToPath: pconf.OutputDirectory);
                        deployFiles.Add(new DeployFile(project, fromPath, toPath, TargetDirectory.ProgramFiles));
                    }
                }
            }
            else
            {
#pragma warning disable 618 //obsolete
                FilePath outDir = pconf.OutputDirectory;
                foreach (FilePath file in project.GetOutputFiles(configuration))
                {
                    deployFiles.Add(new DeployFile(project, file, file.ToRelative(outDir), TargetDirectory.ProgramFiles));
                }
                foreach (FileCopySet.Item item in project.GetSupportFileList(configuration))
                {
                    deployFiles.Add(new DeployFile(project, item.Src, item.Target, TargetDirectory.ProgramFiles));
                }
#pragma warning restore 618
            }

            // Collect deployable files
            foreach (ProjectFile file in project.Files)
            {
                // skip CopyToOutputDirectory files when it's just a project build, because
                // MonoDevelop.Project.Projects already copies these files using more subtle overwriting
                // semantics
                if (file.CopyToOutputDirectory != FileCopyMode.None)
                {
                    continue;
                }

                var props = new DeployProperties(file);
                if (props.ShouldDeploy)
                {
                    var dp = new DeployFile(file);
                    deployFiles.Add(dp);
                }
            }

            return(deployFiles);
        }