from googleapis.codegen.targets import Targets FLAGS = flags.FLAGS flags.DEFINE_string('api_name', None, 'API to generate for. E.g. "plus".') flags.DEFINE_string('api_version', None, 'version of "api_name" to generate for. E.g. "v1".') flags.DEFINE_string('discovery_server', 'www.googleapis.com', 'The discovery server to use for loading "api_name"') flags.DEFINE_string('discovery_version', 'v1', 'The discovery version to use for loading "api_name"') flags.DEFINE_boolean('include_timestamp', False, 'Adds a timestamp to the generated source files.') flags.DEFINE_string('input', None, 'A discovery document captured from a discovery service.') flags.DEFINE_enum('language', 'java', generator_lookup.SupportedLanguages(), 'Target language for the generated library') flags.DEFINE_string( 'language_variant', 'default', 'which variant of "language" to generate for. E.g. "stable" vs. "head".') flags.DEFINE_string( 'monolithic_source_name', None, ('If non-empty then combine all the sources to the single file' ' <monolithic_source_name>.{extension} and all the headers to a single' ' include file. Otherwise use the standard output file naming and produce' ' a source file for the overall API and one for each schema. This option' ' is only supported for C++ and Objective-C.')) flags.DEFINE_string( 'output_dir', None, 'A path to a directory where the generated files will be created.') flags.DEFINE_string(
def testSupportedLanguage(self): languages = generator_lookup.SupportedLanguages() self.assertContainsSubset(['dart', 'gwt', 'java', 'php'], languages) self.assertNotIn('java-head', languages)
import gflags as flags from googleapis.codegen import generator from googleapis.codegen import generator_lookup from googleapis.codegen import language_model from googleapis.codegen.api import Api from googleapis.codegen.filesys import package_writer_foundry from googleapis.codegen.targets import Targets FLAGS = flags.FLAGS flags.DEFINE_string('discovery', None, 'A discovery document captured from a discovery service.') flags.DEFINE_boolean('include_timestamp', False, 'Adds a timestamp to the generated source files.') flags.DEFINE_enum('language', 'any', ['any'] + generator_lookup.SupportedLanguages(), 'Target language for the generated code') flags.DEFINE_string( 'language_variant', 'default', 'which variant of "language" to generate for. E.g. "stable" vs. "head".') flags.DEFINE_string( 'output_dir', None, 'A path to a directory where the generated files will be created.') flags.DEFINE_string( 'output_file', None, 'An output file path to contain the archive for the generated library.' ' The contents of the file are determined by the output_format parameter') flags.DEFINE_enum('output_format', 'zip', ['zip', 'tgz', 'tar'], 'What format to use for --output_file.') flags.DEFINE_enum( 'output_type', 'plain', ['plain', 'full'], 'What kind of output to make.'