diff --git a/.github/workflows/create_archive_and_notes.sh b/.github/workflows/create_archive_and_notes.sh index f78af7b..a14b734 100755 --- a/.github/workflows/create_archive_and_notes.sh +++ b/.github/workflows/create_archive_and_notes.sh @@ -22,7 +22,6 @@ TAG=${GITHUB_REF_NAME} PREFIX="rules_jsonnet-${TAG}" ARCHIVE="rules_jsonnet-$TAG.tar.gz" git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip > $ARCHIVE -SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}') cat > release_notes.txt << EOF ## Setup @@ -32,33 +31,4 @@ To use the Jsonnet rules, add the following to your \`MODULE.bazel\` file: \`\`\`starlark bazel_dep(name = "rules_jsonnet", version = "${TAG}") \`\`\` - -If you are using an older version of Bazel that does not support Bzlmod, -add the following to your \`WORKSPACE\` file to add the external -repositories for Jsonnet: - -\`\`\`starlark -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "io_bazel_rules_jsonnet", - sha256 = "${SHA}", - strip_prefix = "${PREFIX}", - urls = ["https://github.com/bazelbuild/rules_jsonnet/releases/download/${TAG}/rules_jsonnet-${TAG}.tar.gz", -) - -load("@io_bazel_rules_jsonnet//jsonnet:jsonnet.bzl", "jsonnet_repositories") - -jsonnet_repositories() - -load("@google_jsonnet_go//bazel:repositories.bzl", "jsonnet_go_repositories") - -jsonnet_go_repositories() - -load("@google_jsonnet_go//bazel:deps.bzl", "jsonnet_go_dependencies") - -jsonnet_go_dependencies() - -register_toolchains("@io_bazel_rules_jsonnet//jsonnet:go_jsonnet_toolchain") -\`\`\` EOF diff --git a/README.md b/README.md index b29e274..3a20821 100644 --- a/README.md +++ b/README.md @@ -35,14 +35,11 @@ C++](https://github.com/google/jsonnet) or [Rust](https://github.com/CertainLach/jrsonnet) compiler of Jsonnet instead, register a different compiler: -| Jsonnet compiler | MODULE.bazel directive | WORKSPACE directive | -| ---------------- | --------------------------------- | -------------------------------------------------------------------------------- | -| Go | `jsonnet.compiler(name = "go")` | `register_toolchains("@io_bazel_rules_jsonnet//jsonnet:go_jsonnet_toolchain")` | -| cpp | `jsonnet.compiler(name = "cpp")` | `register_toolchains("@io_bazel_rules_jsonnet//jsonnet:cpp_jsonnet_toolchain")` | -| Rust | `jsonnet.compiler(name = "rust")` | `register_toolchains("@io_bazel_rules_jsonnet//jsonnet:rust_jsonnet_toolchain")` | - -Note that `WORKSPACE` users must register a toolchain manually, using the table -above as reference. +| Jsonnet compiler | MODULE.bazel directive | +| ---------------- | --------------------------------- | +| Go | `jsonnet.compiler(name = "go")` | +| cpp | `jsonnet.compiler(name = "cpp")` | +| Rust | `jsonnet.compiler(name = "rust")` | ### Rust Jsonnet Compiler diff --git a/WORKSPACE b/WORKSPACE deleted file mode 100644 index 33346a4..0000000 --- a/WORKSPACE +++ /dev/null @@ -1,13 +0,0 @@ -workspace(name = "io_bazel_rules_jsonnet") - -load("//jsonnet:jsonnet.bzl", "jsonnet_repositories") - -jsonnet_repositories() - -load("@google_jsonnet_go//bazel:repositories.bzl", "jsonnet_go_repositories") - -jsonnet_go_repositories() - -load("@google_jsonnet_go//bazel:deps.bzl", "jsonnet_go_dependencies") - -jsonnet_go_dependencies(go_sdk_version = "1.17.8") diff --git a/jsonnet/jsonnet.bzl b/jsonnet/jsonnet.bzl index cd804d3..299204e 100644 --- a/jsonnet/jsonnet.bzl +++ b/jsonnet/jsonnet.bzl @@ -13,7 +13,6 @@ # limitations under the License. load("@bazel_skylib//lib:paths.bzl", "paths") load("@bazel_skylib//lib:shell.bzl", "shell") -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") _JSONNET_FILETYPE = [ ".jsonnet", @@ -873,21 +872,3 @@ Example: To run the test: `bazel test //config:invalid_config_test` """, ) - -def jsonnet_repositories(): - """Adds the external dependencies needed for the Jsonnet rules.""" - http_archive( - name = "jsonnet", - sha256 = "85c240c4740f0c788c4d49f9c9c0942f5a2d1c2ae58b2c71068107bc80a3ced4", - strip_prefix = "jsonnet-0.18.0", - urls = [ - "https://github.com/google/jsonnet/archive/v0.18.0.tar.gz", - ], - ) - - http_archive( - name = "google_jsonnet_go", - sha256 = "20fdb3599c2325fb11a63860e7580705590faf732abf47ed144203715bd03a70", - strip_prefix = "go-jsonnet-0d78479d37eabd9451892dd02be2470145b4d4fa", - urls = ["https://github.com/google/go-jsonnet/archive/0d78479d37eabd9451892dd02be2470145b4d4fa.tar.gz"], - )