Exemple #1
0
        // Might not keep this as a public method
        public void CompileTestCode(TestCompilerSettings settings)
        {
            if (cacheSettings == null || !cacheSettings.IsEqual(settings))
            {
                cacheSettings = new TestCompilerSettings(settings);

                string assembly = RunCodeDomCompiler(settings);

                Console.WriteLine("Executing MOSA compiler...");
                linker = RunMosaCompiler(settings, assembly);
            }
        }
Exemple #2
0
        private TestCaseAssemblyCompiler(IArchitecture architecture, ITypeSystem typeSystem, ITypeLayout typeLayout) :
            base(architecture, typeSystem, typeLayout)
        {
            linker = new TestAssemblyLinker();

            // Build the assembly compiler pipeline
            Pipeline.AddRange(new IAssemblyCompilerStage[] {
                new AssemblyMemberCompilationSchedulerStage(),
                new MethodCompilerSchedulerStage(),
                new TypeLayoutStage(),
                linker
            });
            architecture.ExtendAssemblyCompilerPipeline(Pipeline);
        }
        private TestCaseAssemblyCompiler(IArchitecture architecture, ITypeSystem typeSystem, ITypeLayout typeLayout)
            : base(architecture, typeSystem, typeLayout)
        {
            linker = new TestAssemblyLinker();

            // Build the assembly compiler pipeline
            Pipeline.AddRange(new IAssemblyCompilerStage[] {
                new AssemblyMemberCompilationSchedulerStage(),
                new MethodCompilerSchedulerStage(),
                new TypeLayoutStage(),
                linker
            });
            architecture.ExtendAssemblyCompilerPipeline(Pipeline);
        }
Exemple #4
0
        private TestAssemblyLinker RunMosaCompiler(TestCompilerSettings settings, string assemblyFile)
        {
            IAssemblyLoader assemblyLoader = new AssemblyLoader();

            assemblyLoader.InitializePrivatePaths(settings.References);

            assemblyLoader.LoadModule(assemblyFile);

            foreach (string file in settings.References)
            {
                assemblyLoader.LoadModule(file);
            }

            typeSystem = new TypeSystem();
            typeSystem.LoadModules(assemblyLoader.Modules);

            TestAssemblyLinker linker = TestCaseAssemblyCompiler.Compile(typeSystem);

            return(linker);
        }