public bool CompileAssets(IFunctionCompilerMetadata functionCompilerMetadata,
                                  string newAssemblyNamespace,
                                  IFunctionAppConfiguration configuration,
                                  IReadOnlyCollection <string> externalAssemblies,
                                  string outputBinaryFolder)
        {
            HandlebarsHelpers.AzureFunctions.HandlebarsHelperRegistration.RegisterHelpers();

            bool isFSharpProject = functionCompilerMetadata.FunctionDefinitions.Any(x => x.IsFunctionalFunction);

            if (isFSharpProject)
            {
                _compilerLog.Warning("FSharp output is currently experimental");
            }

            OpenApiOutputModel openApi = _openApiCompiler.Compile(functionCompilerMetadata.OpenApiConfiguration,
                                                                  functionCompilerMetadata.FunctionDefinitions, outputBinaryFolder);

            _assemblyCompiler.OpenApiOutputModel = openApi;

            _jsonCompiler.Compile(functionCompilerMetadata.FunctionDefinitions, openApi, outputBinaryFolder,
                                  newAssemblyNamespace);

            return(_assemblyCompiler.Compile(functionCompilerMetadata.FunctionDefinitions,
                                             configuration?.GetType() ?? functionCompilerMetadata.BacklinkReferenceType,
                                             configuration != null ? null : functionCompilerMetadata.BacklinkPropertyInfo,
                                             newAssemblyNamespace,
                                             externalAssemblies,
                                             outputBinaryFolder,
                                             $"{newAssemblyNamespace}.dll",
                                             functionCompilerMetadata.CompilerOptions,
                                             functionCompilerMetadata.OutputAuthoredSourceFolder));
        }
Esempio n. 2
0
        public bool CompileAssets(IFunctionCompilerMetadata functionCompilerMetadata, string newAssemblyNamespace,
                                  IFunctionAppConfiguration configuration, IReadOnlyCollection <string> externalAssemblies, string outputBinaryFolder)
        {
            _compilerLog.Warning("ASP.Net Core output is currently experimental");

            FunctionMonkey.Compiler.Core.HandlebarsHelpers.AspNetCore.HandlebarsHelperRegistration.RegisterHelpers();

            OpenApiOutputModel openApi = _openApiCompiler.Compile(functionCompilerMetadata.OpenApiConfiguration,
                                                                  functionCompilerMetadata.FunctionDefinitions, outputBinaryFolder);

            _assemblyCompiler.OpenApiOutputModel = openApi;

            return(_assemblyCompiler.Compile(functionCompilerMetadata.FunctionDefinitions,
                                             configuration?.GetType() ?? functionCompilerMetadata.BacklinkReferenceType,
                                             configuration != null ? null : functionCompilerMetadata.BacklinkPropertyInfo,
                                             newAssemblyNamespace,
                                             externalAssemblies,
                                             outputBinaryFolder,
                                             $"{newAssemblyNamespace}.dll",
                                             functionCompilerMetadata.CompilerOptions,
                                             functionCompilerMetadata.OutputAuthoredSourceFolder));
        }