public override IAssemblyCompilerContext Run(IAssemblyCompiler compiler, IAssemblyCompilerContext context) { var assemblyContext = context as AssemblyCompilerContext; if (assemblyContext == null) return context; var cmd = new StringBuilder("gcc -Wall -o "); cmd.Append(assemblyContext.Output); foreach (var file in assemblyContext.OutputFiles) cmd.AppendFormat(" {0}", file.Filename); string output; string error; if (Helper.Execute(cmd.ToString(), out error, out output) == 0) { if (!string.IsNullOrEmpty(error)) Helper.Break(); return context; } Helper.Stop(() => new BuildException(error, output)); return null; }
public override IAssemblyCompilerContext Run(IAssemblyCompiler compiler, IAssemblyCompilerContext context) { var assemblyContext = context as AssemblyCompilerContext; if (assemblyContext == null) { return(context); } var cmd = new StringBuilder("gcc -Wall -o "); cmd.Append(assemblyContext.Output); foreach (var file in assemblyContext.OutputFiles) { cmd.AppendFormat(" {0}", file.Filename); } string output; string error; if (Helper.Execute(cmd.ToString(), out error, out output) == 0) { if (!string.IsNullOrEmpty(error)) { Helper.Break(); } return(context); } Helper.Stop(() => new BuildException(error, output)); return(null); }
public AzureFunctionsCompiler(ICompilerLog compilerLog) { _compilerLog = compilerLog; _jsonCompiler = new JsonCompiler(); _openApiCompiler = new OpenApiCompiler(); _assemblyCompiler = new AzureFunctionsAssemblyCompiler(compilerLog, new TemplateProvider(CompileTargetEnum.AzureFunctions)); }
public FunctionCompiler(Assembly configurationSourceAssembly, string outputBinaryFolder, bool outputProxiesJson, TargetEnum target, IAssemblyCompiler assemblyCompiler = null, ITriggerReferenceProvider triggerReferenceProvider = null) { _configurationSourceAssembly = configurationSourceAssembly; _outputBinaryFolder = outputBinaryFolder; _outputProxiesJson = outputProxiesJson; _target = target; _serviceCollection = new ServiceCollection(); CommandingDependencyResolverAdapter adapter = new CommandingDependencyResolverAdapter( (fromType, toInstance) => _serviceCollection.AddSingleton(fromType, toInstance), (fromType, toType) => _serviceCollection.AddTransient(fromType, toType), (resolveType) => null // we never resolve during compilation ); _commandRegistry = adapter.AddCommanding(); _assemblyCompiler = assemblyCompiler ?? new AssemblyCompiler(); _triggerReferenceProvider = triggerReferenceProvider ?? new TriggerReferenceProvider(); _jsonCompiler = new JsonCompiler(); _proxiesJsonCompiler = new ProxiesJsonCompiler(); _openApiCompiler = new OpenApiCompiler(); }
protected TestBase(ITestOutputHelper testOutputHelper) { _testOutputHelper = testOutputHelper; _assemblyCompiler = new AssemblyCompiler( new FluentlangToCSharpEmitter(), new CSharpToAssemblyCompiler(LocalSystemDllsMetadataReferenceProvider.Instance, GetLogger <CSharpToAssemblyCompiler>())); _assemblyFactory = new AssemblyFactory(_assemblyCompiler); }
public override IAssemblyCompilerContext Run(IAssemblyCompiler compiler, IAssemblyCompilerContext context) { var ac = context as AssemblyCompilerContext; Helper.IsNotNull(ac); var asm = ac.AssemblyDefinition; var mc = compiler.MethodCompiler; foreach (ModuleDefinition module in asm.Modules) foreach (TypeDefinition type in module.Types) foreach (MethodDefinition method in type.Methods) ac.MethodContexts.Add(mc.GetContext(context, method)); return ac; }
public override IAssemblyCompilerContext Run(IAssemblyCompiler compiler, IAssemblyCompilerContext context) { var assemblyContext = context as AssemblyCompilerContext; if (assemblyContext == null) return context; var list = new List<IMethodCompilerContext>(assemblyContext.MethodContexts); assemblyContext.MethodContexts.Clear(); foreach (var mc in list) assemblyContext.MethodContexts.Add(compiler.MethodCompiler.Compile(mc)); return assemblyContext; }
public override IAssemblyCompilerContext Run(IAssemblyCompiler compiler, IAssemblyCompilerContext ctxt) { var context = ctxt as TestContext; if (context == null) return ctxt; var mc = context.MethodContexts.First(); CreateRuntime(context, mc.Method); //CreateStack(assemblyContext, method); return context; }
public override IAssemblyCompilerContext Run(IAssemblyCompiler compiler, IAssemblyCompilerContext context) { var asmcc = context as AssemblyCompilerContext; if (asmcc == null) { return(context); } var asm = asmcc.AssemblyDefinition; foreach (AssemblyNameReference asmRef in asm.MainModule.AssemblyReferences) { } return(context); }
public override IAssemblyCompilerContext Run(IAssemblyCompiler compiler, IAssemblyCompilerContext ctxt) { var context = ctxt as TestContext; if (context == null) { return(ctxt); } var mc = context.MethodContexts.First(); CreateRuntime(context, mc.Method); //CreateStack(assemblyContext, method); return(context); }
public override IAssemblyCompilerContext Run(IAssemblyCompiler compiler, IAssemblyCompilerContext context) { var assemblyContext = context as AssemblyCompilerContext; if (assemblyContext == null) { return(context); } var list = new List <IMethodCompilerContext>(assemblyContext.MethodContexts); assemblyContext.MethodContexts.Clear(); foreach (var mc in list) { assemblyContext.MethodContexts.Add(compiler.MethodCompiler.Compile(mc)); } return(assemblyContext); }
public override IAssemblyCompilerContext Run(IAssemblyCompiler compiler, IAssemblyCompilerContext context) { var ac = context as AssemblyCompilerContext; Helper.IsNotNull(ac); var asm = ac.AssemblyDefinition; var mc = compiler.MethodCompiler; foreach (ModuleDefinition module in asm.Modules) { foreach (TypeDefinition type in module.Types) { foreach (MethodDefinition method in type.Methods) { ac.MethodContexts.Add(mc.GetContext(context, method)); } } } return(ac); }
public virtual IAssemblyCompilerContext Run(IAssemblyCompiler compiler, IAssemblyCompilerContext context) { return context; }
public AssemblyFactory(IAssemblyCompiler assemblyCompiler) { _assemblyCompiler = assemblyCompiler; }
public DefaultAssemblyProvider(IAssemblyCompiler assemblyCompiler, Encoding scriptFileEncoding) { _assemblyCompiler = assemblyCompiler; _scriptFileEncoding = scriptFileEncoding; }
public AspNetCoreCompiler(ICompilerLog compilerLog) { _compilerLog = compilerLog; _assemblyCompiler = new AspNetCoreAssemblyCompiler(compilerLog, new TemplateProvider(CompileTargetEnum.AspNetCore)); _openApiCompiler = new OpenApiCompiler(); }
public DefaultAssemblyProvider(IAssemblyCompiler assemblyCompiler) : this(assemblyCompiler, DefaultEncoding) { }
public virtual IAssemblyCompilerContext Run(IAssemblyCompiler compiler, IAssemblyCompilerContext context) { return(context); }
public EditorEngine(AssemblyFactory assemblyFactory, IAssemblyCompiler assemblyCompiler) { _assemblyFactory = assemblyFactory; _assemblyCompiler = assemblyCompiler; }
public ScriptAssemblyComposer(IAssemblyCompiler compiler) { this.compiler = compiler; }