Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Add script to undo build file generation #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions create_initial_build_file_state.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# This file is used to generate the BUILD files for their
# initial state before submitting changes.

# You can use it after running generate_build_files.sh to test
# your changes.


# Revert go BUILD file
cat > go/cmd/server/BUILD <<EOF
load("@io_bazel_rules_go//go:def.bzl", "go_binary")

# deps
# "@com_github_golang_protobuf//jsonpb:go_default_library_gen",
# "@org_golang_google_grpc//:go_default_library",
# "@org_golang_google_grpc//reflection:go_default_library",
EOF


# Revert java BUILD file
cat > java/src/main/java/bazel/bootcamp/BUILD <<EOF
# deps you may need for various targets
# "@io_grpc_grpc_java//core",
# "@io_grpc_grpc_java//netty",
# "@junit_junit//jar" - optional
EOF


# Revert 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")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
# load("@build_bazel_rules_typescript//:defs.bzl", "ts_proto_library")
EOF


# Revert shell test
> tests/BUILD


# Revert typescript BUILD file
cat > typescript/BUILD <<EOF
# load("@npm_bazel_typescript//:index.bzl", "ts_library", "ts_devserver")

exports_files(["tsconfig.json"])

# ts_devserver(
# name = "devserver",
# bootstrap = ["@npm_bazel_typescript//:protobufjs_bootstrap_scripts"],
# entry_module = "bootcamp/typescript/app",
# port = 8080,
# deps = [":app"],
# )
EOF


# Write the WORKSPACE file
${SHELL} ./create_initial_workspace_file_state.sh

93 changes: 93 additions & 0 deletions create_initial_workspace_file_state.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# This file is used to generate the WORKSPACE file for its
# initial state before submitting changes.

# You can use it after running generate_build_files.sh to test
# your changes.

# Write the WORKSPACE file
cat > WORKSPACE <<EOF
workspace(name = "bootcamp")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# grpc dependencies
http_archive(
name = "io_grpc_grpc_java",
urls = [
"https://github.com/grpc/grpc-java/archive/v1.22.1.tar.gz",
],
sha256 = "6e63bd6f5a82de0b84c802390adb8661013bad9ebf910ad7e1f3f72b5f798832",
strip_prefix = "grpc-java-1.22.1",
)
load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories")
grpc_java_repositories()


# go dependencies
http_archive(
name = "io_bazel_rules_go",
urls = [
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/0.19.1/rules_go-0.19.1.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/0.19.1/rules_go-0.19.1.tar.gz",
],
sha256 = "8df59f11fb697743cbb3f26cfb8750395f30471e9eabde0d174c3aebc7a1cd39",
)
load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains")
go_rules_dependencies()
go_register_toolchains()

http_archive(
name = "bazel_gazelle",
urls = [
"https://github.com/bazelbuild/bazel-gazelle/releases/download/0.18.1/bazel-gazelle-0.18.1.tar.gz",
],
sha256 = "be9296bfd64882e3c08e3283c58fcb461fa6dd3c171764fcc4cf322f60615a9b",
)
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
gazelle_dependencies()

go_repository(
name = "org_golang_google_grpc",
build_file_proto_mode = "disable",
importpath = "google.golang.org/grpc",
sum = "h1:J0UbZOIrCAl+fpTOf8YLs4dJo8L/owV4LYVtAXQoPkw=",
version = "v1.22.0",
)
go_repository(
name = "org_golang_x_net",
importpath = "golang.org/x/net",
sum = "h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=",
version = "v0.0.0-20190311183353-d8887717615a",
)
go_repository(
name = "org_golang_x_text",
importpath = "golang.org/x/text",
sum = "h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=",
version = "v0.3.0",
)


# BEGIN: typescript dependencies
#http_archive(
# name = "build_bazel_rules_nodejs",
# urls = [
# "https://github.com/bazelbuild/rules_nodejs/releases/download/0.35.0/rules_nodejs-0.35.0.tar.gz",
# ],
# sha256 = "6625259f9f77ef90d795d20df1d0385d9b3ce63b6619325f702b6358abb4ab33",
#)

#load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install")

#yarn_install(
# name = "npm",
# package_json = "//typescript:package.json",
# yarn_lock = "//typescript:yarn.lock",
#)
#
#load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies")
#install_bazel_dependencies()
#
#load("@npm_bazel_typescript//:index.bzl", "ts_setup_workspace")
#ts_setup_workspace()
# END: typescript dependencies
EOF
2 changes: 1 addition & 1 deletion go/cmd/server/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ load("@io_bazel_rules_go//go:def.bzl", "go_binary")
# deps
# "@com_github_golang_protobuf//jsonpb:go_default_library_gen",
# "@org_golang_google_grpc//:go_default_library",
# "@org_golang_google_grpc//reflection:go_default_library",
# "@org_golang_google_grpc//reflection:go_default_library",
2 changes: 1 addition & 1 deletion java/src/main/java/bazel/bootcamp/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# deps you may need for various targets
# "@io_grpc_grpc_java//core",
# "@io_grpc_grpc_java//netty",
# "@junit_junit//jar" - optional
# "@junit_junit//jar" - optional
2 changes: 1 addition & 1 deletion proto/logger/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ package(default_visibility = ["//visibility:public"])

load("@io_grpc_grpc_java//:java_grpc_library.bzl", "java_grpc_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
# load("@build_bazel_rules_typescript//:defs.bzl", "ts_proto_library")
# load("@build_bazel_rules_typescript//:defs.bzl", "ts_proto_library")
1 change: 0 additions & 1 deletion typescript/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ exports_files(["tsconfig.json"])
# port = 8080,
# deps = [":app"],
# )