Esempio n. 1
0
        public ScriptMetadataGenerator(TextWriter writer, IMetadataCompilerOptions options, SymbolSet symbols)
        {
            Debug.Assert(writer != null);
            Writer = new ScriptTextWriter(writer);

            Options      = options;
            this.symbols = symbols;
        }
Esempio n. 2
0
        private bool Compile()
        {
            IMetadataCompilerOptions options = CreateOptions(out ITaskItem scriptTaskItem);

            scripts.Add(scriptTaskItem);

            MetadataCompiler compiler = new MetadataCompiler(this);

            return(compiler.Compile(options) && !hasErrors);
        }
Esempio n. 3
0
        public bool Compile(IMetadataCompilerOptions options)
        {
            this.options = options ?? throw new ArgumentNullException(nameof(options));

            if (options.DebugMode)
            {
                Debugger.Launch();
            }

            hasErrors          = false;
            symbols            = new SymbolSet();
            symbols.ScriptName = options.AssemblyName;
            ScriptReferenceProvider.Instance.Reset();

            ImportMetadata();
            GenerateMetadata();

            if (hasErrors)
            {
                return(false);
            }

            return(true);
        }