Skip to content

Commit

Permalink
Fixes for Bazel 8 and stardoc 0.7.1 (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum authored Oct 8, 2024
1 parent 928bccd commit 21a20e1
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/run-tests-externally.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
jdk: 11
- bazel: 6.x
jdk: 17
- bazel: 6.x
bazel_mode: module
- bazel: last_green
jdk: 8
- bazel: last_green
Expand Down Expand Up @@ -77,7 +79,7 @@ jobs:
env:
USE_BAZEL_VERSION: ${{ matrix.bazel }}
working-directory: ./tests
run: bazelisk test --config=ci --disk_cache=${{ matrix.cache }} --profile=${{ github.workspace }}/profile.gz ${{ matrix.bazel_extra_args }} //...
run: bazelisk test --config=ci --disk_cache=${{ matrix.cache }} --profile=${{ github.workspace }}/profile.gz ${{ matrix.bazel_extra_args }} //... @fmeum_rules_jni//jni/...

- name: Check coverage
if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.jdk == '8' || matrix.jdk == '21') }}
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/run-tests-internally.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
env:
BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: Build and test internally (ubuntu-latest, Bazel last_green module, JDK 21)
name: Build and test internally (ubuntu-latest, Bazel latest module, JDK 21)

steps:
- uses: actions/checkout@v4
Expand All @@ -34,11 +34,7 @@ jobs:
key: bazel-disk-cache-internal

- name: Build main repository
env:
USE_BAZEL_VERSION: "last_green"
run: bazelisk build --disk_cache="/home/runner/.cache/bazel-disk" //...

- name: Run tests in main repository
env:
USE_BAZEL_VERSION: "last_green"
run: bazelisk test --disk_cache="/home/runner/.cache/bazel-disk" //...
3 changes: 2 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module(

bazel_dep(name = "bazel_skylib", version = "1.6.1")
bazel_dep(name = "platforms", version = "0.0.5")
bazel_dep(name = "rules_cc", version = "0.0.12")
bazel_dep(name = "rules_license", version = "0.0.7")

download_jdk_deps = use_extension(
Expand All @@ -21,4 +22,4 @@ use_repo(
)

bazel_dep(name = "rules_jvm_external", version = "6.1", dev_dependency = True)
bazel_dep(name = "stardoc", version = "0.6.2", dev_dependency = True)
bazel_dep(name = "stardoc", version = "0.7.1", dev_dependency = True)
6 changes: 6 additions & 0 deletions docs-gen/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
## jni_headers

<pre>
load("@rules_jni//jni:defs.bzl", "jni_headers")

jni_headers(<a href="#jni_headers-name">name</a>, <a href="#jni_headers-lib">lib</a>)
</pre>

Expand Down Expand Up @@ -63,6 +65,8 @@ cc_library(
## cc_jni_library

<pre>
load("@rules_jni//jni:defs.bzl", "cc_jni_library")

cc_jni_library(<a href="#cc_jni_library-name">name</a>, <a href="#cc_jni_library-platforms">platforms</a>, <a href="#cc_jni_library-cc_binary_args">cc_binary_args</a>)
</pre>

Expand Down Expand Up @@ -109,6 +113,8 @@ An example of such a CI workflow can be found [here](https://github.com/CodeInte
## java_jni_library

<pre>
load("@rules_jni//jni:defs.bzl", "java_jni_library")

java_jni_library(<a href="#java_jni_library-name">name</a>, <a href="#java_jni_library-native_libs">native_libs</a>, <a href="#java_jni_library-java_library_args">java_library_args</a>)
</pre>

Expand Down
2 changes: 2 additions & 0 deletions docs-gen/workspace_macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
## rules_jni_dependencies

<pre>
load("@rules_jni//jni:repositories.bzl", "rules_jni_dependencies")

rules_jni_dependencies()
</pre>

Expand Down
1 change: 1 addition & 0 deletions jni/private/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ bzl_library(
name = "all_rules",
srcs = glob(["*.bzl"]) + [
"@bazel_tools//tools:bzl_srcs",
"@rules_cc//cc:bzl_srcs",
],
visibility = ["//jni:__pkg__"],
)
Expand Down
4 changes: 2 additions & 2 deletions tests/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ local_path_override(

bazel_dep(name = "bazel_skylib", version = "1.1.1")
bazel_dep(name = "platforms", version = "0.0.4")
bazel_dep(name = "rules_cc", version = "0.0.2")
bazel_dep(name = "rules_cc", version = "0.0.12")
bazel_dep(name = "rules_java", version = "7.2.0")
bazel_dep(name = "stardoc", version = "0.5.0", repo_name = "io_bazel_stardoc")

# For the Xcode toolchain.
bazel_dep(name = "apple_support", version = "1.15.1", dev_dependency = True)

cc_configure = use_extension("@bazel_tools//tools/cpp:cc_configure.bzl", "cc_configure_extension")
cc_configure = use_extension("@rules_cc//cc:extensions.bzl", "cc_configure_extension")
use_repo(cc_configure, "local_config_cc")

install_dev_dependencies = use_extension(
Expand Down

0 comments on commit 21a20e1

Please sign in to comment.