public int Run() { if (options.ShouldShowHelp) { ShowHelpMessage(); return(0); } if (!ValidateOptions()) { ShowHelpMessage(); return(1); } var bundlePath = GenerateBundle(); var schemaBundle = SchemaBundle.FromJson(File.ReadAllText(bundlePath)); var store = new DetailsStore(schemaBundle); var workerGenerationJob = new WorkerGenerationJob(options.NativeOutputDirectory, options, fileSystem); var singleJob = new SingleGenerationJob(options.NativeOutputDirectory, store, fileSystem); var runner = new JobRunner(fileSystem); runner.Run(singleJob, workerGenerationJob); return(0); }
public int Run() { if (options.ShouldShowHelp) { ShowHelpMessage(); return(0); } if (!ValidateOptions()) { ShowHelpMessage(); return(1); } GenerateNativeTypesAndAst(); var schemaFilesRaw = SchemaFiles.GetSchemaFilesRaw(options.JsonDirectory, fileSystem).ToList(); var schemaProcessor = new UnitySchemaProcessor(schemaFilesRaw); var globalEnumSet = ExtractEnums(schemaProcessor.ProcessedSchemaFiles); foreach (var processedSchema in schemaProcessor.ProcessedSchemaFiles) { var job = new SingleGenerationJob(options.NativeOutputDirectory, processedSchema, fileSystem, globalEnumSet); job.Run(); } return(0); }
public AggregateJob(IFileSystem fileSystem, CodeGeneratorOptions options, UnitySchemaProcessor schemaProcessor, HashSet <string> globalEnumSet) : base(options.NativeOutputDirectory, fileSystem) { InputFiles = new List <string>(); OutputFiles = new List <string>(); foreach (var processedSchema in schemaProcessor.ProcessedSchemaFiles) { var job = new SingleGenerationJob(options.NativeOutputDirectory, processedSchema, fileSystem, globalEnumSet); jobs.Add(job); foreach (var file in job.InputFiles) { InputFiles.Add(file); } foreach (var file in job.OutputFiles) { OutputFiles.Add(file); } } }