Skip to content

Commit

Permalink
Bump Coursier to v2.0.0-RC3 and mirror it on Bazel mirror (#215)
Browse files Browse the repository at this point in the history
* Bump Coursier to v2.0.0-RC3 and mirror it on Bazel mirror

* Remove unused lines

* Update regression_testing_install

* Add regression test for #201

* update json

* fix workspace

* Address cparson's comments and buildify
  • Loading branch information
jin authored Aug 14, 2019
1 parent c8ada19 commit 65139a8
Show file tree
Hide file tree
Showing 6 changed files with 2,275 additions and 285 deletions.
7 changes: 7 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("@io_bazel_skydoc//stardoc:stardoc.bzl", "stardoc")
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("//:private/versions.bzl", "COURSIER_CLI_HTTP_FILE_NAME")

exports_files(["defs.bzl"])

Expand Down Expand Up @@ -51,3 +52,9 @@ genrule(
$(location //:docs/includes/spec_functions_header.md) \
$(location //:specs.md) > $@""",
)

sh_binary(
name = "mirror_coursier",
srcs = [":scripts/mirror_coursier.sh"],
data = ["@" + COURSIER_CLI_HTTP_FILE_NAME + "//file"],
)
46 changes: 36 additions & 10 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@ workspace(name = "rules_jvm_external")

android_sdk_repository(name = "androidsdk")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
load(
"//:private/versions.bzl",
"COURSIER_CLI_HTTP_FILE_NAME",
"COURSIER_CLI_GITHUB_ASSET_URL",
"COURSIER_CLI_SHA256",
)

http_file(
name = COURSIER_CLI_HTTP_FILE_NAME,
sha256 = COURSIER_CLI_SHA256,
urls = [COURSIER_CLI_GITHUB_ASSET_URL],
)

# Begin Skylib dependencies

Expand All @@ -14,7 +26,9 @@ http_archive(
strip_prefix = "bazel-skylib-%s" % BAZEL_SKYLIB_TAG,
url = "https://github.com/bazelbuild/bazel-skylib/archive/%s.tar.gz" % BAZEL_SKYLIB_TAG,
)

load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")

bazel_skylib_workspace()

# End Skylib dependencies
Expand All @@ -23,8 +37,8 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
name = "io_bazel_skydoc",
remote = "https://github.com/bazelbuild/skydoc.git",
commit = "e235d7d6dec0241261bdb13d7415f3373920e6fd",
remote = "https://github.com/bazelbuild/skydoc.git",
shallow_since = "1554317371 -0400",
)

Expand Down Expand Up @@ -72,7 +86,9 @@ maven_install(
],
use_unsafe_shared_cache = True,
)

load("@unsafe_shared_cache_with_pinning//:defs.bzl", "pinned_maven_install")

pinned_maven_install()

maven_install(
Expand Down Expand Up @@ -151,29 +167,35 @@ maven_install(
"org.openjfx:javafx-base:11.0.1",
# https://github.com/bazelbuild/rules_jvm_external/issues/178
"io.kubernetes:client-java:4.0.0-beta1",
# https://github.com/bazelbuild/rules_jvm_external/issues/199
# https://github.com/bazelbuild/rules_jvm_external/issues/199
"com.google.ar.sceneform.ux:sceneform-ux:1.10.0",
# https://github.com/bazelbuild/rules_jvm_external/issues/119#issuecomment-504704752
"com.github.oshi:oshi-parent:3.4.0",
"com.github.spinalhdl:spinalhdl-core_2.11:1.3.6",
"com.github.spinalhdl:spinalhdl-lib_2.11:1.3.6",
# https://github.com/bazelbuild/rules_jvm_external/issues/201
"org.apache.kafka:kafka_2.11:2.1.1",
"io.confluent:kafka-avro-serializer:5.0.1",
],
generate_compat_repositories = True,
maven_install_json = "//:regression_testing_install.json",
override_targets = {
"com.google.ar.sceneform:rendering": "@//tests/integration/override_targets:sceneform_rendering",
},
repositories = [
"https://repo1.maven.org/maven2",
"https://digitalassetsdk.bintray.com/DigitalAssetSDK",
"https://maven.google.com",
"https://packages.confluent.io/maven/",
],
generate_compat_repositories = True,
maven_install_json = "//:regression_testing_install.json",
override_targets = {
"com.google.ar.sceneform:rendering": "@//tests/integration/override_targets:sceneform_rendering",
}
)

load("@regression_testing//:defs.bzl", "pinned_maven_install")

pinned_maven_install()

load("@regression_testing//:compat.bzl", "compat_repositories")

compat_repositories()

maven_install(
Expand All @@ -183,15 +205,19 @@ maven_install(
"com.google.cloud:google-cloud-storage:1.66.0",
"com.google.guava:guava:25.0-android",
],
maven_install_json = "//:policy_pinned_testing_install.json",
repositories = [
"https://repo1.maven.org/maven2",
"https://maven.google.com",
],
version_conflict_policy = "pinned",
maven_install_json = "//:policy_pinned_testing_install.json",
)

load("@policy_pinned_testing//:defs.bzl", _policy_pinned_maven_install = "pinned_maven_install")
load(
"@policy_pinned_testing//:defs.bzl",
_policy_pinned_maven_install = "pinned_maven_install",
)

_policy_pinned_maven_install()

RULES_KOTLIN_VERSION = "9051eb053f9c958440603d557316a6e9fda14687"
Expand Down
12 changes: 8 additions & 4 deletions coursier.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ load("//third_party/bazel_json/lib:json_parser.bzl", "json_parse")
load("//:specs.bzl", "utils")
load(
"//:private/versions.bzl",
"COURSIER_CLI_MAVEN_PATH",
"COURSIER_CLI_GITHUB_ASSET_URL",
"COURSIER_CLI_BAZEL_MIRROR_URL",
"COURSIER_CLI_SHA256",
)

Expand Down Expand Up @@ -576,8 +577,8 @@ def _coursier_fetch_impl(repository_ctx):

# Download Coursier's standalone (deploy) jar from Maven repositories.
repository_ctx.download([
"https://jcenter.bintray.com/" + COURSIER_CLI_MAVEN_PATH,
"http://central.maven.org/maven2/" + COURSIER_CLI_MAVEN_PATH,
COURSIER_CLI_GITHUB_ASSET_URL,
COURSIER_CLI_BAZEL_MIRROR_URL,
], "coursier", sha256 = COURSIER_CLI_SHA256, executable = True)

# Try running coursier once
Expand Down Expand Up @@ -886,7 +887,10 @@ coursier_fetch = repository_rule(
If "default", follow Coursier's default policy.
""",
default = "default",
values = ["default", "pinned"],
values = [
"default",
"pinned",
],
),
"maven_install_json": attr.label(allow_single_file = True),
"override_targets": attr.string_dict(default = {}),
Expand Down
14 changes: 7 additions & 7 deletions private/versions.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
_COURSIER_CLI_VERSION = "2.12"
_COURSIER_VERSION = "1.1.0-M14-4"
COURSIER_CLI_SHA256 = "2311054a07f5e8d83766155744e139e7a4b2ee1e77d47a636839687c4233a465"
COURSIER_CLI_MAVEN_PATH = "io/get-coursier/coursier-cli_{COURSIER_CLI_VERSION}/{COURSIER_VERSION}/coursier-cli_{COURSIER_CLI_VERSION}-{COURSIER_VERSION}-standalone.jar".format(
COURSIER_CLI_VERSION = _COURSIER_CLI_VERSION,
COURSIER_VERSION = _COURSIER_VERSION,
)
_COURSIER_CLI_VERSION = "v2.0.0-RC3"

COURSIER_CLI_HTTP_FILE_NAME = ("coursier_cli_" + _COURSIER_CLI_VERSION).replace(".", "_").replace("-", "_")
COURSIER_CLI_GITHUB_ASSET_URL = "https://github.com/coursier/coursier/releases/download/{COURSIER_CLI_VERSION}/coursier.jar".format(COURSIER_CLI_VERSION = _COURSIER_CLI_VERSION)
# Run 'bazel run //:mirror_coursier' to upload a copy of the jar to the Bazel mirror.
COURSIER_CLI_BAZEL_MIRROR_URL = "https://mirror.bazel.build/coursier_cli/" + COURSIER_CLI_HTTP_FILE_NAME + ".jar"
COURSIER_CLI_SHA256 = "17f4ff053d0d1dca588afdcc94ca952f7ed85bb03675cd77ec05b7352a832b86"
Loading

0 comments on commit 65139a8

Please sign in to comment.