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

Deprecate maven_jar rule #23

Merged
merged 3 commits into from
Nov 24, 2019
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@
To use the OpenAPI rules, add the following to your projects `WORKSPACE` file

```python
rules_open_api_version = "bc060274349e137c0eb6ccf6f5f06de94551fe00" # update this as needed
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

RULES_OPEN_API_VERSION = "19518c16fa67cb272ffb6055bf90e0f1628ce99b"
RULES_OPEN_API_SHA256 = "50564187aa01200f9eff01e0fcc541af50b535fd968fe25a4d401e3aa2e8bd87"

http_archive(
name = "io_bazel_rules_openapi",
strip_prefix = "rules_openapi-%s" % rules_open_api_version,
type = "zip",
url = "https://github.com/meetup/rules_openapi/archive/%s.zip" % rules_open_api_version,
sha256 = "78503f072e4ca745854c986a34b478914d5242b4c6cada81069fa15b7309570b"
strip_prefix = "rules_openapi-%s" % RULES_OPEN_API_VERSION,
url = "https://github.com/meetup/rules_openapi/archive/%s.tar.gz" % RULES_OPEN_API_VERSION,
sha256 = RULES_OPEN_API_SHA256
)

load("@io_bazel_rules_openapi//openapi:openapi.bzl", "openapi_repositories")
openapi_repositories()
```
Expand Down
10 changes: 8 additions & 2 deletions openapi/openapi.bzl
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
"""Bazel rules for generating sources and libraries from openapi schemas

"""

load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external")


def openapi_repositories(swagger_codegen_cli_version = "2.2.2", swagger_codegen_cli_sha256 = "d4e640503482a423ae97e3f487347c9e08cc0e34d90e360ed7de987cfad24299", prefix = "io_bazel_rules_openapi"):
native.maven_jar(
jvm_maven_import_external(
name = prefix + "_io_swagger_swagger_codegen_cli",
artifact = "io.swagger:swagger-codegen-cli:" + swagger_codegen_cli_version,
sha256 = swagger_codegen_cli_sha256,
artifact_sha256 = swagger_codegen_cli_sha256,
server_urls = ["http://central.maven.org/maven2"],
licenses = ["notice"], # Apache 2.0 License
)
native.bind(
name = prefix + "/dependency/openapi-cli",
Expand Down