@Override protected Map<String, ?> run() throws IOException { Map<String, Object> output = new LinkedHashMap<>(); for (CodeGenerator<?> generator : discoGapicGenerators) { Map<String, ? extends GeneratedResult<?>> out = generator.generate(); for (Map.Entry<String, ? extends GeneratedResult<?>> entry : out.entrySet()) { Object value = (entry.getValue().getBody() instanceof byte[]) ? "Static or binary file content is not shown." : entry.getValue().getBody(); output.put(entry.getKey(), value); } } return output; }
public int run() throws Exception { String discoveryDocPath = options.get(DISCOVERY_DOC); List<String> configFileNames = options.get(GENERATOR_CONFIG_FILES); String packageConfig2File = options.get(PACKAGE_CONFIG2_FILE); String languageStr = options.get(LANGUAGE); List<String> enabledArtifacts = options.get(ENABLED_ARTIFACTS); List<CodeGenerator<?>> generators = getGenerators( discoveryDocPath, configFileNames, packageConfig2File, null, languageStr, enabledArtifacts, artifactType); Map<String, Object> outputFiles = Maps.newHashMap(); for (CodeGenerator<?> generator : generators) { outputFiles.putAll(GeneratedResult.extractBodies(generator.generate())); } writeCodeGenOutput(outputFiles, options.get(OUTPUT_FILE)); return 0; }
ImmutableSet.Builder<String> executables = ImmutableSet.builder(); for (CodeGenerator<?> generator : generators) { Map<String, ? extends GeneratedResult<?>> generatorResult = generator.generate(); for (Map.Entry<String, ? extends GeneratedResult<?>> entry : generatorResult.entrySet()) { outputFiles.put(entry.getKey(), entry.getValue().getBody());
PackageGeneratorFactory.create(language, artifactType, options, model, config); return generator.generate();
Map<String, ? extends GeneratedResult<?>> out = generator.generate();