Example #1
0
        public static void Save(BoardSupportPackage bsp, String BSPRoot)
        {
            XmlTools.SaveObject(bsp, Path.Combine(BSPRoot, "BSP.XML"));

            string archiveName = string.Format("{0}-{1}.vgdbxbsp", bsp.PackageID.Split('.').Last(), bsp.PackageVersion);

            TarPacker.PackDirectoryToTGZ(BSPRoot, Path.Combine(BSPRoot, archiveName), fn => Path.GetExtension(fn).ToLower() != ".vgdbxbsp");

            BSPSummary lst = new BSPSummary
            {
                BSPName              = bsp.PackageDescription,
                BSPID                = bsp.PackageID,
                BSPVersion           = bsp.PackageVersion,
                MinimumEngineVersion = bsp.MinimumEngineVersion,
                FileName             = archiveName,
            };

            foreach (var mcu in bsp.SupportedMCUs)
            {
                lst.MCUs.Add(new BSPSummary.MCU {
                    Name = mcu.ID, FLASHSize = mcu.FLASHSize, RAMSize = mcu.RAMSize, UserFriendlyName = mcu.UserFriendlyName
                });
            }

            XmlTools.SaveObject(lst, Path.Combine(BSPRoot, Path.ChangeExtension(archiveName, ".xml")));
        }
Example #2
0
        static void ProduceBSPArchive(string BSPRoot, BoardSupportPackage bsp)
        {
            bsp.PackageVersion  = string.Format("{0:d4}{1:d2}{2:d2}", DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
            bsp.PackageVersion += "-beta";
            XmlTools.SaveObject(bsp, Path.Combine(BSPRoot, "BSP.XML"));

            string archiveName = string.Format("{0}-{1}.vgdbxbsp", bsp.PackageID.Split('.').Last(), bsp.PackageVersion);

            Console.WriteLine("Creating BSP archive...");

            TarPacker.PackDirectoryToTGZ(BSPRoot, Path.Combine(Path.GetDirectoryName(BSPRoot), archiveName), fn =>
            {
                string relPath = fn.Substring(BSPRoot.Length + 1);
                if (relPath.StartsWith(".git"))
                {
                    return(false);
                }
                return(true);
            });

            BSPSummary lst = new BSPSummary
            {
                BSPName              = bsp.PackageDescription,
                BSPID                = bsp.PackageID,
                BSPVersion           = bsp.PackageVersion,
                MinimumEngineVersion = bsp.MinimumEngineVersion,
                FileName             = archiveName,
            };

            foreach (var mcu in bsp.SupportedMCUs)
            {
                lst.MCUs.Add(new BSPSummary.MCU {
                    Name = mcu.ID, FLASHSize = mcu.FLASHSize, RAMSize = mcu.RAMSize
                });
            }

            XmlTools.SaveObject(lst, Path.Combine(Path.GetDirectoryName(BSPRoot), Path.ChangeExtension(archiveName, ".xml")));
        }
Example #3
0
        static void ProduceBSPArchive(string BSPRoot, BoardSupportPackage bsp)
        {
            bsp.PackageVersion = string.Format("{0:d4}{1:d2}{2:d2}", DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
            bsp.PackageVersion += "-beta";
            XmlTools.SaveObject(bsp, Path.Combine(BSPRoot, "BSP.XML"));

            string archiveName = string.Format("{0}-{1}.vgdbxbsp", bsp.PackageID.Split('.').Last(), bsp.PackageVersion);
            Console.WriteLine("Creating BSP archive...");

            TarPacker.PackDirectoryToTGZ(BSPRoot, Path.Combine(Path.GetDirectoryName(BSPRoot), archiveName), fn =>
            {
                string relPath = fn.Substring(BSPRoot.Length + 1);
                if (relPath.StartsWith(".git"))
                    return false;
                return true;
            });

            BSPSummary lst = new BSPSummary
            {
                BSPName = bsp.PackageDescription,
                BSPID = bsp.PackageID,
                BSPVersion = bsp.PackageVersion,
                MinimumEngineVersion = bsp.MinimumEngineVersion,
                FileName = archiveName,
            };

            foreach (var mcu in bsp.SupportedMCUs)
                lst.MCUs.Add(new BSPSummary.MCU { Name = mcu.ID, FLASHSize = mcu.FLASHSize, RAMSize = mcu.RAMSize });

            XmlTools.SaveObject(lst, Path.Combine(Path.GetDirectoryName(BSPRoot), Path.ChangeExtension(archiveName, ".xml")));
        }