Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !162

[gradle-plugin] Initial implementation

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Jim Schubert requested to merge github/fork/jimschubert/gradle-plugin into master May 27, 2018
  • Overview 0
  • Commits 11
  • Pipelines 0
  • Changes 33

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

See #141 (closed)

This is an initial implementation of a gradle-plugin for OpenAPI Generator. I've opened this PR to solicit feedback. Please see the initial commit of README.adoc for details and examples.

To test this out, you'll first need to build the generator:

mvn clean package install

Then, you'll want to build and publish the gradle plugin locally (update inputSpec references to your own locally available specs):

cd gradle
./gradlew build
./gradlew publishToMavenLocal

From here, you can create a simple build.gradle and execute tasks:

buildscript {
  repositories {
   mavenLocal()
   mavenCentral()
    maven {
        url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "org.openapitools:openapi-generator-gradle-plugin:3.0.0-SNAPSHOT"
  }
}

apply plugin: 'org.openapi.generator'

openApiMeta {
   generatorName = "Jim"
   packageName = "us.jimschubert.example"
}

openApiValidate {
   inputSpec = "/Users/jim/projects/openapi-generator/modules/openapi-generator/src/test/resources/3_0/petstore.yaml"
}

openApiGenerate {
    generatorName = "kotlin"
    inputSpec = "$rootDir/specs/petstore-v3.0.yaml".toString()
    outputDir = "$buildDir/generated".toString()
    apiPackage = "org.openapi.example.api"
    invokerPackage = "org.openapi.example.invoker"
    modelPackage = "org.openapi.example.model"
    modelFilesConstrainedTo = [
            "Error"
    ]
    configOptions = [
        dateLibrary: "java8"
    ]
}

Details around how to configure this to build and published via CI will be worked out after getting feedback on the plugin.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/jimschubert/gradle-plugin