public override CrayonWorkerResult DoWorkImpl(CrayonWorkerResult[] args)
 {
     // byteCode = EncodeByteCode(compilationResult)
     CompilationBundle compilationResult = (CompilationBundle)args[0].Value;
     string byteCode = ByteCodeEncoder.Encode(compilationResult.ByteCode);
     return new CrayonWorkerResult() { Value = byteCode };
 }
        public static string Run(ExportCommand command, BuildContext buildContext)
        {
            string           outputDirectory   = new GetOutputDirectoryWorker().DoWorkImpl(buildContext);
            ExportBundle     compilationResult = ExportBundle.Compile(buildContext);
            ResourceDatabase resDb             = ResourceDatabaseBuilder.PrepareResources(buildContext, null);
            string           byteCode          = ByteCodeEncoder.Encode(compilationResult.ByteCode);

            byte[] cbxFileBytes = new GenerateCbxFileContentWorker().GenerateCbxBinaryData(buildContext, resDb, compilationResult, byteCode);
            Dictionary <string, FileOutput> fileOutputContext = new Dictionary <string, FileOutput>();

            new PopulateFileOutputContextForCbxWorker().GenerateFileOutput(fileOutputContext, buildContext, resDb, cbxFileBytes);
            new EmitFilesToDiskWorker().DoWorkImpl(fileOutputContext, outputDirectory);
            string absoluteCbxFilePath = new GetCbxFileLocation().DoWorkImpl(outputDirectory, buildContext);

            return(absoluteCbxFilePath);
        }
Example #3
0
        private static async Task <InternalCompilationBundle> CompileImpl(CompileRequest compileRequest, Wax.WaxHub waxHub)
        {
            ParserContext parserContext = new ParserContext(compileRequest, waxHub);

            TopLevelEntity[] resolvedParseTree = await parserContext.ParseAllTheThings();

            ByteCodeCompiler bcc    = new ByteCodeCompiler();
            ByteBuffer       buffer = bcc.GenerateByteCode(parserContext, resolvedParseTree);

            return(new InternalCompilationBundle()
            {
                ByteCode = ByteCodeEncoder.Encode(buffer),
                RootScope = parserContext.RootScope,
                AllScopes = parserContext.ScopeManager.ImportedAssemblyScopes.ToArray(),
            });
        }
        public static void Run(ExportCommand command, BuildContext buildContext)
        {
            ExportBundle compilationResult = ExportBundle.Compile(buildContext);

            ByteCodeEncoder.Encode(compilationResult.ByteCode);
        }