public void Generate() { IAssemblySource assemblySource = _codeGenerator.ExecutePlugins(_plugins, "/*", "*/", new InitialCodeGenerator()); _logger.Trace("References: " + string.Join(", ", assemblySource.RegisteredReferences)); _sourceLogger.Trace(assemblySource.GeneratedCode); File.WriteAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Generated", assemblyName + ".cs"), assemblySource.GeneratedCode); }
private SimpleAssemblySource GenerateSource() { IAssemblySource generatedSource = _codeGenerator.ExecutePlugins(_plugins, "/*", "*/", null); SimpleAssemblySource assemblySource = new SimpleAssemblySource { GeneratedCode = generatedSource.GeneratedCode, RegisteredReferences = generatedSource.RegisteredReferences }; return(assemblySource); }
public void Generate() { IAssemblySource assemblySource = _codeGenerator.ExecutePlugins(_plugins, "/*", "*/", new InitialCodeGenerator()); CompilerParameters parameters = new CompilerParameters { GenerateExecutable = false, GenerateInMemory = false, OutputAssembly = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Generated", assemblyName + ".dll"), IncludeDebugInformation = true, CompilerOptions = "/optimize" }; _assemblyGenerator.Generate(assemblySource, parameters); }
public void Generate() { IAssemblySource assemblySource = _codeGenerator.ExecutePlugins(_plugins, "/*", "*/", new InitialCodeGenerator()); _logger.Trace("References: " + string.Join(", ", assemblySource.RegisteredReferences)); _sourceLogger.Trace(assemblySource.GeneratedCode); CompilerParameters parameters = new CompilerParameters { GenerateExecutable = false, GenerateInMemory = false, OutputAssembly = GetAssemblyPath(), IncludeDebugInformation = true, CompilerOptions = "" }; Console.WriteLine(GetAssemblyPath()); _assemblyGenerator.Generate(assemblySource, parameters); }
private void GenerateObjectModel() { IAssemblySource assemblySource = _codeGenerator.ExecutePlugins(_pluginRepository, "/*", "*/", null); _log.GetLogger("Domain Object Model references").Trace(() => string.Join(", ", assemblySource.RegisteredReferences)); _log.GetLogger("Domain Object Model source").Trace(assemblySource.GeneratedCode); CompilerParameters parameters = new CompilerParameters { GenerateExecutable = false, GenerateInMemory = string.IsNullOrEmpty(Paths.DomAssemblyName), OutputAssembly = string.IsNullOrEmpty(Paths.DomAssemblyName) ? null : Path.Combine(Paths.BinFolder, Paths.DomAssemblyName + ".dll"), IncludeDebugInformation = true, CompilerOptions = _domGeneratorOptions.Debug ? "" : "/optimize" }; _objectModel = _assemblyGenerator.Generate(assemblySource, parameters); }