From 5ea4391af541aebcf40246e7b2565b5b6cabb629 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Tue, 30 Apr 2019 12:46:48 -0400 Subject: [PATCH] [cli][gradle] Adds package name as a global option (#2557) * [cli] Support packageName as global option CLI supports other package-related options (--api-package, --model-package, --invoker-package). This aligns those options with --package-name to avoid confusion about how to configure these options where those are supported. This intentionally does not apply a packageName getter/setter to DefaultCodegen to reduce the footprint of this change. * [gradle] Add packagName as global option This makes packageName available as a global option, beside apiPackage, modelPackage, and invokerPackage to reduce potential confusion about how to configure the four of these options by generators which support them. --- README.md | 5 +++-- docs/usage.md | 10 ++++++---- .../java/org/openapitools/codegen/cmd/Generate.java | 9 +++++++++ .../org/openapitools/codegen/cmd/GenerateTest.java | 13 +++++++++++++ modules/openapi-generator-gradle-plugin/README.adoc | 5 +++++ .../gradle/plugin/OpenApiGeneratorPlugin.kt | 1 + .../extensions/OpenApiGeneratorGenerateExtension.kt | 5 +++++ .../generator/gradle/plugin/tasks/GenerateTask.kt | 10 ++++++++++ .../org/openapitools/codegen/CodegenConstants.java | 2 ++ 9 files changed, 54 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index beddcb84e7d..8b42812008d 100644 --- a/README.md +++ b/README.md @@ -438,12 +438,13 @@ SYNOPSIS [--instantiation-types ...] [--invoker-package ] [--language-specific-primitives ...] - [--library ] [--log-to-stderr] + [--library ] [--log-to-stderr] [--minimal-update] [--model-name-prefix ] [--model-name-suffix ] [--model-package ] [(-o | --output )] - [--release-note ] [--remove-operation-id-prefix] + [--package-name ] [--release-note ] + [--remove-operation-id-prefix] [--reserved-words-mappings ...] [(-s | --skip-overwrite)] [--skip-validate-spec] [(-t