Exemplo n.º 1
0
        public void BuildPackage(Package pkg)
        {
            string path = Config.PathFormat("{0}/{1}", cfg.pkg_path, pkg.GetBaseFolder());

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }

            /* Create all dirs */
            string [] paths = pkg.GetFolders();
            for (int i = 0; i < paths.GetLength(0); i++)
            {
                path = Config.PathFormat("{0}/{1}/{2}", cfg.pkg_path, pkg.GetBaseFolder(), paths[i]);
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
            }

            /* Do primitive copies */
            pkg.OnCopyFolders(this);
            pkg.OnCopyFiles(this);

            /* Do libraries */
            Library [] libs = pkg.GetLibraries();
            for (int i = 0; i < libs.Length; i++)
            {
                if (libs[i].build_mode == BuildMode.BuildMode_Episode1)
                {
                    continue;
                }
                if ((libs[i].platform & cfg.Platform) != cfg.Platform)
                {
                    continue;
                }
                if (!BuildLibrary(pkg, libs[i]))
                {
                    throw new System.Exception("Failed to compile library: " + libs[i].binary_name);
                }
            }

            /* Do plugins */
            Plugin [] plugins = pkg.GetPlugins();
            if (plugins != null)
            {
                for (int i = 0; i < plugins.Length; i++)
                {
                    if (!CompilePlugin(pkg, plugins[i]))
                    {
                        throw new System.Exception("Failed to compile plugin: " + plugins[i].Source);
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void BuildPackage(Package pkg)
        {
            string path = Config.PathFormat("{0}/{1}", cfg.pkg_path, pkg.GetBaseFolder());

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }

            /* Create all dirs */
            string [] paths = pkg.GetFolders();
            for (int i=0; i<paths.GetLength(0); i++)
            {
                path = Config.PathFormat("{0}/{1}/{2}", cfg.pkg_path, pkg.GetBaseFolder(), paths[i]);
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
            }

            /* Do primitive copies */
            pkg.OnCopyFolders(this);
            pkg.OnCopyFiles(this);

            /* Do libraries */
            Library [] libs = pkg.GetLibraries();
            for (int i=0; i<libs.Length; i++)
            {
                if (libs[i].build_mode == BuildMode.BuildMode_Episode1)
                {
                    continue;
                }
                if ((libs[i].platform & cfg.Platform) != cfg.Platform)
                {
                    continue;
                }
                if (!BuildLibrary(pkg, libs[i]))
                {
                    throw new System.Exception("Failed to compile library: " + libs[i].binary_name);
                }
            }

            /* Do plugins */
            Plugin [] plugins = pkg.GetPlugins();
            if (plugins != null)
            {
                for (int i=0; i<plugins.Length; i++)
                {
                    if (!CompilePlugin(pkg, plugins[i]))
                    {
                        throw new System.Exception("Failed to compile plugin: " + plugins[i].Source);
                    }
                }
            }
        }