зеркало из https://github.com/microsoft/rudder.git
Changes needed to experiment with calling from the Scope compiler.
This commit is contained in:
Родитель
f12725116e
Коммит
0549d5325b
|
@ -1145,7 +1145,7 @@ namespace ScopeProgramAnalysis
|
|||
}
|
||||
|
||||
|
||||
public static ColumDependenciesResult AnalyzeOneProcesorFromDll(string inputPath, string processorTypeName, ScopeMethodKind kind, bool interProc = false, StreamWriter outputStream = null)
|
||||
public static ColumDependenciesResult AnalyzeOneProcesorFromDll(string inputPath, string processorTypeName, string inputSchema, string outputSchema, ScopeMethodKind kind, bool interProc = false, StreamWriter outputStream = null)
|
||||
{
|
||||
// Determine whether to use Interproc analysis
|
||||
AnalysisOptions.DoInterProcAnalysis = interProc;
|
||||
|
@ -1165,14 +1165,14 @@ namespace ScopeProgramAnalysis
|
|||
|
||||
scopeProgramAnalysis.ComputeProcessorFilters(kind);
|
||||
|
||||
//var scopeProcessorsToAnalyze = scopeProgramAnalysis.ObtainScopeMethodsToAnalyzeFromAssemblies(processorTypeName, assembly);
|
||||
var scopeProcessorsToAnalyze = scopeProgramAnalysis.ObtainScopeMethodsToAnalyzeFromAssemblies(processorTypeName, assembly);
|
||||
|
||||
// This is temporary until I get the list of schemas
|
||||
List<Tuple<ITypeDefinition, string>> errorMessages;
|
||||
var scopeProcessorsToAnalyze = scopeProgramAnalysis.ObtainScopeMethodsToAnalyze(assembly,out errorMessages)
|
||||
.Where(spa => spa.ProcessorClass.FullName() == processorTypeName);
|
||||
//var scopeProcessorsToAnalyze = scopeProgramAnalysis.ObtainScopeMethodsToAnalyze(assembly,out errorMessages)
|
||||
// .Where(spa => spa.ProcessorClass.FullName() == processorTypeName);
|
||||
|
||||
var allSchemas = ExtractSchemasFromXML(inputPath, true , scopeProgramAnalysis);
|
||||
//var allSchemas = ExtractSchemasFromXML(inputPath, true , scopeProgramAnalysis);
|
||||
|
||||
if (scopeProcessorsToAnalyze.Count() != 1)
|
||||
{
|
||||
|
@ -1189,13 +1189,13 @@ namespace ScopeProgramAnalysis
|
|||
|
||||
Tuple<Schema, Schema> schemas;
|
||||
|
||||
if (!TryToGetSchema(allSchemas, moveNextMethod, out schemas))
|
||||
{
|
||||
return new ColumDependenciesResult() { Error = true, ErrorMsg = String.Format("Could not get schema for {0} ", inputPath) };
|
||||
}
|
||||
//if (!TryToGetSchema(allSchemas, moveNextMethod, out schemas))
|
||||
//{
|
||||
// return new ColumDependenciesResult() { Error = true, ErrorMsg = String.Format("Could not get schema for {0} ", inputPath) };
|
||||
//}
|
||||
|
||||
scopeProcessorInfo.InputSchema = schemas.Item1;
|
||||
scopeProcessorInfo.OutputSchema = schemas.Item2;
|
||||
scopeProcessorInfo.InputSchema = new Schema(ParseColumns(inputSchema)); // schemas.Item1;
|
||||
scopeProcessorInfo.OutputSchema = new Schema(ParseColumns(outputSchema)); // schemas.Item2;
|
||||
|
||||
scopeProgramAnalysis.InterprocAnalysisManager.SetProcessToAnalyze(scopeProcessorInfo);
|
||||
|
||||
|
|
|
@ -25,15 +25,17 @@ namespace ScopeProgramAnalysis
|
|||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
args = new string[3];
|
||||
args[0] = "scope";
|
||||
args[1] = @"C:\Temp\Scope\JsonSurvey\ProcessorWithJObject\__ScopeCodeGen__.dll";
|
||||
args[2] = @"___Scope_Generated_Classes___.MyReducer";
|
||||
//args = new string[3];
|
||||
//args[0] = "scope";
|
||||
//args[1] = @"C:\Temp\Scope\JsonSurvey\ProcessorWithJObject\__ScopeCodeGen__.dll";
|
||||
//args[2] = @"___Scope_Generated_Classes___.MyReducer";
|
||||
if (args.Length > 0 && args[0] == "scope")
|
||||
{
|
||||
var inputPath = args[1];
|
||||
var processorTypeName = args[2];
|
||||
var columnDependencies = AnalyzeOneProcesorFromDll(inputPath, processorTypeName, ScopeMethodKind.All, true);
|
||||
var inputSchema = args[3];
|
||||
var outputSchema = args[4];
|
||||
var columnDependencies = AnalyzeOneProcesorFromDll(inputPath, processorTypeName, inputSchema, outputSchema, ScopeMethodKind.All, true);
|
||||
AnalysisResultsSerialization.WriteToBinaryFile(Path.ChangeExtension(inputPath, "outdep"), columnDependencies);
|
||||
|
||||
// Just for the verification
|
||||
|
|
Загрузка…
Ссылка в новой задаче