{"id":19933780,"url":"https://github.com/bazelbuild/codelabs","last_synced_at":"2025-05-03T11:33:54.478Z","repository":{"id":38807913,"uuid":"152009142","full_name":"bazelbuild/codelabs","owner":"bazelbuild","description":null,"archived":true,"fork":false,"pushed_at":"2022-06-02T21:03:00.000Z","size":133,"stargazers_count":41,"open_issues_count":19,"forks_count":36,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-03-16T13:26:53.894Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bazelbuild.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null}},"created_at":"2018-10-08T02:44:59.000Z","updated_at":"2024-11-28T12:37:00.000Z","dependencies_parsed_at":"2022-09-18T10:33:48.174Z","dependency_job_id":null,"html_url":"https://github.com/bazelbuild/codelabs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Fcodelabs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Fcodelabs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Fcodelabs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Fcodelabs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bazelbuild","download_url":"https://codeload.github.com/bazelbuild/codelabs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252185988,"owners_count":21708249,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T23:14:52.403Z","updated_at":"2025-05-03T11:33:54.198Z","avatar_url":"https://github.com/bazelbuild.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bazel Codelab\n\n## Before you get started\nTake a look at these [informational slides](https://docs.google.com/presentation/d/1vNuuY97NmxP85MLEheYcMDHbpFb6cwSYWPNloBqdrPM/edit#slide=id.p) to learn about Bazel.\n\n## Section 1: Hello, Bazel!\n\n1.  Edit: `java/src/main/java/bazel/bootcamp/BUILD`\n1.  Add a `java_binary` target for the `HelloBazelBootcamp.java` file\n    - [`java_binary` documentation](https://docs.bazel.build/versions/master/be/java.html#java_binary)\n1.  Run the binary using `bazel run //java/src/main/java/bazel/bootcamp:HelloBazelBootcamp`\n\n## Section 2: Go server\n1.  Edit the `BUILD` file for `logger.proto`\n    - [`proto_library` documentation](https://docs.bazel.build/versions/master/be/protocol-buffer.html#proto_library)\n    - [`go_proto_library` documentation](https://github.com/bazelbuild/rules_go/blob/master/proto/core.rst#example-grpc)\n    \u003cdetails\u003e \u003csummary\u003eHint\u003c/summary\u003eCheck out the \u003ccode\u003ecompilers\u003c/code\u003e attribute for \u003ccode\u003ego_proto_library\u003c/code\u003e in the grpc example\u003c/details\u003e\n    \u003cdetails\u003e \u003csummary\u003eHint\u003c/summary\u003eGo libraries each declare the import path at which they would like to be imported by other go files. \u003ccode\u003eserver.go\u003c/code\u003e imports the proto file at \u003ccode\u003ebootcamp/proto/logger\u003c/code\u003e so the \u003ccode\u003eimportpath\u003c/code\u003e attribute of \u003ccode\u003ego_proto_library\u003c/code\u003e should match that.\u003c/details\u003e\n    \n1.  Edit the `BUILD` file for `server.go`\n    - [`go_binary` documentation](https://github.com/bazelbuild/rules_go/blob/master/go/core.rst#go_binary)    \n1.  Run the go binary using `bazel run`\n1.  Go to http://localhost:8081 to see results (there won't be any logs yet)\n\n## Section 3: Java client\n\n1.  Edit the `BUILD` file for `logger.proto`\n    - [`java_proto_library` documentation](https://docs.bazel.build/versions/master/be/java.html#java_proto_library)\n    - [`java_grpc_library` documentation](https://grpc.io/docs/reference/java/generated-code.html) (look towards the\n      bottom of the page for Bazel related documentation)\n1.  Edit the `BUILD` file for `JavaLoggingClientLibrary.java`\n    - [`java_library` documentation](https://docs.bazel.build/versions/master/be/java.html#java_library)\n1.  Edit the `BUILD` file for `JavaLoggingClient.java`\n    - [`java_binary` documentation](https://docs.bazel.build/versions/master/be/java.html#java_binary)\n1.  `bazel run` the Java binary you wrote\n1.  `bazel run` the Go binary from Section 2\n1.  Send messages from the client to the server and view them on http://localhost:8081\n\n## Section 4: Java client unit tests\n1.  Edit the `BUILD` file for `JavaLoggingClientLibraryTest.java`\n    - [`java_test` documentation](https://docs.bazel.build/versions/master/be/java.html#java_test)\n    \u003cdetails\u003e \u003csummary\u003eHint\u003c/summary\u003eNames matter for tests. The \u003ccode\u003ejava_test\u003c/code\u003e for this file should be named \u003ccode\u003eJavaLoggingClientLibraryTest\u003c/code\u003e\u003c/details\u003e\n1.  Edit the `BUILD` file for `JavaLoggingClientTest.java`\n1.  Run the tests using `bazel test`\n\n## Section 5: Typescript web frontend\n1.  Edit the `WORKSPACE` to uncomment the typescript relevant portions\n1.  Edit the `BUILD` file for `logger.proto`\n    - [`ts_proto_library` documentation](https://www.npmjs.com/package/@bazel/typescript#ts_proto_library)\n1.  Edit the `BUILD` file for `app.ts`\n    - [`ts_library` usage example](https://www.npmjs.com/package/@bazel/typescript#compiling-typescript-ts_library) and        [`ts_library` documentation](https://www.npmjs.com/package/@bazel/typescript#ts_library)\n1.  Run the webserver using `bazel run`. It will print out a link which you can click on.\n    If the link doesn't work, go to http://localhost:8080 instead\n1.  Run the Go server and Java client from the previous steps. Send messages from the Java\n    client to the Go server and see them appear on the web frontend\n    \n## Section 6: Integration test\n1.  Edit the `BUILD` file for `integrationtest.sh`\n    - [`sh_test` documentation](https://docs.bazel.build/versions/master/be/shell.html#sh_test)\n1.  Run the test using `bazel test` and make sure that it passes\n1.  Run the test using `bazel test \u003ctarget\u003e --runs_per_test=10` and make sure that it passes\n    \u003cdetails\u003e \u003csummary\u003eHint\u003c/summary\u003eYou may need to modify the \u003ccode\u003eBUILD\u003c/code\u003e file again to make this work\u003c/details\u003e\n\n## Section 7: Query\n1.  https://docs.bazel.build/versions/master/query-how-to.html\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbazelbuild%2Fcodelabs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbazelbuild%2Fcodelabs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbazelbuild%2Fcodelabs/lists"}