Skip to content

Commit

Permalink
Made as many dependencies dev dependencies as can be
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaden Peterson committed Dec 6, 2024
1 parent 33cc642 commit bdc6f9f
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 37 deletions.
10 changes: 0 additions & 10 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
load("@buildifier_prebuilt//:rules.bzl", "buildifier")
load(
"@rules_java//toolchains:default_java_toolchain.bzl",
"DEFAULT_JAVACOPTS",
Expand All @@ -16,12 +15,3 @@ default_java_toolchain(
source_version = "21",
target_version = "21",
)

buildifier(
name = "buildifier",
)

buildifier(
name = "buildifier_check",
mode = "check",
)
10 changes: 7 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
module(name = "rules_play_routes")

bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "buildifier_prebuilt", version = "7.3.1")

bazel_dep(name = "buildifier_prebuilt", version = "7.3.1", dev_dependency = True)

bazel_dep(name = "rules_java", version = "7.11.1")
bazel_dep(name = "rules_jvm_external", version = "6.4")
bazel_dep(name = "rules_pkg", version = "1.0.1")

bazel_dep(name = "rules_pkg", version = "1.0.1", dev_dependency = True)

bazel_dep(name = "rules_scala_annex")

rules_scala_annex_version = "bzlmod-migration"
Expand All @@ -16,7 +20,7 @@ archive_override(
urls = ["https://github.com/lucidsoftware/rules_scala/archive/refs/heads/{}.zip".format(rules_scala_annex_version)],
)

bazel_dep(name = "stardoc", version = "0.7.1")
bazel_dep(name = "stardoc", version = "0.7.1", dev_dependency = True)

register_toolchains(
"//:repository_default_toolchain_21_definition",
Expand Down
10 changes: 10 additions & 0 deletions dev/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@buildifier_prebuilt//:rules.bzl", "buildifier")

buildifier(
name = "buildifier",
)

buildifier(
name = "buildifier_check",
mode = "check",
)
30 changes: 30 additions & 0 deletions dev/stardoc/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
load("@bazel_skylib//lib:paths.bzl", "paths")
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("@stardoc//stardoc:stardoc.bzl", "stardoc")

bzl_files = ["//play-routes:play-routes.bzl"]

[
stardoc(
name = paths
.replace_extension(file, "_doc")
.removeprefix("//play-routes:")
.replace("/", "_"),
out = paths.replace_extension(file, ".md").removeprefix("//play-routes:").replace("/", "_"),
input = file,
symbol_names = ["play_routes"],
deps = [
"//play-routes:bzl_internal",
],
)
for file in bzl_files
]

pkg_tar(
name = "docs",
srcs = [
paths.replace_extension(file, ".md").removeprefix("//play-routes:").replace("/", "_")
for file in bzl_files
],
mode = "0644",
)
22 changes: 1 addition & 21 deletions play-routes/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@bazel_skylib//lib:paths.bzl", "paths")
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("@stardoc//stardoc:stardoc.bzl", "stardoc")

[
stardoc(
name = paths.replace_extension(file, "_doc").replace("/", "_"),
out = paths.replace_extension(file, ".md").replace("/", "_"),
input = file,
symbol_names = ["play_routes"],
deps = [
"//play-routes:bzl_internal",
],
)
for file in glob(["**/*.bzl"])
]

pkg_tar(
name = "docs",
srcs = [paths.replace_extension(file, ".md").replace("/", "_") for file in glob(["**/*.bzl"])],
mode = "0644",
)
exports_files(["play-routes.bzl"])

bzl_library(
name = "bzl_internal",
Expand Down
4 changes: 2 additions & 2 deletions scripts/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -euo pipefail

if [ "$#" -eq 0 ] || [ "$1" != check ]; then
bazel run buildifier
bazel run //dev:buildifier
else
bazel run buildifier_check
bazel run //dev:buildifier_check
fi
2 changes: 1 addition & 1 deletion scripts/gen-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set -euxo pipefail
rm -fr docs/stardoc
mkdir -p docs/stardoc

bazel build play-routes:docs
bazel build //dev/stardoc:docs
tar xf "$(bazel info bazel-bin)/play-routes/docs.tar" -C docs/stardoc
find docs/stardoc -size 0 -print0 | while read path; do
rm $path
Expand Down

0 comments on commit bdc6f9f

Please sign in to comment.