void InstallEntry(ProgressMonitor monitor, DeployContext ctx, SolutionFolderItem entry, ConfigurationSelector configuration) { foreach (DeployFile df in DeployService.GetDeployFiles(ctx, new SolutionFolderItem[] { entry }, configuration)) { string targetPath = df.ResolvedTargetFile; if (targetPath == null) { monitor.ReportWarning("Could not copy file '" + df.RelativeTargetPath + "': Unknown target directory."); continue; } CopyFile(monitor, df.SourcePath, df.ResolvedTargetFile, df.FileAttributes); } SolutionFolder c = entry as SolutionFolder; if (c != null) { monitor.BeginTask("Installing solution '" + c.Name + "'", c.Items.Count); foreach (SolutionFolderItem ce in c.Items) { InstallEntry(monitor, ctx, ce, configuration); monitor.Step(1); } monitor.EndTask(); } }
public async Task <bool> Build(ProgressMonitor monitor) { var res = await DeployService.BuildPackage(monitor, this); needsBuilding = false; return(res); }
void RunTestSourcesPackage(string solFile) { solFile = Util.GetSampleProject(solFile); Solution sol = (Solution)Services.ProjectService.ReadWorkspaceItem(Util.GetMonitor(), solFile); SourcesZipPackageBuilder pb = new SourcesZipPackageBuilder(); pb.FileFormat = sol.FileFormat; pb.SetSolutionItem(sol.RootFolder, sol.GetAllSolutionItems <SolutionItem> ()); pb.TargetFile = GetTempTarFile("sourceszip"); if (!DeployService.BuildPackage(Util.GetMonitor(), pb)) { Assert.Fail("Package generation failed"); } List <string> files = new List <string> (); foreach (string f in sol.GetItemFiles(true)) { files.Add(sol.GetRelativeChildPath(f)); } CheckTarContents(pb.TargetFile, files.ToArray(), true); }
string GetDirectoryName(string dirId) { foreach (DeployDirectoryInfo info in DeployService.GetDeployDirectoryInfo()) { if (dirId == info.Id) { return(info.Description); } } return(""); }
public string GetDirectory(string folderId) { string dir = resolver.GetDirectory(this, folderId); if (dir != null) { return(dir); } else { return(DeployService.GetDeployDirectory(this, folderId)); } }
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; }
void RunTestTarballPackage(string solFile, bool autotools, string config, string[] expectedFiles) { solFile = Util.GetSampleProject(solFile); Solution sol = (Solution)Services.ProjectService.ReadWorkspaceItem(Util.GetMonitor(), solFile); TarballDeployTarget pb = new TarballDeployTarget(); pb.SetSolutionItem(sol.RootFolder, sol.GetAllSolutionItems <SolutionItem> ()); pb.TargetDir = Util.CreateTmpDir("tarball-target-dir"); pb.DefaultConfiguration = config; pb.GenerateFiles = true; pb.GenerateAutotools = autotools; if (!DeployService.BuildPackage(Util.GetMonitor(), pb)) { Assert.Fail("Package generation failed"); } string tarfile = Directory.GetFiles(pb.TargetDir) [0]; Untar(tarfile, null); string[] dirs = Directory.GetDirectories(pb.TargetDir); Assert.AreEqual(1, dirs.Length); string tarDir = dirs [0]; string prefix = Path.Combine(pb.TargetDir, "install"); if (!Exec(Path.Combine(tarDir, "configure"), "--prefix=" + prefix, tarDir)) { Assert.Fail("Configure script failed"); } if (!Exec("make", "all", tarDir)) { Assert.Fail("Build failed"); } if (!Exec("make", "install", tarDir)) { Assert.Fail("Install failed"); } CheckDirContents(prefix, expectedFiles); }
public void Initialize(EditSession session) { values = DeployService.GetDeployDirectoryInfo(); ebox = new Gtk.EventBox(); ebox.Show(); PackStart(ebox, true, true, 0); combo = Gtk.ComboBoxEntry.NewText(); combo.Changed += combo_Changed; combo.Entry.IsEditable = false; combo.Entry.HasFrame = false; combo.Entry.HeightRequest = combo.SizeRequest().Height; combo.Show(); ebox.Add(combo); foreach (DeployDirectoryInfo value in values) { combo.AppendText(value.Description); } }
void RunTestBinariesPackage(string solFile, string[] expectedFiles) { solFile = Util.GetSampleProject(solFile); Solution sol = (Solution)Services.ProjectService.ReadWorkspaceItem(Util.GetMonitor(), solFile); BinariesZipPackageBuilder pb = new BinariesZipPackageBuilder(); pb.SetSolutionItem(sol.RootFolder, sol.GetAllSolutionItems <SolutionItem> ()); pb.TargetFile = GetTempTarFile("binzip"); pb.Platform = "Linux"; pb.Configuration = "Debug"; if (!DeployService.BuildPackage(Util.GetMonitor(), pb)) { Assert.Fail("Package generation failed"); } CheckTarContents(pb.TargetFile, expectedFiles, true); }
public bool Build(IProgressMonitor monitor) { DeployService.BuildPackage(monitor, this); needsBuilding = false; return(true); }
public virtual DeployFileCollection GetDeployFiles(DeployContext ctx, ConfigurationSelector configuration) { return(DeployService.GetDeployFiles(ctx, GetAllEntries(), configuration)); }