From ea0268d03d56106d7804d918167c8e372d542ff7 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 4 Jun 2019 16:17:51 +0800 Subject: [PATCH 1/4] test plugin in travis, move jobs to circle CI --- .travis.yml | 3 +++ CI/circle_parallel.sh | 9 +++++++++ shippable.yml | 17 +++++++++-------- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5d7902847518..3db40c94ca51 100644 --- a/.travis.yml +++ b/.travis.yml @@ -131,6 +131,9 @@ script: # WARN: Travis will timeout after 10 minutes of no stdout/stderr activity, which is problematic with mvn --quiet. - mvn --quiet --batch-mode --show-version clean install - mvn --quiet --batch-mode --show-version verify -Psamples + # test maven plugin + - mvn clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml + - mvn clean compile -f modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml after_success: # push to maven repo - if [ $SONATYPE_USERNAME ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index 9b780d2f1957..f16895ed2451 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -12,6 +12,10 @@ if [ "$NODE_INDEX" = "1" ]; then #cp CI/pom.xml.circleci pom.xml java -version mvn --quiet verify -Psamples.circleci + # generate test scripts + ./bin/tests/run-all-test + # test all generators with fake petstore spec (2.0, 3.0) + ./bin/utils/test-fake-petstore-for-all.sh elif [ "$NODE_INDEX" = "2" ]; then # run ensure-up-to-date sample script on SNAPSHOT version only project_version=`mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout` @@ -51,6 +55,11 @@ else java -version #cp CI/pom.xml.circleci.java7 pom.xml mvn --quiet verify -Psamples.circleci.jdk7 + + # generate all petstore samples (client, servers, doc) + ./bin/run-all-petstore + # generate all petstore samples (openapi3) + ./bin/openapi3/run-all-petstore fi diff --git a/shippable.yml b/shippable.yml index 5d59a34340b2..c9ff665bebee 100644 --- a/shippable.yml +++ b/shippable.yml @@ -38,11 +38,12 @@ build: - mix --version # test samples defined in pom.xml - mvn --quiet verify -P samples.shippable -Dmaven.javadoc.skip=true - # generate all petstore samples (client, servers, doc) - - ./bin/run-all-petstore - # generate all petstore samples (openapi3) - - ./bin/openapi3/run-all-petstore - # generate test scripts - - ./bin/tests/run-all-test - # test all generators with fake petstore spec (2.0, 3.0) - - ./bin/utils/test-fake-petstore-for-all.sh + # below moved to CircleCI + ## generate all petstore samples (client, servers, doc) + #- ./bin/run-all-petstore + ## generate all petstore samples (openapi3) + #- ./bin/openapi3/run-all-petstore + ## generate test scripts + #- ./bin/tests/run-all-test + ## test all generators with fake petstore spec (2.0, 3.0) + #- ./bin/utils/test-fake-petstore-for-all.sh From c3e5723c5a365ffb8a6cedfcc4a7a278543e63a3 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 4 Jun 2019 17:05:02 +0800 Subject: [PATCH 2/4] Revert "[maven-plugin] fix strictSpec parameter (#3071)" This reverts commit 8c9a1512ae824d35866375eb69ddd085309d0251. --- .../main/java/org/openapitools/codegen/plugin/CodeGenMojo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java index 91d76333b10a..7ac66dc4da46 100644 --- a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java +++ b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java @@ -244,7 +244,7 @@ public class CodeGenMojo extends AbstractMojo { /** * To treat a document strictly against the spec. */ - @Parameter(name = "strictSpecBehavior", alias = "strictSpec", property = "openapi.generator.maven.plugin.strictSpec", required = false) + @Parameter(name = "strictSpec", property = "openapi.generator.maven.plugin.strictSpec", required = false) private Boolean strictSpecBehavior; /** From f06473667acb09c5d53da54f093bfeee38d9a9bc Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 4 Jun 2019 17:43:11 +0800 Subject: [PATCH 3/4] Revert "Revert "[maven-plugin] fix strictSpec parameter (#3071)"" This reverts commit c3e5723c5a365ffb8a6cedfcc4a7a278543e63a3. --- .../main/java/org/openapitools/codegen/plugin/CodeGenMojo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java index 7ac66dc4da46..91d76333b10a 100644 --- a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java +++ b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java @@ -244,7 +244,7 @@ public class CodeGenMojo extends AbstractMojo { /** * To treat a document strictly against the spec. */ - @Parameter(name = "strictSpec", property = "openapi.generator.maven.plugin.strictSpec", required = false) + @Parameter(name = "strictSpecBehavior", alias = "strictSpec", property = "openapi.generator.maven.plugin.strictSpec", required = false) private Boolean strictSpecBehavior; /** From f16eddba435c0960d4e60e500040b5b16900d07d Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 4 Jun 2019 20:27:31 +0800 Subject: [PATCH 4/4] test with jdk8 --- CI/circle_parallel.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index f16895ed2451..417f34349f25 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -12,6 +12,11 @@ if [ "$NODE_INDEX" = "1" ]; then #cp CI/pom.xml.circleci pom.xml java -version mvn --quiet verify -Psamples.circleci + + # generate all petstore samples (client, servers, doc) + ./bin/run-all-petstore + # generate all petstore samples (openapi3) + ./bin/openapi3/run-all-petstore # generate test scripts ./bin/tests/run-all-test # test all generators with fake petstore spec (2.0, 3.0) @@ -55,11 +60,6 @@ else java -version #cp CI/pom.xml.circleci.java7 pom.xml mvn --quiet verify -Psamples.circleci.jdk7 - - # generate all petstore samples (client, servers, doc) - ./bin/run-all-petstore - # generate all petstore samples (openapi3) - ./bin/openapi3/run-all-petstore fi