| workspace( |
| name = "hscloud", |
| ) |
| |
| load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") |
| load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| |
| # Protobuf deps (shared between many rules). |
| # Load this as early as possible, to avoid a different version being pulled in by deps of something else |
| http_archive( |
| name = "com_google_protobuf", |
| sha256 = "bb8ce9ba11eb7bccf080599fe7cad9cc461751c8dd1ba61701c0070d58cde973", |
| strip_prefix = "protobuf-3.12.2", |
| urls = ["https://github.com/google/protobuf/archive/v3.12.2.tar.gz"], |
| ) |
| |
| load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") |
| protobuf_deps() |
| |
| # Force rules_python at a bleeding edge version (for pip3_import). |
| http_archive( |
| name = "rules_python", |
| url = "https://github.com/bazelbuild/rules_python/releases/download/0.0.3/rules_python-0.0.3.tar.gz", |
| sha256 = "e46612e9bb0dae8745de6a0643be69e8665a03f63163ac6610c210e80d14c3e4", |
| ) |
| |
| # Load and setup Nixpkgs, if Nix is present on the build system. |
| http_archive( |
| name = "io_tweag_rules_nixpkgs", |
| strip_prefix = "rules_nixpkgs-dc24090573d74adcf38730422941fd69b87682c7", |
| urls = ["https://github.com/tweag/rules_nixpkgs/archive/dc24090573d74adcf38730422941fd69b87682c7.tar.gz"], |
| sha256 = "aca86baa64174478c57f74ed09d5c2313113abe94aa3af030486d1b14032d3ed", |
| ) |
| load("//third_party/nix:repository_rules.bzl", "hscloud_setup_nix") |
| hscloud_setup_nix( |
| revision = "1179841f9a88b8a548f4b11d1a03aa25a790c379", |
| sha256 = "8b64041bfb9760de9e797c0a985a4830880c21732489f397e217d877edd9a990", |
| ) |
| |
| # Download Go/Gazelle rules |
| http_archive( |
| name = "io_bazel_rules_go", |
| sha256 = "6a68e269802911fa419abb940c850734086869d7fe9bc8e12aaf60a09641c818", |
| urls = [ |
| "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.23.0/rules_go-v0.23.0.tar.gz", |
| "https://github.com/bazelbuild/rules_go/releases/download/v0.23.0/rules_go-v0.23.0.tar.gz", |
| ], |
| ) |
| http_archive( |
| name = "bazel_gazelle", |
| sha256 = "bfd86b3cbe855d6c16c6fce60d76bd51f5c8dbc9cfcaef7a2bb5c1aafd0710e8", |
| urls = [ |
| "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.21.0/bazel-gazelle-v0.21.0.tar.gz", |
| "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.21.0/bazel-gazelle-v0.21.0.tar.gz", |
| ], |
| ) |
| |
| # Python rules |
| # Important: rules_python must be loaded before protobuf (and grpc) because they load an older version otherwise |
| load("@rules_python//python:repositories.bzl", "py_repositories") |
| py_repositories() |
| |
| load("@rules_python//python:pip.bzl", "pip_repositories") |
| pip_repositories() |
| |
| load("@hscloud_pip_imports//:imports.bzl", "hscloud_pip3_import") |
| hscloud_pip3_import( |
| name = "pydeps", |
| requirements = "//third_party/py:requirements.txt", |
| ) |
| |
| load("@pydeps//:requirements.bzl", "pip_install") |
| pip_install() |
| |
| |
| # Setup Go toolchain. |
| # This workspace is generated by hscloud_setup_nixpkgs. It will either call |
| # go_register_toolchains() to automagically get Go toolchains from the Internet |
| # or, if nix is present, instead setup a toolchain from nixpkgs. |
| load("@hscloud_go_toolchain//:imports.bzl", "hscloud_go_register_toolchains") |
| hscloud_go_register_toolchains() |
| |
| # IMPORTANT: match protobuf version above with the one loaded by grpc |
| http_archive( |
| name = "com_github_grpc_grpc", |
| sha256 = "419dba362eaf8f1d36849ceee17c3e2ff8ff12ac666b42d3ff02a164ebe090e9", |
| strip_prefix = "grpc-1.30.0", |
| urls = ["https://github.com/grpc/grpc/archive/v1.30.0.tar.gz"], |
| ) |
| |
| # Load grpc deps after Go, to prevent overriding Go toolchains/SDK. |
| load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps") |
| grpc_deps() |
| load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps") |
| grpc_extra_deps() |
| |
| load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies") |
| go_rules_dependencies() |
| |
| # gazelle:repository_macro third_party/go/repositories.bzl%go_repositories |
| load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") |
| gazelle_dependencies() |
| |
| # Load Go third-party packages. |
| load("//third_party/go:repositories.bzl", "go_repositories") |
| go_repositories() |
| |
| # Docker rules |
| |
| http_archive( |
| name = "io_bazel_rules_docker", |
| sha256 = "dc97fccceacd4c6be14e800b2a00693d5e8d07f69ee187babfd04a80a9f8e250", |
| strip_prefix = "rules_docker-0.14.1", |
| urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.14.1/rules_docker-v0.14.1.tar.gz"], |
| ) |
| |
| load("@io_bazel_rules_docker//toolchains/docker:toolchain.bzl", docker_toolchain_configure = "toolchain_configure") |
| |
| # This forces the use of Docker $HOME/.docker configuration. |
| docker_toolchain_configure( |
| name = "docker_config", |
| client_config = "", |
| docker_path = "/usr/bin/docker", |
| ) |
| |
| load( |
| "@io_bazel_rules_docker//repositories:repositories.bzl", |
| container_repositories = "repositories", |
| ) |
| container_repositories() |
| |
| # Docker base images |
| |
| load("@io_bazel_rules_docker//container:container.bzl", "container_pull") |
| |
| container_pull( |
| name = "prodimage-bionic", |
| registry = "registry.k0.hswaw.net", |
| repository = "q3k/prodimage", |
| tag = "20190822-1227", |
| digest = "sha256:1cd1f84169b8e1414a5d511b42909f2d540831c67b6799ae9af8cd6a80d75b5f", |
| ) |
| |
| container_pull( |
| name = "gerrit-3.0.8", |
| registry = "index.docker.io", |
| repository = "gerritcodereview/gerrit", |
| tag = "3.0.8-ubuntu18", |
| digest = "sha256:8f58236129e6547d92502a2e9d8f40129f45f15007beaeafb59fed4faffddb3e", |
| ) |
| |
| # third_party/factorio |
| load("//third_party/factorio:factorio.bzl", "factorio_repositories") |
| factorio_repositories() |
| |
| # For devtools/gerrit/gerrit-oauth-provider and gerrit OWNERS plugin |
| |
| git_repository( |
| name = "com_googlesource_gerrit_bazlets", |
| remote = "https://gerrit.googlesource.com/bazlets", |
| commit = "1d381f01c853e2c02ae35430a8e294e485635d62", |
| shallow_since = "1559431096 -0400" |
| ) |
| |
| load("@com_googlesource_gerrit_bazlets//:gerrit_api.bzl", "gerrit_api") |
| gerrit_api() |
| |
| load("@com_googlesource_gerrit_bazlets//tools:maven_jar.bzl", gerrit_maven_jar="maven_jar", GERRIT="GERRIT") |
| PROLOG_VERS = "1.4.3" |
| JACKSON_VER = "2.9.7" |
| |
| gerrit_maven_jar( |
| name = "scribe", |
| artifact = "org.scribe:scribe:1.3.7", |
| sha1 = "583921bed46635d9f529ef5f14f7c9e83367bc6e", |
| ) |
| |
| gerrit_maven_jar( |
| name = "commons-codec", |
| artifact = "commons-codec:commons-codec:1.4", |
| sha1 = "4216af16d38465bbab0f3dff8efa14204f7a399a", |
| ) |
| |
| gerrit_maven_jar( |
| name = "jackson-core", |
| artifact = "com.fasterxml.jackson.core:jackson-core:" + JACKSON_VER, |
| sha1 = "4b7f0e0dc527fab032e9800ed231080fdc3ac015", |
| ) |
| gerrit_maven_jar( |
| name = "jackson-databind", |
| artifact = "com.fasterxml.jackson.core:jackson-databind:" + JACKSON_VER, |
| sha1 = "e6faad47abd3179666e89068485a1b88a195ceb7", |
| ) |
| gerrit_maven_jar( |
| name = "jackson-annotations", |
| artifact = "com.fasterxml.jackson.core:jackson-annotations:" + JACKSON_VER, |
| sha1 = "4b838e5c4fc17ac02f3293e9a558bb781a51c46d", |
| ) |
| gerrit_maven_jar( |
| name = "jackson-dataformat-yaml", |
| artifact = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:" + JACKSON_VER, |
| sha1 = "a428edc4bb34a2da98a50eb759c26941d4e85960", |
| ) |
| gerrit_maven_jar( |
| name = "snakeyaml", |
| artifact = "org.yaml:snakeyaml:1.23", |
| sha1 = "ec62d74fe50689c28c0ff5b35d3aebcaa8b5be68", |
| ) |
| |
| gerrit_maven_jar( |
| name = "prolog-runtime", |
| artifact = "com.googlecode.prolog-cafe:prolog-runtime:" + PROLOG_VERS, |
| attach_source = False, |
| repository = GERRIT, |
| sha1 = "d5206556cbc76ffeab21313ffc47b586a1efbcbb", |
| ) |
| gerrit_maven_jar( |
| name = "prolog-compiler", |
| artifact = "com.googlecode.prolog-cafe:prolog-compiler:" + PROLOG_VERS, |
| attach_source = False, |
| repository = GERRIT, |
| sha1 = "f37032cf1dec3e064427745bc59da5a12757a3b2", |
| ) |
| gerrit_maven_jar( |
| name = "prolog-io", |
| artifact = "com.googlecode.prolog-cafe:prolog-io:" + PROLOG_VERS, |
| attach_source = False, |
| repository = GERRIT, |
| sha1 = "d02b2640b26f64036b6ba2b45e4acc79281cea17", |
| ) |
| |
| # minecraft spigot/bukkit deps |
| # this uses rules_jvm_external vs gerrit's maven_jar because we need SNAPSHOT support |
| |
| http_archive( |
| name = "io_grpc_grpc_java", |
| sha256 = "446ad7a2e85bbd05406dbf95232c7c49ed90de83b3b60cb2048b0c4c9f254d29", |
| strip_prefix = "grpc-java-1.29.0", |
| url = "https://github.com/grpc/grpc-java/archive/v1.29.0.zip", |
| ) |
| |
| RULES_JVM_EXTERNAL_TAG = "3.0" |
| RULES_JVM_EXTERNAL_SHA = "62133c125bf4109dfd9d2af64830208356ce4ef8b165a6ef15bbff7460b35c3a" |
| |
| http_archive( |
| name = "rules_jvm_external", |
| strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, |
| sha256 = RULES_JVM_EXTERNAL_SHA, |
| url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG, |
| ) |
| |
| load("@rules_jvm_external//:defs.bzl", "maven_install") |
| load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_ARTIFACTS") |
| load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS") |
| |
| maven_install( |
| artifacts = [ |
| "org.spigotmc:spigot-api:1.15.2-R0.1-SNAPSHOT", |
| "io.grpc:grpc-netty-shaded:1.29.0", |
| "io.grpc:grpc-services:1.29.0", |
| ] + IO_GRPC_GRPC_JAVA_ARTIFACTS, |
| generate_compat_repositories = True, |
| override_targets = IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS, |
| repositories = [ |
| "https://hub.spigotmc.org/nexus/content/repositories/snapshots", |
| "https://oss.sonatype.org/content/repositories/snapshots", |
| "https://repo1.maven.org/maven2/", |
| ], |
| maven_install_json = "//third_party/java:maven_install.json", |
| ) |
| |
| load("@maven//:defs.bzl", "pinned_maven_install") |
| pinned_maven_install() |
| |
| load("@maven//:compat.bzl", "compat_repositories") |
| compat_repositories() |
| |
| load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories") |
| grpc_java_repositories() |
| |
| # Gerrit OWNERS plugins external repositories |
| |
| git_repository( |
| name = "com_googlesource_gerrit_plugin_owners", |
| remote = "https://gerrit.googlesource.com/plugins/owners/", |
| commit = "5e691e87b8c00a04d261a8dd313f4d16c54797e8", |
| shallow_since = "1559729722 +0900" |
| ) |
| |
| # Go image repos for Docker |
| |
| load("@io_bazel_rules_docker//go:image.bzl", go_image_repositories = "repositories") |
| go_image_repositories() |
| |
| # oniguruma, with build from //third_party/oniguruma |
| |
| http_archive( |
| name = "com_github_kkos_oniguruma", |
| urls = ["https://github.com/kkos/oniguruma/releases/download/v6.9.5_rev1/onig-6.9.5_rev1.tar.gz"], |
| strip_prefix = "onig-6.9.5", |
| sha256 = "d33c849d1672af227944878cefe0a8fcf26fc62bedba32aa517f2f63c314a99e", |
| build_file = "@hscloud//third_party/oniguruma:BUILD.external", |
| ) |
| |
| # jq, with build from //third_party/jq |
| |
| http_archive( |
| name = "com_github_stedolan_jq", |
| urls = ["https://github.com/stedolan/jq/releases/download/jq-1.6/jq-1.6.tar.gz"], |
| strip_prefix = "jq-1.6", |
| sha256 = "5de8c8e29aaa3fb9cc6b47bb27299f271354ebb72514e3accadc7d38b5bbaa72", |
| build_file = "@hscloud//third_party/jq:BUILD.external", |
| ) |