Instructions for Bazel do not work
See original GitHub issueFollowing the instructions in the main readme for Bazel do not work.
I am getting this:
ERROR: Analysis of target '//:Main' failed; build aborted: no such package '@com_google_dagger//': BUILD file not found on package path
WORKSPACE:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "com_google_dagger",
urls = ["https://github.com/google/dagger/archive/dagger-2.21.zip"],
)
maven_jar(
name = "org_json",
artifact = "org.json:json:20141113",
)
maven_jar(
name = "com_google_guava_guava",
artifact = "com.google.guava:guava:21.0",
sha1 = "3a3d111be1be1b745edfa7d91678a12d7ed38709",
)
maven_jar(
name = "com_google_guava_guava_testlib",
artifact = "com.google.guava:guava-testlib:21.0-rc1",
sha1 = "13f0f0dce4e710bb0bb791bd07f6e9858670a865",
)
BUILD:
java_binary(
name = "Main",
srcs =
glob(["src/**/*.java"]),
deps = [
"@org_json//jar",
"@com_google_guava_guava//jar",
"@com_google_dagger//:dagger_with_compiler",
]
)
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
Commands and Options | Bazel
This page covers the options that are available with various Bazel commands, such as bazel build , bazel run , and bazel test...
Read more >User's Guide - Bazel 0.21.0
A User's Guide to Bazel. To run Bazel, go to your base workspace directory or any of its subdirectories and type bazel ....
Read more >Rules Tutorial | Bazel
"bzl file evaluation" is printed first. Before evaluating the BUILD file, Bazel evaluates all the files it loads. If multiple BUILD files are...
Read more >User Manual - Bazel 0.17.1
When running bazel , the client first checks that the server is the appropriate version; if not, the server is stopped and a...
Read more >Command-Line Reference | Bazel
If set to true, the top level aspect will honor its required providers and only run on top level targets whose rules' advertised...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this issue should be reopened. The instructions on the readme for using Dagger with Bazel are still as the original poster described, and they still produce the same results when you try to follow them.
The instructions that were added by @ronshapiro at https://github.com/google/dagger/issues/1422#issuecomment-483740264 as the reason for closing this issue appear to be for setting up your development environment for hacking on dagger itself, not for using it in another project.
The instructions posted by @mancini0 at https://github.com/google/dagger/issues/1422#issuecomment-513581156 do appear to work, so if there is no way to update the instructions in the current readme so that they do work, maybe they should be changed to follow the alternate approach his example lays out.
@austince, coincidentally, we’re working on this now. I’ll update the docs once this is in.
We’ll be using
rules_jvm_external
/maven_install
for the macro, but that should just be an implementation detail for users calling the macro.