Skip to content

Commit

Permalink
reorg: make rules ready for release
Browse files Browse the repository at this point in the history
When releasing library the best practices recommend that the entire
public directory should be buildable without any dev dependencies.

This breaks the API as those consuming the library need to change the
paths they're using, but it's not that much of a change.
  • Loading branch information
manuelnaranjo committed Aug 28, 2024
1 parent 43b4866 commit afb8402
Show file tree
Hide file tree
Showing 21 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@buildifier_prebuilt//:rules.bzl", "buildifier")
load(":workspace_status.bzl", "workspace_status")
load("@rules_booking//booking:workspace_status.bzl", "workspace_status")

buildifier(
name = "buildifier",
Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_java", version = "6.5.2")
bazel_dep(name = "rules_pkg", version = "1.0.1")

extra_dependencies = use_extension("//:module.bzl", "extra_dependencies")
extra_dependencies = use_extension("//booking:module.bzl", "extra_dependencies")
use_repo(
extra_dependencies,
"bazel_version",
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions dependencies.bzl → booking/dependencies.bzl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
load("@rules_java//java:repositories.bzl", "rules_java_dependencies", "rules_java_toolchains")
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
load("//:repositories.bzl", "bazel_version")
load("//dependency_check:deps.bzl", _dependency_check = "dependencies")
load("//booking:repositories.bzl", "bazel_version")
load("//booking/dependency_check:deps.bzl", _dependency_check = "dependencies")

def dependencies():
bazel_skylib_workspace()
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ def dependencies():
urls = [
"https://github.com/jeremylong/DependencyCheck/releases/download/v8.4.0/dependency-check-8.4.0-release.zip",
],
build_file = "@rules_booking//dependency_check:BUILD.dependency_check",
build_file = "@rules_booking//booking/dependency_check:BUILD.dependency_check",
)
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions module.bzl → booking/module.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This dependency is internal for rules_booking
"""

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

def _extra_dependencies_impl(ctx):
# OWASP Dependencies Check tool
Expand All @@ -18,7 +18,7 @@ def _extra_dependencies_impl(ctx):
urls = [
"https://github.com/jeremylong/DependencyCheck/releases/download/v8.4.3/dependency-check-8.4.3-release.zip",
],
build_file = "//dependency_check:BUILD.dependency_check",
build_file = "//booking/dependency_check:BUILD.dependency_check",
)

bazel_version(name = "bazel_version")
Expand Down
Empty file added booking/repo/BUILD.bazel
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion dependency_check_test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_booking//dependency_check:rules.bzl", "cache", "dependency_check")
load("@rules_booking//booking/dependency_check:rules.bzl", "cache", "dependency_check")
load("@rules_java//java:defs.bzl", "java_binary")

java_binary(
Expand Down
5 changes: 5 additions & 0 deletions e2e/non-bzlmod/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
load("@rules_booking//booking:workspace_status.bzl", "workspace_status")

workspace_status(
name = "workspace_status",
)
4 changes: 2 additions & 2 deletions e2e/non-bzlmod/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ local_repository(
)

load(
"@rules_booking//:repositories.bzl",
"@rules_booking//booking:repositories.bzl",
"repositories",
)

repositories()

load(
"@rules_booking//:dependencies.bzl",
"@rules_booking//booking:dependencies.bzl",
"dependencies",
)

Expand Down
2 changes: 1 addition & 1 deletion remap_tar_test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_booking//:tar.bzl", "remap_tar")
load("@rules_booking//booking:tar.bzl", "remap_tar")
load("@rules_pkg//pkg:verify_archive.bzl", "verify_archive_test")

remap_tar(
Expand Down

0 comments on commit afb8402

Please sign in to comment.