Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit 3a901a6

Browse files
authored
Update gradle plugin (#2)
* update gradle plugin * update circleci config
1 parent 59f478f commit 3a901a6

File tree

13 files changed

+52
-260
lines changed

13 files changed

+52
-260
lines changed

.circleci/config.yml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ commands: # a reusable command with parameters
7171
- ~/.cache/bower
7272
- ".git"
7373
- ~/.stack
74-
- /home/circleci/OpenAPITools/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work
7574
- ~/R
7675
# save "default" cache using the key "source-v2-"
7776
- save_cache:
@@ -92,7 +91,7 @@ commands: # a reusable command with parameters
9291
- ~/.cache/bower
9392
- ".git"
9493
- ~/.stack
95-
- /home/circleci/OpenAPITools/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work
94+
- /home/circleci/OpenAPITools/openapi-json-schema-generator/samples/client/petstore/haskell-http-client/.stack-work
9695
- ~/R
9796
# Teardown
9897
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
@@ -142,66 +141,56 @@ jobs:
142141
node0:
143142
machine:
144143
image: ubuntu-2004:202201-02
145-
working_directory: ~/OpenAPITools/openapi-generator
144+
working_directory: ~/OpenAPITools/openapi-json-schema-generator
146145
shell: /bin/bash --login
147146
environment:
148147
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
149148
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
150-
DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator
151-
DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli
152149
steps:
153150
- command_build_and_test:
154151
nodeNo: "0"
155152
node1:
156153
machine:
157154
image: ubuntu-2004:202201-02
158-
working_directory: ~/OpenAPITools/openapi-generator
155+
working_directory: ~/OpenAPITools/openapi-json-schema-generator
159156
shell: /bin/bash --login
160157
environment:
161158
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
162159
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
163-
DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator
164-
DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli
165160
steps:
166161
- command_build_and_test:
167162
nodeNo: "1"
168163
node2:
169164
machine:
170165
image: ubuntu-2004:202201-02
171-
working_directory: ~/OpenAPITools/openapi-generator
166+
working_directory: ~/OpenAPITools/openapi-json-schema-generator
172167
shell: /bin/bash --login
173168
environment:
174169
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
175170
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
176-
DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator
177-
DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli
178171
steps:
179172
- command_build_and_test:
180173
nodeNo: "2"
181174
node3:
182175
machine:
183176
image: ubuntu-2004:202201-02
184-
working_directory: ~/OpenAPITools/openapi-generator
177+
working_directory: ~/OpenAPITools/openapi-json-schema-generator
185178
shell: /bin/bash --login
186179
environment:
187180
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
188181
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
189-
DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator
190-
DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli
191182
steps:
192183
- checkout
193184
- command_build_and_test:
194185
nodeNo: "3"
195186
node4:
196187
docker:
197188
- image: fkrull/multi-python
198-
working_directory: ~/OpenAPITools/openapi-generator
189+
working_directory: ~/OpenAPITools/openapi-json-schema-generator
199190
shell: /bin/bash --login
200191
environment:
201192
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
202193
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
203-
DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator
204-
DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli
205194
steps:
206195
- checkout
207196
- command_docker_build_and_test:

CI/circle_parallel.sh

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,11 @@ function cleanup {
1919
trap cleanup EXIT
2020

2121
if [ "$NODE_INDEX" = "1" ]; then
22-
echo "Running node $NODE_INDEX to test 'samples.circleci' defined in pom.xml ..."
23-
java -version
24-
25-
mvn --no-snapshot-updates --quiet verify -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error
22+
echo "Running node $NODE_INDEX"
2623

2724
elif [ "$NODE_INDEX" = "2" ]; then
28-
echo "Running node $NODE_INDEX to test Go"
29-
# install haskell
30-
#curl -sSLk https://get.haskellstack.org/ | sh
31-
#stack upgrade
32-
#stack --version
33-
34-
# install curl
35-
#sudo apt-get -y build-dep libcurl4-gnutls-dev
36-
#sudo apt-get -y install libcurl4-gnutls-dev
37-
38-
# Install golang version 1.14
39-
go version
40-
sudo mkdir /usr/local/go1.14
41-
wget -c https://dl.google.com/go/go1.14.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local/go1.14
42-
export PATH="/usr/local/go1.14/go/bin:$PATH"
43-
go version
44-
45-
# run integration tests
46-
mvn --no-snapshot-updates --quiet verify -Psamples.misc -Dorg.slf4j.simpleLogger.defaultLogLevel=error
25+
echo "Running node $NODE_INDEX"
26+
4727
elif [ "$NODE_INDEX" = "3" ]; then
4828

4929
echo "Running node $NODE_INDEX to test 'samples.circleci.node3' defined in pom.xml ..."
@@ -83,11 +63,8 @@ elif [ "$NODE_INDEX" = "4" ]; then
8363
(cd samples/openapi3/client/3_0_3_unit_test/python && make test)
8464

8565
else
86-
echo "Running node $NODE_INDEX to test 'samples.circleci.others' defined in pom.xml ..."
87-
java -version
66+
echo "Running node $NODE_INDEX"
8867

89-
mvn --no-snapshot-updates --quiet verify -Psamples.circleci.others -Dorg.slf4j.simpleLogger.defaultLogLevel=error
90-
mvn --no-snapshot-updates --quiet javadoc:javadoc -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error
9168
fi
9269

9370

modules/openapi-json-schema-generator-gradle-plugin/README.adoc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ task validateGoodSpec(type: org.openapitools.generator.gradle.plugin.tasks.Valid
9797
[source,group]
9898
----
9999
plugins {
100-
id "org.openapi.generator" version "6.1.0"
100+
id "org.openapi.json-schema-generator" version "1.0.0"
101101
}
102102
----
103103

@@ -113,11 +113,11 @@ buildscript {
113113
// url "https://plugins.gradle.org/m2/"
114114
}
115115
dependencies {
116-
classpath "org.openapitools:openapi-generator-gradle-plugin:6.1.0"
116+
classpath "org.openapitools:openapi-json-schema-generator-gradle-plugin:6.1.0"
117117
}
118118
}
119119
120-
apply plugin: 'org.openapi.generator'
120+
apply plugin: 'org.openapi.json-schema-generator'
121121
----
122122
//# /RELEASE_VERSION
123123

@@ -272,7 +272,7 @@ apply plugin: 'org.openapi.generator'
272272
|gitRepoId
273273
|String
274274
|None
275-
|Git repo ID, e.g. openapi-generator.
275+
|Git repo ID, e.g. openapi-json-schema-generator.
276276

277277
|releaseNote
278278
|String
@@ -347,7 +347,7 @@ apply plugin: 'org.openapi.generator'
347347
|configOptions
348348
|Map(String,String)
349349
|None
350-
|A map of options specific to a generator. To see the full list of generator-specified parameters, please refer to [generators docs](https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators.md). Note that any config options from a generator specific document may go here, and some generators may duplicate other options which are siblings to `configOptions`.
350+
|A map of options specific to a generator. To see the full list of generator-specified parameters, please refer to [generators docs](https://github.com/OpenAPITools/openapi-json-schema-generator/blob/master/docs/generators.md). Note that any config options from a generator specific document may go here, and some generators may duplicate other options which are siblings to `configOptions`.
351351

352352
|logToStderr
353353
|Boolean
@@ -565,18 +565,18 @@ BUILD SUCCESSFUL in 0s
565565
[source,groovy]
566566
----
567567
openApiValidate {
568-
inputSpec = "/src/openapi-generator/modules/openapi-generator/src/test/resources/3_0/petstore.yaml"
568+
inputSpec = "/src/openapi-json-schema-generator/modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml"
569569
recommend = true
570570
}
571571
----
572572

573573
.Example output of openApiValidate task (success)
574574
[source,terminal]
575575
----
576-
$ ./gradlew openApiValidate --input=/Users/jim/projects/openapi-generator/modules/openapi-generator/src/test/resources/3_0/ping.yaml
576+
$ ./gradlew openApiValidate --input=/Users/jim/projects/openapi-json-schema-generator/modules/openapi-json-schema-generator/src/test/resources/3_0/ping.yaml
577577
578578
> Task :openApiValidate
579-
Validating spec /Users/jim/projects/openapi-generator/modules/openapi-generator/src/test/resources/3_0/ping.yaml
579+
Validating spec /Users/jim/projects/openapi-json-schema-generator/modules/openapi-json-schema-generator/src/test/resources/3_0/ping.yaml
580580
Spec is valid.
581581
582582
BUILD SUCCESSFUL in 0s
@@ -589,7 +589,7 @@ BUILD SUCCESSFUL in 0s
589589
$ ./gradlew openApiValidate
590590
591591
> Task :openApiValidate FAILED
592-
Validating spec /Users/jim/projects/openapi-generator/modules/openapi-generator/src/test/resources/3_0/petstore.yaml
592+
Validating spec /Users/jim/projects/openapi-json-schema-generator/modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml
593593
594594
Spec is invalid.
595595
Issues:
@@ -613,13 +613,13 @@ Run with --stacktrace option to get the stack trace. Run with --info or --debug
613613
.in terminal (alternate)
614614
[source,terminal]
615615
----
616-
$ ./gradlew openApiValidate --input=/Users/jim/projects/openapi-generator/modules/openapi-generator/src/test/resources/3_0/petstore.yaml
616+
$ ./gradlew openApiValidate --input=/Users/jim/projects/openapi-json-schema-generator/modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml
617617
----
618618

619619
=== Generate multiple sources
620620

621621
If you want to perform multiple generation tasks, you'd want to create a task that inherits from the `GenerateTask`.
622-
Examples can be found in https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle[samples/local-spec/build.gradle].
622+
Examples can be found in https://github.com/OpenAPITools/openapi-json-schema-generator/blob/master/modules/openapi-json-schema-generator-gradle-plugin/samples/local-spec/build.gradle[samples/local-spec/build.gradle].
623623

624624
You can define any number of generator tasks; the generated code does _not_ need to be a JVM language.
625625

@@ -682,7 +682,7 @@ You can run `gradle tasks --debug` to see this registration.
682682

683683
=== Android Studio
684684

685-
Android Studio may experience a Windows-specific Guava dependency conflict with openapi-generator-gradle-plugin versions greater than 3.0.0.
685+
Android Studio may experience a Windows-specific Guava dependency conflict with openapi-json-schema-generator-gradle-plugin versions greater than 3.0.0.
686686

687687
As a workaround, you may force exclude conflicting Guava dependencies.
688688

@@ -695,7 +695,7 @@ buildscript {
695695
}
696696
dependencies {
697697
classpath 'com.android.tools.build:gradle:3.2.1'
698-
classpath('org.openapitools:openapi-generator-gradle-plugin:6.1.0') {
698+
classpath('org.openapitools:openapi-json-schema-generator-gradle-plugin:1.0.0') {
699699
exclude group: 'com.google.guava'
700700
}
701701
}
@@ -706,7 +706,7 @@ configurations {
706706
compile.exclude module: 'guava-jdk5'
707707
}
708708
// …
709-
apply plugin: 'org.openapi.generator'
709+
apply plugin: 'org.openapi.json-schema-generator'
710710
```
711711
//# /RELEASE_VERSION
712712

modules/openapi-json-schema-generator-gradle-plugin/build.gradle

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ repositories {
5959
dependencies {
6060
compile gradleApi()
6161
// Shared OpenAPI Generator version be passed via command line arg as -PopenApiGeneratorVersion=VERSION
62-
compile "org.openapitools:openapi-generator:$openApiGeneratorVersion"
62+
compile "org.openapitools:openapi-json-schema-generator:$openApiGeneratorVersion"
6363
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
6464

6565
testCompile 'org.testng:testng:6.9.6',
@@ -109,9 +109,9 @@ publishing {
109109
artifact sourcesJar
110110
artifact javadocJar
111111
pom {
112-
name = 'OpenAPI-Generator Contributors'
112+
name = 'openapi-json-schema-generator Contributors'
113113
description = project.description
114-
url = 'https://openapi-generator.tech'
114+
url = 'https://github.com/OpenAPITools/openapi-json-schema-generator'
115115
organization {
116116
name = 'org.openapitools'
117117
url = 'https://github.com/OpenAPITools'
@@ -126,18 +126,18 @@ publishing {
126126
developers {
127127
developer {
128128
id = "openapitools"
129-
name = "OpenAPI-Generator Contributors"
129+
name = "openapi-json-schema-generator Contributors"
130130
email = "team@openapitools.org"
131131
}
132132
}
133133
scm {
134-
url = 'https://github.com/OpenAPITools/openapi-generator'
135-
connection = 'scm:git:git://github.com/OpenAPITools/openapi-generator.git'
136-
developerConnection = 'scm:git:ssh://git@github.com:OpenAPITools/openapi-generator.git'
134+
url = 'https://github.com/OpenAPITools/openapi-json-schema-generator'
135+
connection = 'scm:git:git://github.com/OpenAPITools/openapi-json-schema-generator.git'
136+
developerConnection = 'scm:git:ssh://git@github.com:OpenAPITools/openapi-json-schema-generator.git'
137137
}
138138
issueManagement {
139139
system = 'GitHub'
140-
url = 'https://github.com/OpenAPITools/openapi-generator/issues'
140+
url = 'https://github.com/OpenAPITools/openapi-json-schema-generator/issues'
141141
}
142142
}
143143
}
@@ -157,23 +157,23 @@ nexusPublishing {
157157
gradlePlugin {
158158
plugins {
159159
openApiGenerator {
160-
id = 'org.openapi.generator'
160+
id = 'org.openapi.json-schema-generator'
161161
implementationClass = 'org.openapitools.generator.gradle.plugin.OpenApiGeneratorPlugin'
162162
}
163163
}
164164
}
165165

166166
pluginBundle {
167167
// These settings are set for the whole plugin bundle
168-
website = 'https://openapi-generator.tech/'
169-
vcsUrl = 'https://github.com/OpenAPITools/openapi-generator'
168+
website = 'https://github.com/OpenAPITools/openapi-json-schema-generator'
169+
vcsUrl = 'https://github.com/OpenAPITools/openapi-json-schema-generator'
170170
description = 'OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)'
171171

172172
plugins {
173173
// first plugin
174174
openApiGenerator {
175-
id = 'org.openapi.generator'
176-
displayName = 'OpenAPI Generator Gradle Plugin'
175+
id = 'org.openapi.json-schema-generator'
176+
displayName = 'OpenAPI Json Sshema Generator Gradle Plugin'
177177
tags = ['openapi-3.0', 'openapi-2.0', 'openapi', 'swagger', 'codegen', 'sdk']
178178
version = "$openApiGeneratorVersion"
179179
group = "org.openapitools"

modules/openapi-json-schema-generator-gradle-plugin/samples/local-spec/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This example assumes you have Gradle 6.8.3+ installed. No gradle wrapper is provided in samples.
44

5-
First, publish the openapi-generator-gradle-plugin locally via `./gradlew assemble publishToMavenLocal` in the module directory.
5+
First, publish the openapi-json-schema-generator-gradle-plugin locally via `./gradlew assemble publishToMavenLocal` in the module directory.
66

77
Then, run the following tasks in this example directory.
88

modules/openapi-json-schema-generator-gradle-plugin/samples/local-spec/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ buildscript {
1414
}
1515
dependencies {
1616
// Updated version can be passed via command line arg as -PopenApiGeneratorVersion=VERSION
17-
classpath "org.openapitools:openapi-generator-gradle-plugin:$openApiGeneratorVersion"
17+
classpath "org.openapitools:openapi-json-schema-generator-gradle-plugin:$openApiGeneratorVersion"
1818
}
1919
}
2020

21-
apply plugin: 'org.openapi.generator'
21+
apply plugin: 'org.openapi.json-schema-generator'
2222

2323
openApiMeta {
2424
generatorName = "Sample"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
rootProject.name = 'openapi-generator-gradle-plugin'
1+
rootProject.name = 'openapi-json-schema-generator-gradle-plugin'
22
enableFeaturePreview('STABLE_PUBLISHING')
33

modules/openapi-json-schema-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
191191
val gitUserId = project.objects.property<String?>()
192192

193193
/**
194-
* Git repo ID, e.g. openapi-generator.
194+
* Git repo ID, e.g. openapi-json-schema-generator.
195195
*/
196196
val gitRepoId = project.objects.property<String?>()
197197

0 commit comments

Comments
 (0)