Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
[WIP] Bazel 25 compatibility (#185)
Browse files Browse the repository at this point in the history
* Update protobuf to remove warning

The older version of protobuf is causing a warning like:
An illegal reflective access operation has occurred

* Bazel 25 compatibility

Includes updating the _java attribute to use current_java_runtime and get rid
of warnings.

The current code with more recent versions of Bazel causes a warning about
using the deprecated target '@local_jdk//:java' and to use use
@bazel_tools//tools/jdk:current_java_runtime instead (see
bazelbuild/bazel#5594).

Resolves #122

* Update travis images
  • Loading branch information
James Judd authored and andyscott committed May 17, 2019
1 parent 1b3ca25 commit 81dd793
Show file tree
Hide file tree
Showing 32 changed files with 342 additions and 1,935 deletions.
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
common --config=rules
common:v0.21 --config=rules_v0.21
common:v0.25 --config=rules_v0.25
import %workspace%/.bazelrc_shared
44 changes: 6 additions & 38 deletions .bazelrc_shared
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ common --color=yes

build --experimental_strict_action_env
build --javacopt="-source 8 -target 8"

build --strategy=ScalaCompile=worker
build --worker_max_instances=4
build --worker_sandboxing
Expand All @@ -13,49 +14,16 @@ test --test_output=all
build:rules --disk_cache=.bazel_cache
build:tests --disk_cache=../.bazel_cache

# bazel 0.21.0

# appease io_bazel/third_party/protobuf/3.6.1/protobuf.bzl
common:v0.21 --incompatible_disable_deprecated_attr_params=false

# most of --all_incompatible_changes expanded
common:rules_v0.21 --incompatible_bzl_disallow_load_after_statement
common:rules_v0.21 --incompatible_depset_is_not_iterable
common:rules_v0.21 --incompatible_depset_union
common:rules_v0.21 --incompatible_disable_objc_provider_resources
common:rules_v0.21 --incompatible_disallow_data_transition
common:rules_v0.21 --incompatible_disallow_dict_plus
common:rules_v0.21 --incompatible_disallow_filetype
common:rules_v0.21 --incompatible_disallow_legacy_javainfo
common:rules_v0.21 --incompatible_disallow_load_labels_to_cross_package_boundaries
common:rules_v0.21 --incompatible_disallow_old_style_args_add
common:rules_v0.21 --incompatible_expand_directories
common:rules_v0.21 --incompatible_generate_javacommon_source_jar
common:rules_v0.21 --incompatible_new_actions_api
common:rules_v0.21 --incompatible_no_attr_license
common:rules_v0.21 --incompatible_no_output_attr_default
common:rules_v0.21 --incompatible_no_support_tools_in_action_inputs
common:rules_v0.21 --incompatible_no_target_output_group
common:rules_v0.21 --incompatible_no_transitive_loads
common:rules_v0.21 --incompatible_remove_native_maven_jar
common:rules_v0.21 --incompatible_strict_argument_ordering
common:rules_v0.21 --incompatible_string_is_not_iterable

# appease docker
common:tests_v0.21 --incompatible_remove_native_http_archive=false
common:tests_v0.21 --incompatible_remove_native_git_repository=false
# bazel 0.25.2
common:rules_v0.24 --config=noop
common:rules_v0.25 --config=noop

# route potentially unrouted configs to a terminating noop config
# it's a noop because we use the default value
common:rules --config=noop
common:tests --config=noop
common:v0.19 --config=noop
common:v0.20 --config=noop
common:v0.21 --config=noop
# future proofing
common:v0.22 --config=noop
common:v0.23 --config=noop
common:v0.24 --config=noop
common:v0.24 --config=rules_v0.24
common:v0.25 --config=rules_v0.25

# pick something trivial as a "noop"
common:noop --logging=3
26 changes: 12 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
dist: trusty
dist: xenial
sudo: required
language: java

addons:
apt:
Expand All @@ -18,46 +17,45 @@ cache:
# some could be global, but these are OS-specific and ought not to be included
# in the UI or the cache key
_linux: &linux
jdk: oraclejdk8
os: linux
_osx: &osx
os: osx
osx_image: xcode7.3
osx_image: xcode9.3

jobs:
include:
# Build
- stage: build
<<: *osx
env: BAZEL_VERSION=0.21.0
env: BAZEL_VERSION=0.24.1
script: ./scripts/travis.sh build
- <<: *linux
env: BAZEL_VERSION=0.21.0
env: BAZEL_VERSION=0.24.1
script: ./scripts/travis.sh build
- <<: *osx
env: BAZEL_VERSION=0.22.0
env: BAZEL_VERSION=0.25.2
script: ./scripts/travis.sh build
- <<: *linux
env: BAZEL_VERSION=0.22.0
env: BAZEL_VERSION=0.25.2
script: ./scripts/travis.sh build
# Lint
- stage: test
<<: *osx
env: BAZEL_VERSION=0.22.0
env: BAZEL_VERSION=0.24.1
script: ./scripts/travis.sh lint
- <<: *linux
env: BAZEL_VERSION=0.22.0
env: BAZEL_VERSION=0.25.2
script: ./scripts/travis.sh lint
# Test
- <<: *osx
env: BAZEL_VERSION=0.21.0
env: BAZEL_VERSION=0.24.1
script: ./scripts/travis.sh test
- <<: *linux
env: BAZEL_VERSION=0.21.0
env: BAZEL_VERSION=0.24.1
script: ./scripts/travis.sh test
- <<: *osx
env: BAZEL_VERSION=0.22.0
env: BAZEL_VERSION=0.25.2
script: ./scripts/travis.sh test
- <<: *linux
env: BAZEL_VERSION=0.22.0
env: BAZEL_VERSION=0.25.2
script: ./scripts/travis.sh test
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,19 @@ scala_register_toolchains()
git_repository(
name = "bazel_skylib",
remote = "https://github.com/bazelbuild/bazel-skylib.git",
tag = "0.6.0",
tag = "0.8.0",
)

http_archive(
name = "com_google_protobuf",
sha256 = "2c8f8614fb1be709d68abaab6b4791682aa7db2048012dd4642d3a50b4f67cb3",
strip_prefix = "protobuf-0038ff49af882463c2af9049356eed7df45c3e8e",
urls = ["https://github.com/google/protobuf/archive/0038ff49af882463c2af9049356eed7df45c3e8e.zip"],
sha256 = "0963c6ae20340ce41f225a99cacbcba8422cebe4f82937f3d9fa3f5dd7ae7342",
strip_prefix = "protobuf-9f604ac5043e9ab127b99420e957504f2149adbe",
urls = ["https://github.com/google/protobuf/archive/9f604ac5043e9ab127b99420e957504f2149adbe.zip"],
)

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
protobuf_deps()

# Specify the scala compiler we wish to use; in this case, we'll use the default one specified in rules_scala_annex
bind(
name = "default_scala",
Expand Down
53 changes: 43 additions & 10 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,62 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

http_archive(
name = "io_bazel",
sha256 = "f44ad96857209fe76d7321185d1b9ad6861a469752432ffaccaf838858708cdf",
strip_prefix = "bazel-defd737761be2b154908646121de47c30434ed51",
urls = ["https://github.com/bazelbuild/bazel/archive/defd737761be2b154908646121de47c30434ed51.zip"],
sha256 = "437b3237f15e6ce950ae7f892673f65fc83642847e8c12c4c00b19b00b6e0690",
strip_prefix = "bazel-318aebb523b3c91275855e35f0a67814e0d2231f",
urls = ["https://github.com/bazelbuild/bazel/archive/318aebb523b3c91275855e35f0a67814e0d2231f.zip"],
)

http_archive(
name = "io_bazel_skydoc",
sha256 = "4e9bd9ef65af54dedd997b408fa26c2e70c30ee8e078bcc1b51a33cf7d7f9d7e",
strip_prefix = "skydoc-77e5399258f6d91417d23634fce97d73b40cf337",
urls = ["https://github.com/bazelbuild/skydoc/archive/77e5399258f6d91417d23634fce97d73b40cf337.zip"],
sha256 = "694602137e5d56cfd35622cf58c047549324a0db1522ee944ad86e74420be9db",
strip_prefix = "skydoc-b8a32e07ee8297c89ca8020af4fa2163a766706f",
urls = ["https://github.com/bazelbuild/skydoc/archive/b8a32e07ee8297c89ca8020af4fa2163a766706f.zip"],
)

git_repository(
name = "bazel_skylib",
remote = "https://github.com/bazelbuild/bazel-skylib.git",
tag = "0.6.0",
tag = "0.8.0",
)

http_archive(
name = "com_google_protobuf",
sha256 = "2c8f8614fb1be709d68abaab6b4791682aa7db2048012dd4642d3a50b4f67cb3",
strip_prefix = "protobuf-0038ff49af882463c2af9049356eed7df45c3e8e",
urls = ["https://github.com/google/protobuf/archive/0038ff49af882463c2af9049356eed7df45c3e8e.zip"],
sha256 = "0963c6ae20340ce41f225a99cacbcba8422cebe4f82937f3d9fa3f5dd7ae7342",
strip_prefix = "protobuf-9f604ac5043e9ab127b99420e957504f2149adbe",
urls = ["https://github.com/google/protobuf/archive/9f604ac5043e9ab127b99420e957504f2149adbe.zip"],
)

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")

protobuf_deps()

jdk_build_file_content = """
filegroup(
name = "jdk",
srcs = glob(["**/*"]),
visibility = ["//visibility:public"],
)
filegroup(
name = "java",
srcs = ["bin/java"],
visibility = ["//visibility:public"],
)
"""

http_archive(
name = "jdk8-linux",
build_file_content = jdk_build_file_content,
sha256 = "dd28d6d2cde2b931caf94ac2422a2ad082ea62f0beee3bf7057317c53093de93",
strip_prefix = "jdk8u212-b03",
url = "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u212-b03/OpenJDK8U-jdk_x64_linux_hotspot_8u212b03.tar.gz",
)

http_archive(
name = "jdk8-osx",
build_file_content = jdk_build_file_content,
sha256 = "3d80857e1bb44bf4abe6d70ba3bb2aae412794d335abe46b26eb904ab6226fe0",
strip_prefix = "jdk8u212-b03",
url = "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u212-b03/OpenJDK8U-jdk_x64_mac_hotspot_8u212b03.tar.gz",
)

http_archive(
Expand Down
26 changes: 16 additions & 10 deletions docs/stardoc/external.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!-- Generated with Stardoc: http://skydoc.bazel.build -->

<a name="#scala_import_external"></a>

## scala_import_external

<pre>
Expand All @@ -14,22 +18,24 @@ scala_import_external(<a href="#scala_import_external-rule_load">rule_load</a>,
<col class="col-description" />
</colgroup>
<tbody>
<tr id="scala_import_external-rule_load>
<tr id="scala_import_external-rule_load">
<td><code>rule_load</code></td>
<td>
required.
optional. default is <code>"load(\"@rules_scala_annex//rules:scala.bzl\", \"scala_import\")"</code>
</td>
</tr>
<tr id="scala_import_external-kwargs>
<tr id="scala_import_external-kwargs">
<td><code>kwargs</code></td>
<td>
optional. default is <code>"load(\"@rules_scala_annex//rules:scala.bzl\", \"scala_import\")"</code>
optional.
</td>
</tr>
</tbody>
</table>


<a name="#scala_maven_import_external"></a>

## scala_maven_import_external

<pre>
Expand All @@ -46,28 +52,28 @@ scala_maven_import_external(<a href="#scala_maven_import_external-artifact">arti
<col class="col-description" />
</colgroup>
<tbody>
<tr id="scala_maven_import_external-artifact>
<tr id="scala_maven_import_external-artifact">
<td><code>artifact</code></td>
<td>
required.
</td>
</tr>
<tr id="scala_maven_import_external-server_urls>
<tr id="scala_maven_import_external-server_urls">
<td><code>server_urls</code></td>
<td>
required.
</td>
</tr>
<tr id="scala_maven_import_external-rule_load>
<tr id="scala_maven_import_external-rule_load">
<td><code>rule_load</code></td>
<td>
required.
optional. default is <code>"load(\"@rules_scala_annex//rules:scala.bzl\", \"scala_import\")"</code>
</td>
</tr>
<tr id="scala_maven_import_external-kwargs>
<tr id="scala_maven_import_external-kwargs">
<td><code>kwargs</code></td>
<td>
optional. default is <code>"load(\"@rules_scala_annex//rules:scala.bzl\", \"scala_import\")"</code>
optional.
</td>
</tr>
</tbody>
Expand Down
Loading

0 comments on commit 81dd793

Please sign in to comment.