Exemplo n.º 1
0
        public DeployFileCollection GetDeployFiles(ConfigurationSelector configuration)
        {
            DeployFileCollection deployFiles = new DeployFileCollection();

            CProjectConfiguration conf   = (CProjectConfiguration)GetConfiguration(configuration);
            CompileTarget         target = conf.CompileTarget;

            // Headers and resources
            foreach (ProjectFile f in Files)
            {
                if (f.BuildAction == BuildAction.Content)
                {
                    string targetDirectory =
                        (IsHeaderFile(f.Name) ? TargetDirectory.Include : TargetDirectory.ProgramFiles);

                    deployFiles.Add(new DeployFile(this, f.FilePath, f.ProjectVirtualPath, targetDirectory));
                }
            }

            // Output
            string output = GetOutputFileName(configuration);

            if (!string.IsNullOrEmpty(output))
            {
                string targetDirectory = string.Empty;

                switch (target)
                {
                case CompileTarget.Bin:
                    targetDirectory = TargetDirectory.ProgramFiles;
                    break;

                case CompileTarget.SharedLibrary:
                    targetDirectory = TargetDirectory.ProgramFiles;
                    break;

                case CompileTarget.StaticLibrary:
                    targetDirectory = TargetDirectory.ProgramFiles;
                    break;
                }

                deployFiles.Add(new DeployFile(this, output, Path.GetFileName(output), targetDirectory));
            }

            // PkgPackage
            if (target != CompileTarget.Bin)
            {
                string pkgfile = WriteDeployablePgkPackage(this, conf);
                deployFiles.Add(new DeployFile(this, Path.Combine(BaseDirectory, pkgfile), pkgfile, LinuxTargetDirectory.PkgConfig));
            }

            return(deployFiles);
        }
        public override DeployFileCollection GetProjectDeployFiles(DeployContext ctx, Project project,
                                                                   ConfigurationSelector configuration)
        {
            DeployFileCollection files = base.GetProjectDeployFiles(ctx, project, configuration);

            AspNetAppProject aspProj = project as AspNetAppProject;

            //none of this needs to happen if it's just happening during solution build
            if (aspProj == null || ctx.ProjectBuildOnly)
            {
                return(files);
            }

            //audit the DeployFiles to make sure they're allowed and laid out for ASP.NET
            foreach (DeployFile df in files)
            {
                //rewrite ProgramFiles target to ASP.NET's "bin" target
                if (df.TargetDirectoryID == TargetDirectory.ProgramFiles)
                {
                    df.RelativeTargetPath = Path.Combine("bin", df.RelativeTargetPath);
                }
            }

            //add all ASP.NET files marked as content. They go relative to the application root, which we assume to be ProgramFiles
            foreach (ProjectFile pf in aspProj.Files)
            {
                if (pf.BuildAction == BuildAction.Content)
                {
                    files.Add(new DeployFile(aspProj, pf.FilePath, pf.ProjectVirtualPath, TargetDirectory.ProgramFiles));
                }
            }

            return(files);
        }
		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 config)
        {
            DeployFileCollection col = base.GetProjectDeployFiles(ctx, project, config);

            LinuxDeployData data = LinuxDeployData.GetLinuxDeployData(project);

            if (ctx.Platform == "Linux")
            {
                DotNetProject netProject = project as DotNetProject;
                if (netProject != null)
                {
                    DotNetProjectConfiguration conf = netProject.GetConfiguration(config) as DotNetProjectConfiguration;
                    if (conf != null)
                    {
                        if (conf.CompileTarget == CompileTarget.Exe || conf.CompileTarget == CompileTarget.WinExe)
                        {
                            if (data.GenerateScript)
                            {
                                col.Add(GenerateLaunchScript(ctx, netProject, data, conf));
                            }
                        }
                        if (conf.CompileTarget == CompileTarget.Library || conf.CompiledOutputName.FileName.EndsWith(".dll"))
                        {
                            if (data.GeneratePcFile)
                            {
                                col.Add(GeneratePcFile(ctx, netProject, data, conf));
                            }
                        }
                    }
                }
            }

            // If the project is deploying an app.desktop file, rename it to the name of the project.
            foreach (DeployFile file in col)
            {
                if (Path.GetFileName(file.RelativeTargetPath) == "app.desktop")
                {
                    string dir = Path.GetDirectoryName(file.RelativeTargetPath);
                    file.RelativeTargetPath = Path.Combine(dir, data.PackageName + ".desktop");
                }
            }

            return(col);
        }
		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;
		}
