Skip to content

Commit

Permalink
Replace bazel_deps with rules_jvm_external (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
borkaehw authored Apr 21, 2019
1 parent 06672f7 commit 542e990
Show file tree
Hide file tree
Showing 15 changed files with 69 additions and 3,780 deletions.
Empty file removed 3rdparty/BUILD
Empty file.
1,280 changes: 0 additions & 1,280 deletions 3rdparty/maven.bzl

This file was deleted.

2,375 changes: 0 additions & 2,375 deletions 3rdparty/test_maven.bzl

This file was deleted.

9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ http_archive(
url = "https://github.com/lucidsoftware/rules_play_routes/archive/{}.zip".format(rules_play_routes_version),
)

RULES_JVM_EXTERNAL_TAG = "2.0.1"
http_archive(
name = "rules_jvm_external",
sha256 = "55e8d3951647ae3dffde22b4f7f8dee11b3f70f3f89424713debd7076197eaca",
strip_prefix = "rules_jvm_external-{}".format(RULES_JVM_EXTERNAL_TAG),
type = "zip",
url = "https://github.com/bazelbuild/rules_jvm_external/archive/{}.zip".format(RULES_JVM_EXTERNAL_TAG),
)

load("@io_bazel_rules_play_routes//:workspace.bzl", "play_routes_repositories")
play_routes_repositories()
```
Expand Down
9 changes: 9 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ http_archive(
url = "https://github.com/protocolbuffers/protobuf/archive/{}.zip".format(protobuf_version),
)

RULES_JVM_EXTERNAL_TAG = "2.0.1"
http_archive(
name = "rules_jvm_external",
sha256 = "55e8d3951647ae3dffde22b4f7f8dee11b3f70f3f89424713debd7076197eaca",
strip_prefix = "rules_jvm_external-{}".format(RULES_JVM_EXTERNAL_TAG),
type = "zip",
url = "https://github.com/bazelbuild/rules_jvm_external/archive/{}.zip".format(RULES_JVM_EXTERNAL_TAG),
)

load("//:workspace.bzl", "play_routes_repositories")
play_routes_repositories()

Expand Down
40 changes: 0 additions & 40 deletions dependencies.yml

This file was deleted.

8 changes: 0 additions & 8 deletions gen-deps.sh

This file was deleted.

6 changes: 3 additions & 3 deletions play-routes-compiler/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ scala_binary(
scalacopts = ["-Ywarn-unused-import"],
main_class = "rulesplayroutes.routes.CommandLinePlayRoutesCompiler",
deps = [
"@play_routes_com_typesafe_play_routes_compiler_2_11//jar",
"@play_routes_com_github_scopt_scopt_2_11//jar",
"@play_routes_org_scala_lang_scala_reflect",
"@play_routes//:com_typesafe_play_routes_compiler_2_11",
"@play_routes//:com_github_scopt_scopt_2_11",
"@play_routes//:org_scala_lang_scala_reflect",
],
)
12 changes: 6 additions & 6 deletions scala/BUILD → scala/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ load(
scala_version = "2.11.12"

compiler_classpath = [
"@play_routes_org_scala_lang_scala_compiler//jar",
"@play_routes_org_scala_lang_scala_library//jar",
"@play_routes_org_scala_lang_scala_reflect//jar",
"@play_routes//:org_scala_lang_scala_compiler",
"@play_routes//:org_scala_lang_scala_library",
"@play_routes//:org_scala_lang_scala_reflect",
]

runtime_classpath = [
"@play_routes_org_scala_lang_scala_library//jar",
"@play_routes//:org_scala_lang_scala_library",
]

configure_bootstrap_scala(
Expand All @@ -33,8 +33,8 @@ scala_library(
scala = ":bootstrap",
visibility = ["//visibility:public"],
deps = compiler_classpath + [
"@play_routes_org_scala_sbt_compiler_interface//jar",
"@play_routes_org_scala_sbt_util_interface//jar",
"@play_routes//:org_scala_sbt_compiler_interface",
"@play_routes//:org_scala_sbt_util_interface",
],
)

Expand Down
17 changes: 0 additions & 17 deletions setup-tools.sh

This file was deleted.

29 changes: 0 additions & 29 deletions test-dependencies.yml

This file was deleted.

14 changes: 7 additions & 7 deletions test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ scala_test(
# ":play-routes-namespace-router",
],
deps = [
"@org_specs2_specs2_common_2_11//jar",
"@org_specs2_specs2_core_2_11",
"@org_specs2_specs2_matcher_2_11//jar",
"@com_typesafe_akka_akka_actor_2_11//jar",
"@com_typesafe_play_play_2_11//jar",
"@com_typesafe_play_play_specs2_2_11//jar",
"@com_typesafe_play_play_test_2_11//jar",
"@play_routes_test//:org_specs2_specs2_common_2_11",
"@play_routes_test//:org_specs2_specs2_core_2_11",
"@play_routes_test//:org_specs2_specs2_matcher_2_11",
"@play_routes_test//:com_typesafe_akka_akka_actor_2_11",
"@play_routes_test//:com_typesafe_play_play_2_11",
"@play_routes_test//:com_typesafe_play_play_specs2_2_11",
"@play_routes_test//:com_typesafe_play_play_test_2_11",
]
)
24 changes: 17 additions & 7 deletions test_workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@
Load test 3rd party maven dependencies
"""

load("@bazel_tools//tools/build_defs/repo:java.bzl", "java_import_external")
load("//3rdparty:test_maven.bzl", "list_dependencies")
load("@rules_jvm_external//:defs.bzl", "maven_install")

def play_routes_test_repositories():
for dep in list_dependencies():
if "exports" in dep["import_args"]:
dep["import_args"]["deps"] = dep["import_args"]["exports"]
dep["import_args"].pop("exports")
java_import_external(**dep["import_args"])
maven_install(
name = "play_routes_test",
artifacts = [
"org.specs2:specs2-common_2.11:3.6.6",
"org.specs2:specs2-core_2.11:3.6.6",
"org.specs2:specs2-matcher_2.11:3.6.6",
"com.typesafe.akka:akka-actor_2.11:2.4.20",
"com.typesafe.play:play_2.11:2.5.19",
"com.typesafe.play:play-test_2.11:2.5.19",
"com.typesafe.play:play-specs2_2.11:2.5.19",
],
repositories = [
"http://central.maven.org/maven2",
],
fetch_sources = True,
)
2 changes: 1 addition & 1 deletion tools/skylint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
echo "Running Skylint"
skylint_path=src/tools/skylark/java/com/google/devtools/skylark/skylint
bazel build @io_bazel//${skylint_path}:Skylint \
&& find "$(bazel info workspace)" -type f -name '*.bzl' -path ./3rdparty -prune \
&& find "$(bazel info workspace)" -type f -name '*.bzl' \
-a -not -path "$(bazel info workspace)/external-tools*" \
| xargs "$(bazel info bazel-bin)/external/io_bazel/${skylint_path}/Skylint"
24 changes: 17 additions & 7 deletions workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@
Load 3rd party maven dependencies
"""

load("@bazel_tools//tools/build_defs/repo:java.bzl", "java_import_external")
load("//3rdparty:maven.bzl", "list_dependencies")
load("@rules_jvm_external//:defs.bzl", "maven_install")

def play_routes_repositories():
for dep in list_dependencies():
if "exports" in dep["import_args"]:
dep["import_args"]["deps"] = dep["import_args"]["exports"]
dep["import_args"].pop("exports")
java_import_external(**dep["import_args"])
maven_install(
name = "play_routes",
artifacts = [
"com.github.scopt:scopt_2.11:3.7.0",
"com.typesafe.play:routes-compiler_2.11:2.5.19",
"org.scala-sbt:zinc_2.11:1.2.1",
"org.scala-sbt:compiler-interface:1.2.1",
"org.scala-sbt:util-interface:1.2.0",
"org.scala-lang:scala-compiler:2.11.12",
"org.scala-lang:scala-library:2.11.12",
"org.scala-lang:scala-reflect:2.11.12",
],
repositories = [
"http://central.maven.org/maven2",
],
)

0 comments on commit 542e990

Please sign in to comment.