Exemplo n.º 1
0
        public void Create(Version version)
        {
            this._dependencyProducts = new DependencyProducts();
            this._version            = version;
            this._created            = true;

            this.Save();
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        public void Create(Version parent)
        {
            this._dependencyProducts = new DependencyProducts();
            this._parent             = parent;
            this._created            = true;
            this._url = string.Format("{0}/{1}/{2}/beta.data", SVNManager.VERSIONS_URL, this._parent.Plugin.Name, this._parent.Name);

            this.Save();
        }
Exemplo n.º 4
0
        public static DependencyProducts Load(XmlElement xmlElement)
        {
            DependencyProducts dependencyProducts = new DependencyProducts();

            foreach (XmlElement child in xmlElement.ChildNodes)
            {
                if (child.Name.Equals("DependencyProduct"))
                {
                    dependencyProducts.Add(DependencyProduct.Load(child));
                }
            }

            return(dependencyProducts);
        }
Exemplo n.º 5
0
        public static BetaData Load(Version parent, string path)
        {
            FileInfo fileinfo = new FileInfo(path);

            if (!fileinfo.Exists)
            {
                return(null);
            }

            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.Load(path);

            if (!xmlDocument.DocumentElement.Name.Equals("BetaData"))
            {
                return(null);
            }

            XmlElement   documentElement = xmlDocument.DocumentElement;
            XmlAttribute name            = documentElement.Attributes["Name"];

            BetaData beta = new BetaData();

            beta._created = true;
            beta._name    = name.Value;
            beta._path    = path;

            if (parent != null)
            {
                beta._parent = parent;
                beta._url    = string.Format("{0}/{1}/{2}/beta.data", SVNManager.VERSIONS_URL, parent.Plugin.Name, parent.Name);
            }

            foreach (XmlElement child in documentElement.ChildNodes)
            {
                if (child.Name.Equals("DependencyProducts"))
                {
                    beta.DependencyProducts = DependencyProducts.Load(child);
                }
            }

            return(beta);
        }
Exemplo n.º 6
0
        public static ProductData Load(string path)
        {
            FileInfo fileinfo = new FileInfo(path);

            if (!fileinfo.Exists)
            {
                return(null);
            }

            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.Load(path);

            if (!xmlDocument.DocumentElement.Name.Equals("ProductData"))
            {
                return(null);
            }

            XmlElement   documentElement = xmlDocument.DocumentElement;
            XmlAttribute name            = documentElement.Attributes["Name"];

            ProductData product = new ProductData();

            product._created = true;
            product._name    = name.Value;
            product.Path     = path;

            foreach (XmlElement child in documentElement.ChildNodes)
            {
                if (child.Name.Equals("DependencyProducts"))
                {
                    product.DependencyProducts = DependencyProducts.Load(child);
                }
            }

            return(product);
        }