Exemplo n.º 6
0
        public DeployFileCollection GetDeployFiles(ConfigurationSelector configuration)
        {
            DeployFileCollection result = new DeployFileCollection();

            foreach (Translation translation in this.Translations)
            {
                if (OutputType == TranslationOutputType.SystemPath)
                {
                    string moDirectory = Path.Combine("locale", translation.IsoCode);
                    moDirectory = Path.Combine(moDirectory, "LC_MESSAGES");
                    string moFileName = Path.Combine(moDirectory, PackageName + ".mo");
                    result.Add(new DeployFile(this, translation.GetOutFile(configuration), moFileName, TargetDirectory.CommonApplicationDataRoot));
                }
                else
                {
                    string moDirectory = Path.Combine(RelPath, translation.IsoCode);
                    moDirectory = Path.Combine(moDirectory, "LC_MESSAGES");
                    string moFileName = Path.Combine(moDirectory, PackageName + ".mo");
                    result.Add(new DeployFile(this, translation.GetOutFile(configuration), moFileName, TargetDirectory.ProgramFiles));
                }
            }
            return(result);
        }
Exemplo n.º 7
0
		public DeployFileCollection GetDeployFiles (ConfigurationSelector configuration)
		{
			DeployFileCollection result = new DeployFileCollection ();
			foreach (Translation translation in this.Translations) {
				if (OutputType == TranslationOutputType.SystemPath) {
					string moDirectory = Path.Combine ("locale", translation.IsoCode);
					moDirectory = Path.Combine (moDirectory, "LC_MESSAGES");
					string moFileName  = Path.Combine (moDirectory, PackageName + ".mo");
					result.Add (new DeployFile (this, translation.GetOutFile (configuration), moFileName, TargetDirectory.CommonApplicationDataRoot));
				} else {
					string moDirectory = Path.Combine (RelPath, translation.IsoCode);
					moDirectory = Path.Combine (moDirectory, "LC_MESSAGES");
					string moFileName  = Path.Combine (moDirectory, PackageName + ".mo");
					result.Add (new DeployFile (this, translation.GetOutFile (configuration), moFileName, TargetDirectory.ProgramFiles));
				}
			}
			return result;
		}
Exemplo n.º 8
0
		public DeployFileCollection GetDeployFiles (ConfigurationSelector configuration)
		{
			DeployFileCollection deployFiles = new DeployFileCollection ();
			
			CProjectConfiguration conf = (CProjectConfiguration) GetConfiguration (configuration);
			CompileTarget target = conf.CompileTarget;
			
			// Headers and resources
			foreach (ProjectFile f in Files) {
				if (f.BuildAction == BuildAction.Content) {
					string targetDirectory =
						(IsHeaderFile (f.Name) ? TargetDirectory.Include : TargetDirectory.ProgramFiles);
					
					deployFiles.Add (new DeployFile (this, f.FilePath, f.ProjectVirtualPath, targetDirectory));
				}
			}
			
			// Output
			string output = GetOutputFileName (configuration);		
			if (!string.IsNullOrEmpty (output)) {
				string targetDirectory = string.Empty;
				
				switch (target) {
				case CompileTarget.Bin:
					targetDirectory = TargetDirectory.ProgramFiles;
					break;
				case CompileTarget.SharedLibrary:
					targetDirectory = TargetDirectory.ProgramFiles;
					break;
				case CompileTarget.StaticLibrary:
					targetDirectory = TargetDirectory.ProgramFiles;
					break;
				}					
				
				deployFiles.Add (new DeployFile (this, output, Path.GetFileName (output), targetDirectory));
			}
			
			// PkgPackage
			if (target != CompileTarget.Bin) {
				string pkgfile = WriteDeployablePgkPackage (this, conf);
				deployFiles.Add (new DeployFile (this, Path.Combine (BaseDirectory, pkgfile), pkgfile, LinuxTargetDirectory.PkgConfig));
			}
			
			return deployFiles;
		}