forked from bazelbuild/codelabs
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add a cache build step to container build * Add postcreate * Changing lifecycle hook to prebuild cache
- Loading branch information
1 parent
13df421
commit 46381cd
Showing
3 changed files
with
71 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/bin/bash | ||
|
||
# generate java BUILD file | ||
cat > java/src/main/java/bazel/bootcamp/BUILD <<EOF | ||
java_binary( | ||
name = "HelloBazelBootcamp", | ||
srcs = ["HelloBazelBootcamp.java"], | ||
) | ||
java_library( | ||
name = "JavaLoggingClientLibrary", | ||
srcs = ["JavaLoggingClientLibrary.java"], | ||
deps = [ | ||
"//proto/logger:logger_java_proto", | ||
"//proto/logger:logger_java_grpc", | ||
"@io_grpc_grpc_java//core", | ||
"@io_grpc_grpc_java//netty", | ||
] | ||
) | ||
java_binary( | ||
name = "JavaLoggingClient", | ||
srcs = ["JavaLoggingClient.java"], | ||
deps = [":JavaLoggingClientLibrary"], | ||
visibility = ["//visibility:public"] | ||
) | ||
java_test( | ||
name = "JavaLoggingClientLibraryTest", | ||
srcs = ["JavaLoggingClientLibraryTest.java"], | ||
deps = [":JavaLoggingClientLibrary"] | ||
) | ||
java_test( | ||
name = "JavaLoggingClientTest", | ||
srcs = ["JavaLoggingClientTest.java"], | ||
deps = [":JavaLoggingClient"] | ||
) | ||
EOF | ||
|
||
|
||
# generate proto BUILD file | ||
cat > proto/logger/BUILD <<EOF | ||
package(default_visibility = ["//visibility:public"]) | ||
load("@io_grpc_grpc_java//:java_grpc_library.bzl", "java_grpc_library") | ||
proto_library( | ||
name = "logger_proto", | ||
srcs = ["logger.proto"] | ||
) | ||
java_proto_library( | ||
name = "logger_java_proto", | ||
deps = [":logger_proto"] | ||
) | ||
java_grpc_library( | ||
name = "logger_java_grpc", | ||
srcs = [":logger_proto"], | ||
deps = [":logger_java_proto"], | ||
) | ||
EOF | ||
|
||
bazel run //:gazelle | ||
bazel build //... | ||
git reset --hard | ||
git clean -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters