Skip to content

umbrellacorp-sales/codelabs

 
 

Repository files navigation

Bazel Codelab

Before you get started

Take a look at these informational slides to learn about Bazel.

Section 1: Hello, Bazel!

  1. Edit: java/src/main/java/bazel/bootcamp/BUILD
  2. Add a java_binary target for the HelloBazelBootcamp.java file
  3. Run the binary using bazel run //java/src/main/java/bazel/bootcamp:HelloBazelBootcamp

Section 2: Go server

  1. The Go BUILD files can be fully generated by Gazelle. Run gazelle with bazel run //:gazelle
  2. Run the go binary using bazel run //go/cmd/server
  3. Go to http://localhost:8081 to see results (there won't be any logs yet): curl http://localhost:8081

Section 3: Java client

  1. Edit the BUILD file for logger.proto
  2. Edit the BUILD file for JavaLoggingClientLibrary.java
  3. Edit the BUILD file for JavaLoggingClient.java
  4. bazel run the Java binary you wrote
  5. bazel run the Go binary from Section 2
  6. Send messages from the client to the server and view them on http://localhost:8081

Section 4: Java client unit tests

  1. Edit the BUILD file for JavaLoggingClientLibraryTest.java
    HintNames matter for tests. The java_test for this file should be named JavaLoggingClientLibraryTest
  2. Edit the BUILD file for JavaLoggingClientTest.java
  3. Run the tests using bazel test

Section 6: Integration test

  1. Edit the BUILD file for integrationtest.sh
  2. Run the test using bazel test and make sure that it passes
  3. Run the test using bazel test <target> --runs_per_test=10 and make sure that it passes
    HintYou may need to modify the BUILD file again to make this work

Section 7: Query

  1. https://docs.bazel.build/versions/master/query-how-to.html

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Starlark 38.4%
  • Shell 25.1%
  • Java 20.6%
  • TypeScript 8.1%
  • Go 7.8%