|
| 1 | +"""EngFlow example project""" |
| 2 | + |
| 3 | +module(name = "engflow-example", version = "0.0.0") |
| 4 | +http_file = use_repo_rule( |
| 5 | + "@bazel_tools//tools/build_defs/repo:http.bzl", "http_file" |
| 6 | +) |
| 7 | +http_archive = use_repo_rule( |
| 8 | + "@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive" |
| 9 | +) |
| 10 | + |
| 11 | +# Some file dependencies |
| 12 | +http_file( |
| 13 | + name = "emacs", |
| 14 | + sha256 = "1439bf7f24e5769f35601dbf332e74dfc07634da6b1e9500af67188a92340a28", |
| 15 | + urls = [ |
| 16 | + "https://storage.googleapis.com/engflow-tools-public/emacs-28.1.tar.gz", |
| 17 | + "https://mirror.its.dal.ca/gnu/emacs/emacs-28.1.tar.gz", |
| 18 | + "https://mirrors.kernel.org/gnu/emacs/emacs-28.1.tar.gz", |
| 19 | + ], |
| 20 | +) |
| 21 | + |
| 22 | +http_file( |
| 23 | + name = "ubuntu_20.04_1.3GB", |
| 24 | + sha256 = "5035be37a7e9abbdc09f0d257f3e33416c1a0fb322ba860d42d74aa75c3468d4", |
| 25 | + urls = [ |
| 26 | + "https://storage.googleapis.com/engflow-tools-public/ubuntu-20.04.5-live-server-amd64.iso", |
| 27 | + "https://mirror.math.princeton.edu/pub/ubuntu-iso/focal/ubuntu-20.04.5-live-server-amd64.iso", |
| 28 | + "https://mirror.pit.teraswitch.com/ubuntu-releases/focal/ubuntu-20.04.5-live-server-amd64.iso", |
| 29 | + ], |
| 30 | +) |
| 31 | + |
| 32 | +http_archive( |
| 33 | + name = "com_engflow_engflowapis", |
| 34 | + sha256 = "8721f7a0ec52c5bc120119aac090eedd671ca3b708652f88b82b44bea2b6c278", |
| 35 | + strip_prefix = "engflowapis-44fcd39598f223e8e5f6c7cbf2f73c870b2a6341", |
| 36 | + urls = [ |
| 37 | + "https://github.com/EngFlow/engflowapis/archive/44fcd39598f223e8e5f6c7cbf2f73c870b2a6341.zip", |
| 38 | + ], |
| 39 | +) |
| 40 | + |
| 41 | +# Abseil Python can be imported through pip_import, but it has native Bazel support too. |
| 42 | +# bzlmod: https://github.com/abseil/abseil-py/issues/263 |
| 43 | +http_archive( |
| 44 | + name = "io_abseil_py", |
| 45 | + sha256 = "8a3d0830e4eb4f66c4fa907c06edf6ce1c719ced811a12e26d9d3162f8471758", |
| 46 | + strip_prefix = "abseil-py-2.1.0", |
| 47 | + url = "https://github.com/abseil/abseil-py/archive/refs/tags/v2.1.0.tar.gz", |
| 48 | +) |
| 49 | + |
| 50 | +bazel_dep(name = "bazel_skylib", version = "1.5.0") |
| 51 | +bazel_dep( |
| 52 | + name = "protobuf", |
| 53 | + version = "23.1", |
| 54 | + repo_name = "com_google_protobuf", |
| 55 | +) |
| 56 | + |
| 57 | +# https://github.com/googleapis/googleapis/pull/855 |
| 58 | +# https://github.com/bazelbuild/bazel-central-registry/pull/1699 |
| 59 | +bazel_dep( |
| 60 | + name = "googleapis", |
| 61 | + version = "0.0.0-20240326-1c8d509c5", |
| 62 | + repo_name = "com_google_googleapis", |
| 63 | +) |
| 64 | + |
| 65 | +bazel_dep(name = "rules_python", version = "0.31.0") |
| 66 | + |
| 67 | +pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") |
| 68 | + |
| 69 | +pip.parse( |
| 70 | + hub_name = "pip", |
| 71 | + python_version = "3.11", |
| 72 | + requirements_lock = "//python:requirements_lock.txt", |
| 73 | +) |
| 74 | + |
| 75 | +use_repo(pip, "pip") |
| 76 | + |
| 77 | +bazel_dep(name = "rules_proto", version = "6.0.0-rc2") |
| 78 | + |
| 79 | +bazel_dep( |
| 80 | + name = "apple_support", |
| 81 | + version = "1.15.1", |
| 82 | + repo_name = "build_bazel_apple_support", |
| 83 | +) |
| 84 | + |
| 85 | +bazel_dep(name = "rules_dotnet", version = "0.15.1") |
| 86 | + |
| 87 | +dotnet = use_extension("@rules_dotnet//dotnet:extensions.bzl", "dotnet") |
| 88 | +dotnet.toolchain(dotnet_version = "8.0.200") |
| 89 | +use_repo(dotnet, "dotnet_toolchains") |
| 90 | + |
| 91 | +register_toolchains("@dotnet_toolchains//:all") |
| 92 | + |
| 93 | +# https://github.com/bazelbuild/rules_go/blob/master/docs/go/core/bzlmod.md |
| 94 | +bazel_dep(name = "rules_go", version = "0.46.0") |
| 95 | +bazel_dep(name = "gazelle", version = "0.36.0") |
| 96 | + |
| 97 | +GO_PLATFORMS = [ |
| 98 | + ("darwin", "amd64"), |
| 99 | + ("darwin", "arm64"), |
| 100 | + ("linux", "amd64"), |
| 101 | + ("linux", "arm64"), |
| 102 | + ("windows", "amd64"), |
| 103 | +] |
| 104 | + |
| 105 | +GO_VERSION = "1.21.6" |
| 106 | + |
| 107 | +go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") |
| 108 | + |
| 109 | +[ |
| 110 | + go_sdk.download( |
| 111 | + name = "go_{}_{}".format(goos, goarch), |
| 112 | + goarch = goarch, |
| 113 | + goos = goos, |
| 114 | + version = GO_VERSION, |
| 115 | + ) |
| 116 | + for goos, goarch in GO_PLATFORMS |
| 117 | +] |
| 118 | + |
| 119 | +go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") |
| 120 | +go_deps.from_file(go_mod = "//:go.mod") |
| 121 | + |
| 122 | +use_repo(go_deps, "com_github_google_go_cmp") |
| 123 | + |
| 124 | +bazel_dep(name = "rules_java", version = "7.5.0") |
| 125 | + |
| 126 | +# https://github.com/bazelbuild/rules_jvm_external/blob/master/docs/bzlmod.md |
| 127 | +bazel_dep(name = "rules_jvm_external", version = "6.0") |
| 128 | +bazel_dep( |
| 129 | + name = "grpc-java", |
| 130 | + version = "1.62.2", |
| 131 | + repo_name = "io_grpc_grpc_java", |
| 132 | +) |
| 133 | + |
| 134 | +# Loads rules required to compile proto files |
| 135 | +bazel_dep(name = "rules_proto_grpc", version = "5.0.0-alpha2") |
| 136 | + |
| 137 | +maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") |
| 138 | +maven.install( |
| 139 | + artifacts = [ |
| 140 | + "commons-cli:commons-cli:1.5.0", |
| 141 | + "com.google.oauth-client:google-oauth-client:1.34.1", |
| 142 | + "io.netty:netty-handler:4.1.100.Final", |
| 143 | + ], |
| 144 | + strict_visibility = True, |
| 145 | + repositories = [ |
| 146 | + "https://repo.maven.apache.org/maven2/", |
| 147 | + ], |
| 148 | +) |
| 149 | +use_repo(maven, "maven") |
| 150 | + |
| 151 | +bazel_dep(name = "rules_kotlin", version = "1.9.5") |
| 152 | +bazel_dep(name = "rules_perl", version = "0.2.0") |
| 153 | + |
| 154 | +bazel_dep( |
| 155 | + name = "rules_swift", |
| 156 | + version = "1.18.0", |
| 157 | + repo_name = "build_bazel_rules_swift" |
| 158 | +) |
| 159 | + |
| 160 | +bazel_dep(name = "aspect_rules_ts", version = "2.2.0") |
| 161 | + |
| 162 | +rules_ts_ext = use_extension( |
| 163 | + "@aspect_rules_ts//ts:extensions.bzl", |
| 164 | + "ext", |
| 165 | + dev_dependency = True, |
| 166 | +) |
| 167 | + |
| 168 | +rules_ts_ext.deps() |
| 169 | + |
| 170 | +use_repo(rules_ts_ext, "npm_typescript") |
0 commit comments