Exemplo n.º 1
0
        public override PackageBuilder[] CreateDefaultBuilders()
        {
            List <PackageBuilder> list = new List <PackageBuilder> ();

            foreach (FileFormat format in Services.ProjectService.FileFormats.GetFileFormatsForObject(RootSolutionItem))
            {
                SourcesZipPackageBuilder pb = (SourcesZipPackageBuilder)Clone();
                pb.FileFormat = format;

                // The suffix for the archive will be the extension of the file format.
                // If there is no extension, use the whole file name.
                string fname  = format.GetValidFileName(RootSolutionItem, RootSolutionItem.ParentSolution.FileName);
                string suffix = Path.GetExtension(fname);
                if (suffix.Length > 0)
                {
                    suffix = suffix.Substring(1).ToLower();                       // Remove the initial dot
                }
                else
                {
                    suffix = Path.GetFileNameWithoutExtension(suffix).ToLower();
                }

                // Change the name in the target file
                string ext = DeployService.GetArchiveExtension(pb.TargetFile);
                string fn  = TargetFile.Substring(0, TargetFile.Length - ext.Length);
                pb.TargetFile = fn + "-" + suffix + ext;
                list.Add(pb);
            }
            return(list.ToArray());
        }
Exemplo n.º 2
0
        public override PackageBuilder[] CreateDefaultBuilders()
        {
            List <PackageBuilder> list = new List <PackageBuilder> ();

            foreach (DeployPlatformInfo plat in DeployService.GetDeployPlatformInfo())
            {
                BinariesZipPackageBuilder pb = (BinariesZipPackageBuilder)Clone();
                pb.Platform = plat.Id;
                string ext = DeployService.GetArchiveExtension(pb.TargetFile);
                string fn  = TargetFile.Substring(0, TargetFile.Length - ext.Length);
                pb.TargetFile = fn + "-" + plat.Id.ToLower() + ext;
                list.Add(pb);
            }
            return(list.ToArray());
        }