Example #1
0
        private void CompileDelayedModules(ExternalLibraryDef library)
        {
            foreach (var scriptFile in _delayLoadedScripts)
            {
                if (scriptFile.asClass)
                {
                    library.AddClass(scriptFile.identifier, scriptFile.path);
                }
                else
                {
                    var module = library.AddModule(scriptFile.identifier, scriptFile.path);
                }
            }

            library.Modules.ForEach(moduleFile =>
            {
                var image        = CompileFile(moduleFile.FilePath);
                moduleFile.Image = image;
            });

            library.Classes.ForEach(classFile =>
            {
                var image = CompileFile(classFile.FilePath);
                _engine.AttachedScriptsFactory.LoadAndRegister(classFile.Symbol, image);
                classFile.Image = image;
            });

            _env.InitExternalLibrary(_engine, library);
        }
Example #2
0
        public bool ProcessLibrary(string libraryPath)
        {
            bool success;

            _delayLoadedScripts.Clear();

            if (!_customized)
            {
                LibraryResolver.TraceLoadLibrary(
                    Locale.NStr($"ru = 'Использую НЕ кастомизированный загрузчик пакетов по умолчанию для библиотеки {libraryPath}';" +
                                $"en = 'Use NOT customized package loader for library {libraryPath}'")
                    );

                success = DefaultProcessing(libraryPath);
            }
            else
            {
                LibraryResolver.TraceLoadLibrary(
                    Locale.NStr($"ru = 'Использую КАСТОМИЗИРОВАННЫЙ загрузчик пакетов для библиотеки {libraryPath}';" +
                                $"en = 'Use CUSTOMIZED package loader for library {libraryPath}'")
                    );

                success = CustomizedProcessing(libraryPath);
            }

            if (success)
            {
                var library = new ExternalLibraryDef(Path.GetFileName(libraryPath));
                CompileDelayedModules(library);
            }

            return(success);
        }
Example #3
0
        public bool ProcessLibrary(string libraryPath)
        {
            bool success;

            _delayLoadedScripts.Clear();

            if (!_customized)
            {
                success = DefaultProcessing(libraryPath);
            }
            else
            {
                success = CustomizedProcessing(libraryPath);
            }

            if (success)
            {
                var library = new ExternalLibraryDef(Path.GetFileName(libraryPath));
                CompileDelayedModules(library);
            }

            return(success);
        }