|
|
|
@ -1,26 +1,28 @@
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
using System.IO;
|
|
|
|
using System.IO;
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
using System.CodeDom;
|
|
|
|
using System.CodeDom;
|
|
|
|
using System.CodeDom.Compiler;
|
|
|
|
using System.CodeDom.Compiler;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
|
|
using Microsoft.CodeAnalysis;
|
|
|
|
using Microsoft.CodeAnalysis;
|
|
|
|
using Microsoft.CodeAnalysis.CSharp;
|
|
|
|
using Microsoft.CodeAnalysis.CSharp;
|
|
|
|
using Microsoft.CodeAnalysis.Emit;
|
|
|
|
using Microsoft.CodeAnalysis.Emit;
|
|
|
|
|
|
|
|
|
|
|
|
using Microsoft.AspNet.Razor;
|
|
|
|
using Microsoft.AspNet.Razor;
|
|
|
|
using Microsoft.AspNet.Razor.Generator;
|
|
|
|
using Microsoft.AspNet.Razor.Generator;
|
|
|
|
using Microsoft.Extensions.Localization;
|
|
|
|
using Microsoft.Extensions.Localization;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using Microsoft.CSharp;
|
|
|
|
using Microsoft.CSharp;
|
|
|
|
|
|
|
|
using Microsoft.AspNet.Identity.EntityFramework;
|
|
|
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
|
|
|
|
using Yavsc.Models;
|
|
|
|
using Yavsc.Models;
|
|
|
|
using Yavsc.Models.Identity;
|
|
|
|
using Yavsc.Models.Identity;
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
|
|
using Yavsc.Templates;
|
|
|
|
using Yavsc.Templates;
|
|
|
|
using Yavsc.Abstract.Templates;
|
|
|
|
using Yavsc.Abstract.Templates;
|
|
|
|
using Microsoft.AspNet.Identity.EntityFramework;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace cli.Services
|
|
|
|
namespace cli.Services
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -102,7 +104,6 @@ namespace cli.Services
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var compilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)
|
|
|
|
var compilationOptions = new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)
|
|
|
|
.WithModuleName("Yavsc.Absctract").WithModuleName("Yavsc")
|
|
|
|
|
|
|
|
.WithAllowUnsafe(true).WithOptimizationLevel(OptimizationLevel.Release)
|
|
|
|
.WithAllowUnsafe(true).WithOptimizationLevel(OptimizationLevel.Release)
|
|
|
|
.WithOutputKind(OutputKind.DynamicallyLinkedLibrary).WithPlatform(Platform.AnyCpu);
|
|
|
|
.WithOutputKind(OutputKind.DynamicallyLinkedLibrary).WithPlatform(Platform.AnyCpu);
|
|
|
|
|
|
|
|
|
|
|
|
@ -113,9 +114,6 @@ namespace cli.Services
|
|
|
|
options: compilationOptions);
|
|
|
|
options: compilationOptions);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var mref in references) logger.LogInformation($"ctor used ref to {mref.Display}[{mref.Properties.Kind}]");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using (var ms = new MemoryStream())
|
|
|
|
using (var ms = new MemoryStream())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
EmitResult result = compilation.Emit(ms);
|
|
|
|
EmitResult result = compilation.Emit(ms);
|
|
|
|
@ -152,7 +150,6 @@ namespace cli.Services
|
|
|
|
generatedtemplate.User = user;
|
|
|
|
generatedtemplate.User = user;
|
|
|
|
generatedtemplate.ExecuteAsync();
|
|
|
|
generatedtemplate.ExecuteAsync();
|
|
|
|
logger.LogInformation(generatedtemplate.GeneratedText);
|
|
|
|
logger.LogInformation(generatedtemplate.GeneratedText);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* ... type.InvokeMember("Write",
|
|
|
|
/* ... type.InvokeMember("Write",
|
|
|
|
|