public ClassProxyGenerator_should() { var methodBodyGetter = new MethodBodyGetter("classRef", "jObject"); var methodProxyGenerator = new MethodProxyGenerator(methodBodyGetter); var constructorProxyGenerator = new ConstructorProxyGenerator(methodBodyGetter); classProxyGenerator = new ClassProxyGenerator(methodProxyGenerator, constructorProxyGenerator); }
public void Generate( LibraryDescription description, string assemblyName, string assemblyOutputPath, Action <IEnumerable <string> > sourceLogger = null, Action <string> compiltionLogger = null) { var methodBodyGetter = new MethodBodyGetter("classRef", "jObject"); var methodProxyGenerator = new MethodProxyGenerator(methodBodyGetter); var constructorProxyGenerator = new ConstructorProxyGenerator(methodBodyGetter); var classGenerator = new ClassProxyGenerator(methodProxyGenerator, constructorProxyGenerator); var proxySource = new LibraryProxyGenerator(classGenerator).Generate(description); var trees = CompilationTreesGetter.GetCompilationTreesFrom(proxySource); sourceLogger?.Invoke(trees.Select(el => el .GetRoot() .NormalizeWhitespace() .ToFullString()) ); new Compiller().Compile(trees, assemblyName, assemblyOutputPath, compiltionLogger); }