Skip to content

Commit

Permalink
Merge branch 'main' into jsclosure_642
Browse files Browse the repository at this point in the history
  • Loading branch information
drinckes authored Dec 23, 2024
2 parents 766cfb9 + 75f48b4 commit d068dc7
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 40 deletions.
5 changes: 5 additions & 0 deletions .bazeliskrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Set options for Bazelisk, a wrapper for Bazel.

# Set the version of Bazel to use.
# TODO: #642 -- Update once the JS bazelbuild/rules_closure supports bazel modules.
USE_BAZEL_VERSION=7.4.1
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
OLC_PATH: c
steps:
- uses: actions/checkout@v2
- uses: bazelbuild/setup-bazelisk@v3
- name: test
run: bazel test --test_output=all ${OLC_PATH}:all
- name: check formatting
Expand All @@ -20,6 +21,7 @@ jobs:
OLC_PATH: cpp
steps:
- uses: actions/checkout@v2
- uses: bazelbuild/setup-bazelisk@v3
- name: test
run: bazel test --test_output=all ${OLC_PATH}:all
- name: check formatting
Expand Down Expand Up @@ -70,6 +72,7 @@ jobs:
name: test-java-${{ matrix.java }}
steps:
- uses: actions/checkout@v2
- uses: bazelbuild/setup-bazelisk@v3
- name: Setup java
uses: actions/setup-java@v2
with:
Expand All @@ -85,6 +88,7 @@ jobs:
OLC_PATH: js/closure
steps:
- uses: actions/checkout@v2
- uses: bazelbuild/setup-bazelisk@v3
- name: test
run: |
bazel test ${OLC_PATH}:all
Expand Down Expand Up @@ -113,6 +117,7 @@ jobs:
name: test-python-${{ matrix.python }}
steps:
- uses: actions/checkout@v2
- uses: bazelbuild/setup-bazelisk@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
Expand Down
31 changes: 1 addition & 30 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,7 @@ module(
)

bazel_dep(name = "googletest", version = "1.15.2")
bazel_dep(name = "rules_proto", version = "7.0.2") # Deprecated (moved), TODO find new URL
bazel_dep(name = "rules_proto", version = "7.0.2")
bazel_dep(name = "rules_java", version = "8.6.1")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_python", version = "0.40.0")

# External dependency archives
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# io_bazel_rules_closure for the JS/Closure tests.
http_archive(
name = "io_bazel_rules_closure",
strip_prefix = "rules_closure-0.14.0",
urls = [
"https://github.com/bazelbuild/rules_closure/archive/0.14.0.tar.gz",
],
)

# io_bazel_rules_webtesting:
# Use master from github because rules_closure-0.13.0 needs
# io_bazel_rules_webtesting//web/versioned:browsers-0.3.4.bzl
# but that hasn't been rolled into a release yet.
http_archive(
name = "io_bazel_rules_webtesting",
strip_prefix = "rules_webtesting-master",
urls = [
"https://github.com/bazelbuild/rules_webtesting/archive/refs/heads/master.zip",
],
)

# gazelle and rules_go required by the closure package I think.
bazel_dep(name = "gazelle", version = "0.40.0", repo_name = "bazel_gazelle")
bazel_dep(name = "rules_go", version = "0.51.0", repo_name = "io_bazel_rules_go")

19 changes: 19 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Workspace configuration for Bazel build tools.

# TODO: #642 -- Remove once io_bazel_rules_closure supports Bazel module configuration.
workspace(name = "openlocationcode")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "io_bazel_rules_closure",
integrity = "sha256-EvEWnr54L4Yx/LjagaoSuhkviVKHW0oejyDEn8bhAiM=",
strip_prefix = "rules_closure-0.14.0",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_closure/archive/0.14.0.tar.gz",
"https://github.com/bazelbuild/rules_closure/archive/0.14.0.tar.gz",
],
)
load("@io_bazel_rules_closure//closure:repositories.bzl", "rules_closure_dependencies", "rules_closure_toolchains")
rules_closure_dependencies()
rules_closure_toolchains()
12 changes: 6 additions & 6 deletions js/closure/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ closure_js_test(
entry_points = ["goog:openlocationcode_test"],
deps = [
":openlocationcode_lib",
"@io_bazel_rules_closure//closure/library/net:eventtype",
"@io_bazel_rules_closure//closure/library/net:xhrio",
"@io_bazel_rules_closure//closure/library/testing:asserts",
"@io_bazel_rules_closure//closure/library/testing:asynctestcase",
"@io_bazel_rules_closure//closure/library/testing:testsuite",
"@com_google_javascript_closure_library//closure/goog/net:eventtype",
"@com_google_javascript_closure_library//closure/goog/net:xhrio",
"@com_google_javascript_closure_library//closure/goog/testing:asserts",
"@com_google_javascript_closure_library//closure/goog/testing:asynctestcase",
"@com_google_javascript_closure_library//closure/goog/testing:testsuite",
],
)
)
8 changes: 4 additions & 4 deletions js/closure/openlocationcode_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ const testSuite = goog.require('goog.testing.testSuite');
goog.require('goog.testing.asserts');

const /** @const {string} */ DECODING_TEST_FILE =
'/filez/openlocationcode/test_data/decoding.csv';
'/filez/_main/test_data/decoding.csv';
const /** @const {string} */ ENCODING_TEST_FILE =
'/filez/openlocationcode/test_data/encoding.csv';
'/filez/_main/test_data/encoding.csv';
const /** @const {string} */ SHORT_CODE_TEST_FILE =
'/filez/openlocationcode/test_data/shortCodeTests.csv';
'/filez/_main/test_data/shortCodeTests.csv';
const /** @const {string} */ VALIDITY_TEST_FILE =
'/filez/openlocationcode/test_data/validityTests.csv';
'/filez/_main/test_data/validityTests.csv';

// Initialise the async test framework.
const /** @const {!AsyncTestCase} */ asyncTestCase = AsyncTestCase.createAndInstall();
Expand Down

0 comments on commit d068dc7

Please sign in to comment.