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

homebrew doesn't exist #135

Closed
flozano opened this issue May 23, 2018 · 9 comments
Closed

homebrew doesn't exist #135

flozano opened this issue May 23, 2018 · 9 comments

Comments

@flozano
Copy link
Contributor

flozano commented May 23, 2018

documentation refers to homebrew installation, but I get:

$ brew install openapi-generator
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 3 taps (homebrew/core, caskroom/versions, caskroom/cask).
==> Updated Formulae
azure-cli                                                              dspdfviewer                                                            presto

Error: No available formula with the name "openapi-generator"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
==> Searching local taps...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
@wing328
Copy link
Member

wing328 commented May 23, 2018 via email

@jmini
Copy link
Member

jmini commented May 23, 2018

I guess @wing328 plans to add this support, but for the moment openapi-generator was not added to Homebrew formulas.

Maybe this request the generator to be released first...

@flozano: Have you an other way to test this? Do you need help with the setup?


EDIT: @wing328: was quicker...

@jimschubert
Copy link
Member

Here's a script that you can use in the meantime.

#!/usr/bin/env bash

set -io pipefail

ver=${version:-3.0.0-SNAPSHOT}
groupid=org.openapitools
artifactid=openapi-generator-cli
jar=openapi-generator-cli-${ver}.jar
repo="https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

if [[ ${ver} =~ ^.*-SNAPSHOT$ ]]; then
    repo="https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli"
fi

if [ ! -f ${DIR}/${jar} ]; then
  if ! command -v mvn > /dev/null; then
	>&2 echo "This script requires maven to be installed."
    exit 1
  fi
  mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:get \
    -DrepoUrl=${repo} \
    -Dartifact=${groupid}:${artifactid}:${ver} \
    -Dtransitive=false \
    -Ddest=${DIR}/${jar}
fi

java -ea                          \
  ${JAVA_OPTS}                    \
  -Xms512M                        \
  -Xmx1024M                       \
  -server                         \
  -jar ${DIR}/${jar} "$@"

Install: save as openapi-generator (be sure to chmod u+x openapi-generator) under ~/.bin and add to your path.

Usage:

# Uses 3.0.0-SNAPSHOT by default
$ ./openapi-generator help
usage: openapi-generator-cli <command> [<args>]

The most commonly used openapi-generator-cli commands are:
    config-help   Config help for chosen lang
    generate      Generate code with chosen lang
    help          Display help information
    langs         Shows available languages (generators)
    meta          MetaGenerator. Generator for creating a new template set and configuration for Codegen.  The output will be based on the language you specify, and includes default templates to include.
    validate      Validate specification
    version       Show version information

See 'openapi-generator-cli help <command>' for more information on a specific
command.

# Can target specific versions with environment variable "version"
# fails because we haven't released
$ version=3.0.0 ./openapi-generator help

The CLI jar(s) get pulled to the same directory where this script exists.

@flozano
Copy link
Contributor Author

flozano commented May 24, 2018

Thanks a lot!

@macjohnny
Copy link
Member

any update on this?

@jmini
Copy link
Member

jmini commented Jun 5, 2018

From PR #217

The new brew formula is pending Homebrew/homebrew-core#28584

@macjohnny
Copy link
Member

excellent, thanks!

@wing328
Copy link
Member

wing328 commented Jun 12, 2018

UPDATE: I've submitted Homebrew/homebrew-core#28921 for OpenAPI Generator CLI 3.0.1 and closed the previous one.

@wing328 wing328 added this to the 3.0.2 milestone Jun 12, 2018
@jmini jmini modified the milestones: 3.0.2, 3.0.3 Jun 18, 2018
@ackintosh
Copy link
Contributor

Added the homebrew formula 🎉
https://twitter.com/oas_generator/status/1008230904488062978

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants