Skip to content

Commit

Permalink
Revert jflex_deps() to use maven_jar (#16)
Browse files Browse the repository at this point in the history
* Revert "Replace maven_jar by maven_install for JFlex deps."

This reverts commit a25b375.

`maven_install` can only be loaded in the WORKSPACE, which breaks the simple use of `jflex_deps()`.

* Add sha256 on the JFlex maven_jar
  • Loading branch information
regisd authored Nov 19, 2019
1 parent c786108 commit 08bcc34
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 11 deletions.
6 changes: 4 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
# This WORKSPACE file defines the workspace for the Bazel build system.
# See https://docs.bazel.build/versions/master/build-ref.html#workspace

load("//jflex:deps.bzl", "JFLEX_DEPS")
load("//jflex:deps.bzl", "jflex_deps")
load("//third_party:third_party_deps.bzl", "THIRD_PARTY_ARTIFACTS")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

jflex_deps()

RULES_JVM_EXTERNAL_TAG = "2.10"

RULES_JVM_EXTERNAL_SHA = "1bbf2e48d07686707dd85357e9a94da775e1dbd7c464272b3664283c9c716d26"
Expand All @@ -23,7 +25,7 @@ load("@rules_jvm_external//:defs.bzl", "maven_install")

maven_install(
name = "maven",
artifacts = THIRD_PARTY_ARTIFACTS + JFLEX_DEPS,
artifacts = THIRD_PARTY_ARTIFACTS,
repositories = [
"https://jcenter.bintray.com/",
"https://maven.google.com/",
Expand Down
8 changes: 4 additions & 4 deletions jflex/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ java_binary(
],
)

alias(
java_library(
name = "jflex",
actual = "@maven//:de_jflex_jflex_1_7_0",
exports = ["@de_jflex_jflex_1_7_0//jar"],
)

alias(
java_library(
name = "cup_runtime",
actual = "@maven//:de_jflex_cup_runtime_11b",
exports = ["@de_jflex_cup_runtime_11b//jar"],
)
25 changes: 20 additions & 5 deletions jflex/deps.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
# Copyright 2018-2019 Google LLC.
# Copyright 2018 Google LLC.
# SPDX-License-Identifier: Apache-2.0
JFLEX_DEPS = [
"de.jflex:jflex:1.7.0",
"de.jflex:cup_runtime:11b",
]

def jflex_deps():
"""Bazel macro that iports dependencies used by JFlex."""

native.maven_jar(
name = "de_jflex_jflex_1_7_0",
artifact = "de.jflex:jflex:1.7.0",
repository = "https://jcenter.bintray.com/",
sha256 = "c40e64600f7d29e1618a1c1d5cd697c926ff8495e166ea9416cae19644e37ae6",
sha256_src = "3b18eb44332183ac1fbbf4573da1f2e8a373b71899a9d05a0d70308d5c5a56f3",
)

native.maven_jar(
name = "de_jflex_cup_runtime_11b",
artifact = "de.jflex:cup_runtime:11b",
repository = "https://jcenter.bintray.com/",
sha256 = "9c0b5c93fe0c0e239d5f92affb672cb7c45122c3e3de8cda9513fa8e39dbbc3c",
sha256_src = "7155a72ab7b2d6c1ecf129bcacfbe942d0b490bfe1d634532e5619a836e17591",
)

0 comments on commit 08bcc34

Please sign in to comment.