Commit Graph

100 Commits

Author SHA1 Message Date
Jim Schubert
a96ab1cf9d
[core] GeneratorSettings, WorkflowSettings, and cleanup in CodegenConfigurator (#2946)
* Introduce GeneratorSettings + cleanup

GeneratorSettings is an immutable settings object, intended to limit the
manipulation of generator settings.

To move to GeneratorSettings, lots of modification was done to
CodegenConfigurator. The goal  here is that CodegenConfigurator
would create the contextual information required to initiate a
generator run:

* GeneratorSettings
* Workflow related settings
* Configuring "system" GeneratorProperties (ThreadLocal properties)
* Deserializing from file to config object
* Input spec document (OpenAPI, intending to target others)

ClientOpts was generally unused, and the few places it was being used
have been updated to pass the properties to
codegen.additionalProperties.

* Add sanity to system properties

The -D argument for the generate command is an application argument
which is easily confused for Java System Properties. This isn't the
case, as setting values here doesn't update the configuration in
System.getProperties().

This adds a warning and deprecation to that option, as defining these
values as system properties will also continue to work as expected. This
makes the -D application argument redundant and confusing.

* Contextualize generator/workflow settings

This splits settings relevant to generator configuration (the what) and
workflow configuration (the how) in an attempt to make configuration
easier to conceptualize.

* Update Gradle task w/ CodegenConfigurator setters

* Remove -D usage in scripts

* Add -p option for additional properties

* Regnerate samples
2019-06-07 13:07:52 -04:00
William Cheng
7e457f7e41 sync master 2019-06-03 00:32:13 +08:00
William Cheng
8d3a1a5add Merge remote-tracking branch 'origin/master' into 4.1.x 2019-06-03 00:06:43 +08:00
Jim Schubert
f667effa76
[gradle plugin] Release 4.0.1 fixes (#3051)
Fixes issues found during the 4.0.1 release
2019-06-01 23:36:17 -04:00
Jérémie Bresson
dc81574f2b Update version to 4.0.2-SNAPSHOT (#3047)
* Update version to 4.0.2-SNAPSHOT

* Update samples

* Change AppVeyor script (test of gradle sample)

* Fix release version bump script (gradle plugin, sample poms)

* Include sonatype snapshots in maven examples which reference 4.0.2-SNAPSHOT
2019-06-01 21:32:44 -04:00
William Cheng
39648ee3a7
Prepare 4.0.1 release (#3041)
* update snapshot version

* update to 4.0.1
2019-05-31 23:42:55 +08:00
Jim Schubert
6a1fc51069 [gradle] Reworking publishing pipeline (#2886)
* [gradle] Reworking publishing pipeline

TravisCI proxies separate external requests with different orginating IP
addresses, while Sonatype associates artifacts for auto-generated
repositories by IP address. This leads to many gradle deploys from CI
resulting in "split" staging repositories with no way to combine in
Sonatype Nexus.

This introduces a workflow which should resolve this issue on the next
revision release. Specifically, nexus-publish-plugin is included to
create singular staging repositories from TravisCI and
gradle-nexus-staging-plugin is included to auto-release and promote
this repository.

NOTE:
We need to publish via publishPluginMavenPublicationToNexusRepository,
because publishToNexus will publish _all_ publish-related tasks,
including the one intended only for the Gradle Plugin Portal.

Tested in standalone open source Nexus Repo Manager, which doesn't
support the staging plugin. So, only SNAPSHOT workflow has been
validated locally.

* Change the 'publish' task to 'publishToMavenLocal' in the helper pom.xml

* Add condition on signing and be explicit about sources/javadoc artifacts

* Call close/closeAndReleaseRepository

* Reuse same closeAndReleaseRepository for SNAPSHOT + releases using a task guard, and publish to Gradle Plugin portal only on tagged build.

* Add v prefix for tag check.
2019-05-31 20:43:21 +08:00
Jeremie Bresson
98348a9ee6 Merge remote-tracking branch 'origin/master' into HEAD 2019-05-20 13:06:34 +02:00
Jeremie Bresson
8b34bc1f97 Set openApiGeneratorVersion to 4.0.1-SNAPSHOT (#2882) 2019-05-20 12:22:32 +02:00
William Cheng
f5de532c5e update to 4.1.0-SNAPSHOT 2019-05-14 22:43:10 +08:00
William Cheng
cbe39ba881 Set version to 4.0.1-SNAPSHOT (#2882) 2019-05-14 10:28:32 +02:00
William Cheng
3744273312
4.0.0 release (#2878)
* remove snapshot version

* update readme

* undo changes to example

* revert apache maven version

* update gradle property
2019-05-13 20:56:47 +08:00
Jim Schubert
e34e85427b
[gradle] Display non-Stable generator stability in parens on openApiGenerators task (#2826) 2019-05-06 08:35:34 -04:00
Jim Schubert
5ea4391af5 [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.
2019-05-01 00:46:48 +08:00
William Cheng
5fbb812d65
Test Gradle plugin in Appveyor CI (#2651)
* update travis to test gradle plugin

* update gradle version

* show gradle version

* test gradle plugin in circleci

* test appveyor in gradle

* use direct link

* revert other ci config
2019-04-13 00:36:52 +08:00
Thibault Duperron
ff9401fee5 Fix SkipValidSpec (#2583)
For #2319
2019-04-05 21:40:10 -04:00
Vincent Devos
117efe83c0 [Doc] Better highlight of generators docs page with generators specific parameters (#2592)
* [Doc] Better highlight of generators docs page with generators specific parameters

* [Doc] Better highlight of generators docs page with generators specific parameters
2019-04-05 06:38:33 +08:00
William Cheng
23476fb66a
Revert "update version (#2591)" (#2597)
This reverts commit b3146c9983.
2019-04-05 00:26:30 +08:00
William Cheng
b3146c9983
update version (#2591) 2019-04-04 20:50:50 +08:00
Jim Schubert
93baa5d835 Initial attempt at deploying to gradle plugin portal (#2440) 2019-03-19 21:43:28 +08:00
Kevin Howell
329843bc92 Gradle - make GenerateTask properties optional (#2185)
This allows easier creation of custom `GenerateTask`. Specifically, this makes:

 - generateModelTests
 - generateModelDocumentation
 - generateApiTests
 - generateApiDocumentation
 - withXml

optional, following the same pattern as other properties in GenerateTask.

Without this change, we get `java.lang.IllegalStateException: No value
has been specified for this provider.` until these properties are
specified for the task, when attempting to define a custom generate task
(such as one to generate API docs).
2019-02-21 18:18:47 -05:00
Jeremie Bresson
16f52cf2ad Set version to 4.0.0-SNAPSHOT
This reverts commit 6a414af13f.
2019-02-01 00:03:51 +01:00
Jérémie Bresson
6a414af13f
4.0.0-beta2 release (#2036) 2019-02-01 00:00:22 +01:00
Jim Schubert
4fa926604f [gradle] Add 4 boolean properties supported by codegenConfigurator (#1881)
* [gradle] Add 4 boolean properties supported by codegenConfigurator

* [gradle] Add Windows workaround for Android Studio

After release 3.0.0, a guava dependency was updated and this exposed an
issue in Windows where Guava's CharMatcher.ASCII is called to validate a
path. The version of Guava referenced by OpenAPI Generator causes a
'NoSuchField' error because the referenced dependency names this static
field CharMatcher.Ascii.

This error is not surfaced on macOS, and appears to be Windows-specific.

This adds a potential workaround to the Gradle plugin's readme.

See #1818 for more details.
2019-01-11 19:14:05 +08:00
Jim Schubert
8fd474d4a7 [gradle-plugin] Fix test, ensure tests run in CI (#1789)
* Update GenerateTaskDslTest to remove "Pets" array model which is no longer generated
* Ensure check on uploadArchives task
2019-01-02 17:15:01 +08:00
gndrm
98ae7a816c Introduced GeneratorProperties as a thread-safe clone of System Properties (#1598)
* Introduced GeneratorProperties as a thread-safe clone of System Properties

* Removed unnecessary SmartBear copyright
2018-12-19 21:46:05 +08:00
William Cheng
dfa7e616c0 Merge remote-tracking branch 'origin/master' into 4.0.x 2018-12-01 19:18:27 +08:00
William Cheng
2f4dc9a049
Prepare 3.3.4 release (#1583)
* update release version

* update doc for 3.3.4 release

* comment out stack installation due to error in travis
2018-12-01 01:00:06 +08:00
PLACE
334415dec2 Typescript fetch fork (#569)
* added my fork from https://github.com/Place1/swagger-codegen-typescript-browser

* ran bin/typescript-fetch-petstore-all.sh

* use FormData.append rather than .set for IE11 compat

* reverted change to licenseInfo.mustache

* reverted some comments

* added package.json and tsconfig.json back to the generator

* added support for blob (application/octet-stream) responses

* models and apis are now in folders

* added support for modelPropertyNaming based on the spec

* bug fix

* updated samples

* Restore pom.xml for typescript project

* Restore samples/client/petstore/typescript-fetch/tests/default/package.json
≈

* added support for response type Date conversion

* updated samples

* Rework pom in "samples.ci"

* Restore "samples/client/petstore/typescript-fetch/tests/default"

* updated configuration class to use property getters to allow clients to implement configuration values as getters

* added {{datatype}}ToJSON functions to handle serialization and naming conversions

* fixed missing import

* fixed compilation error. updated samples

* 1 character change to get CI to run again

* updated samples

* added support for array type request body

* updated tests

* support for optional request bodies

* updated models json converters to handle undefined inputs (to simplify usage in optional contexts like optional request bodies)

* updated samples

* updated tests

* changed to typescript version 2.4

* updated samples

* support for optional properties being null, undefined or omitted

* updated samples

* bug fix

* bug fix

* updated samples

* ran npm install in test project

* patch to get tests running

* added support for retrieving raw response. added support for binary request bodies. added support for blob data type for files/binary.
2018-11-18 13:24:24 +08:00
William Cheng
2bcf5b2263 Merge remote-tracking branch 'origin/3.4.x' into 4.0.x 2018-11-15 17:49:44 +08:00
William Cheng
a87a544bf5 Merge remote-tracking branch 'origin/master' into 3.4.x 2018-11-15 17:11:01 +08:00
William Cheng
8d9542207a
Prepare 3.3.4 snapshot (#1450)
* change version to 3.3.4-snapshot

* updat readme

* update samples
2018-11-15 16:21:15 +08:00
William Cheng
7564d629e7
prepare 3.3.3 release (#1447) 2018-11-14 23:56:58 +08:00
William Cheng
e6c97a1bc1 Merge remote-tracking branch 'origin/3.4.x' into 4.0.x 2018-11-08 18:18:12 +08:00
William Cheng
a186efed35 Merge remote-tracking branch 'origin/master' into 3.4.x 2018-11-08 18:17:29 +08:00
Vasili Puchko
ac6fd3f79f Update gradle plugin's Readme.md (#1356)
Add a note about use of `systemProperties` since some options are confusing and hard to guess how to use correctly. The only source I was able to find how to configure it in the way I need was a comment to issue https://github.com/OpenAPITools/openapi-generator/issues/551#issuecomment-411686091
2018-11-03 21:58:43 +08:00
William Cheng
02e85cc417
Prepare v3.3.3-SNAPSHOT (#1355)
* prepare 3.3.3-snapshot

* update petstore samples
2018-11-01 10:42:26 +08:00
William Cheng
0cc9b69b6f
3.3.2 release (#1353)
* prepare 3.3.2 release

* update script to remove outdated reference
2018-10-31 20:48:14 +08:00
William Cheng
a3dc5ecc20 Merge remote-tracking branch 'origin/master' into 3.4.x 2018-10-17 00:05:47 +08:00
William Cheng
83c55ec016 Merge remote-tracking branch 'origin/3.3.x' into 4.0.x 2018-10-16 23:42:29 +08:00
William Cheng
ebc2700a92
update gradle download link (#1254) 2018-10-16 23:04:50 +08:00
William Cheng
9e3c7781bb Merge remote-tracking branch 'origin/3.4.x' into 4.0.x 2018-10-16 16:08:11 +08:00
William Cheng
257a97b6cd update petstore samples 2018-10-16 13:19:40 +08:00
William Cheng
ffd72767af
Prepare 3.3.2 snapshot version (#1249)
* release_version_update

* update readme

* restore felix version

* update petstore samples
2018-10-16 10:53:12 +08:00
William Cheng
0136aeefbc
Prepare 3.3.1 patch release (#1247)
* release_version_update

* comment out ensure up to date

* release_version_update_docs

* update release table
2018-10-15 23:18:24 +08:00
Dec12 | Fujigon
12a702ee07 fix gradle build error on java9+ (#1240) 2018-10-15 11:09:38 +08:00
William Cheng
56c4751e74
Add JDK 9 support (#1188)
* update jmockit version

* list jvm

* test jdk9 in appveyor

* use latest version of gradle

* update to jdk9

* use openjdk9

* use default java version in appveyor

* use jdk8 docker image

* consolidate bash, ios pom into parent pom

* consolidate circlecii pom into parent pom

* remove circleci pom.xml
2018-10-09 10:25:28 +08:00
William Cheng
0f7557ca9d update version 2018-10-03 18:29:29 +08:00
William Cheng
4e8844273b
Prepare 3.3.1-SNAPSHOT (#1154)
* update version

* update petstore samples
2018-10-02 09:40:27 +08:00
William Cheng
e22c7c1c8a
3.3.0 release (#1153)
* update using release_version_update

* comment out ensure up to date script

* update using release_version_update_docs

* remove current master
2018-10-01 23:56:52 +08:00