Beispiel #1
0
        public string CreateBeta(string path, bool test)
        {
            List <string> folders = new List <string>();
            Dictionary <DependencyProduct, string> betaNames = new Dictionary <DependencyProduct, string>();

            string plugin            = this.Product.Name;
            string version           = this.VersionNumber;
            string betaName          = string.Empty;
            string folder            = string.Empty;
            string destinationFolder = string.Empty;

            if (test)
            {
                DependencyProducts dependencyProducts = this.BetaData.DependencyProducts;

                foreach (DependencyProduct dependencyProduct in dependencyProducts)
                {
                    betaName = SVNManager.Instance.CreateBeta(dependencyProduct.Name, dependencyProduct.Version);
                    folder   = SVNManager.Instance.DownloadRelease(dependencyProduct.Name, betaName);
                    folders.Add(string.Format(@"{0}\{1}\{2}\Promob5", folder, dependencyProduct.Name, betaName));
                    betaNames.Add(dependencyProduct, betaName);
                }
            }

            DependencyProduct product = new DependencyProduct(plugin, version);

            betaName = SVNManager.Instance.CreateBeta(plugin, version);
            folder   = SVNManager.Instance.DownloadRelease(plugin, betaName);
            folders.Add(string.Format(@"{0}\{1}\{2}\Promob5", folder, plugin, betaName));

            betaNames.Add(product, betaName);

            foreach (string source in folders)
            {
                try
                {
                    destinationFolder = string.Format(@"{0}\{1} - {2}", path, plugin, version);

                    if (!System.IO.Directory.Exists(destinationFolder))
                    {
                        System.IO.Directory.CreateDirectory(destinationFolder);
                    }

                    Promob.Builder.IO.IOHelper.MoveDirectoryContent(source, destinationFolder);
                }
                catch (IOException ex)
                {
                    throw ex;
                }
            }

            foreach (DependencyProduct dependencyproduct in betaNames.Keys)
            {
                SVNManager.Instance.DeleteBeta(dependencyproduct.Name, dependencyproduct.Version, betaNames[dependencyproduct]);
            }

            return(destinationFolder);
        }
Beispiel #2
0
        public static DependencyProduct Load(XmlElement xmlElement)
        {
            if (!xmlElement.Name.Equals("DependencyProduct"))
            {
                return(null);
            }

            XmlAttribute name    = xmlElement.Attributes["Name"];
            XmlAttribute version = xmlElement.Attributes["Version"];

            DependencyProduct dependencyProduct = new DependencyProduct(name.Value, version.Value);

            return(dependencyProduct);
        }