mkdir src/main/java/com/example/cmdline
should be
mkdir -p src/main/java/com/example/cmdline
This command
bazel build //src/main/java/com/example/cmdline:runner
seems to be wrong:
~/p/b/e/cmdline % bazel build //src/main/java/com/example/cmdline:runner
ERROR: no such package 'src/main/java/com/example/cmdline': BUILD file not found on package path
INFO: Elapsed time: 0.088s
This seemed to give the expected result:
~/p/b/e/cmdline % bazel build //cmdline:runner
ERROR: /Users/aove215/projects/bazel/ex1/cmdline/BUILD:2:1: Target '//:greeter' is not visible from target '//cmdline:runner'. Check the visibility declaration of the former target if you think the dependency is legitimate.
ERROR: Analysis of target '//cmdline:runner' failed; build aborted.
INFO: Elapsed time: 0.334s
mkdir src/main/java/com/example/cmdline
should be
mkdir -p src/main/java/com/example/cmdline
This commandbazel build //src/main/java/com/example/cmdline:runnerseems to be wrong:
~/p/b/e/cmdline % bazel build //src/main/java/com/example/cmdline:runner
ERROR: no such package 'src/main/java/com/example/cmdline': BUILD file not found on package path