Git Product home page Git Product logo

codelabs's Introduction

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. Edit the BUILD file for logger.proto

    HintCheck out the compilers attribute for go_proto_library in the grpc example
    HintGo libraries each declare the import path at which they would like to be imported by other go files. server.go imports the proto file at bootcamp/proto/logger so the importpath attribute of go_proto_library should match that.
  2. Edit the BUILD file for server.go

  3. Run the go binary using bazel run

  4. Go to http://localhost:8081 to see results (there won't be any logs yet)

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 5: Typescript web frontend

  1. Edit the WORKSPACE to uncomment the typescript relevant portions
  2. Edit the BUILD file for logger.proto
  3. Edit the BUILD file for app.ts
  4. Run the webserver using bazel run. It will print out a link which you can click on. If the link doesn't work, go to http://localhost:8080 instead
  5. Run the Go server and Java client from the previous steps. Send messages from the Java client to the Go server and see them appear on the web frontend

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

codelabs's People

Contributors

dkelmer avatar meteorcloudy avatar aiuto avatar laszlocsomor avatar rupertks avatar laurentlb avatar dslomov avatar eytankidron avatar meistert avatar yannic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.