ronshapiro | 31d711c | 2017-01-13 08:58:02 -0800 | [diff] [blame] | 1 | # Copyright (C) 2017 The Dagger Authors. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
bcorso | 51c9a1d | 2020-06-08 17:40:40 -0700 | [diff] [blame] | 15 | # Declare the nested workspace so that the top-level workspace doesn't try to |
| 16 | # traverse it when calling `bazel build //...` |
| 17 | local_repository( |
| 18 | name = "examples_bazel", |
| 19 | path = "examples/bazel", |
| 20 | ) |
| 21 | |
ronshapiro | 40c9a99 | 2018-12-19 20:42:26 -0800 | [diff] [blame] | 22 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 23 | |
ronshapiro | 87abe78 | 2017-04-27 12:39:35 -0700 | [diff] [blame] | 24 | http_archive( |
ronshapiro | c7fb974 | 2018-06-07 20:47:25 -0700 | [diff] [blame] | 25 | name = "google_bazel_common", |
danysantiago | c5de4ab | 2020-07-09 09:59:40 -0700 | [diff] [blame] | 26 | sha256 = "7e5584a1527390d55c972c246471cffd4c68b4c234d288f6afb52af8619c4560", |
| 27 | strip_prefix = "bazel-common-d58641d120c2ad3d0afd77b57fbaa78f3a97d914", |
| 28 | urls = ["https://github.com/google/bazel-common/archive/d58641d120c2ad3d0afd77b57fbaa78f3a97d914.zip"], |
ronshapiro | 87abe78 | 2017-04-27 12:39:35 -0700 | [diff] [blame] | 29 | ) |
| 30 | |
ronshapiro | c7fb974 | 2018-06-07 20:47:25 -0700 | [diff] [blame] | 31 | load("@google_bazel_common//:workspace_defs.bzl", "google_common_workspace_rules") |
ronshapiro | 87abe78 | 2017-04-27 12:39:35 -0700 | [diff] [blame] | 32 | |
ronshapiro | c7fb974 | 2018-06-07 20:47:25 -0700 | [diff] [blame] | 33 | google_common_workspace_rules() |
ronshapiro | f1d4925 | 2019-04-11 13:47:03 -0700 | [diff] [blame] | 34 | |
danysantiago | 646e033 | 2019-09-05 08:05:21 -0700 | [diff] [blame] | 35 | RULES_JVM_EXTERNAL_TAG = "2.7" |
| 36 | |
| 37 | RULES_JVM_EXTERNAL_SHA = "f04b1466a00a2845106801e0c5cec96841f49ea4e7d1df88dc8e4bf31523df74" |
| 38 | |
| 39 | http_archive( |
| 40 | name = "rules_jvm_external", |
| 41 | sha256 = RULES_JVM_EXTERNAL_SHA, |
| 42 | strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, |
| 43 | url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG, |
| 44 | ) |
| 45 | |
cpovirk | 072ece8 | 2020-02-27 08:53:21 -0800 | [diff] [blame] | 46 | # rules_python and zlib are required by protobuf. |
| 47 | # TODO(ronshapiro): Figure out if zlib is in fact necessary, or if proto can depend on the |
| 48 | # @bazel_tools library directly. See discussion in |
| 49 | # https://github.com/protocolbuffers/protobuf/pull/5389#issuecomment-481785716 |
| 50 | # TODO(cpovirk): Should we eventually get rules_python from "Bazel Federation?" |
| 51 | # https://github.com/bazelbuild/rules_python#getting-started |
| 52 | |
| 53 | http_archive( |
| 54 | name = "rules_python", |
| 55 | sha256 = "e5470e92a18aa51830db99a4d9c492cc613761d5bdb7131c04bd92b9834380f6", |
| 56 | strip_prefix = "rules_python-4b84ad270387a7c439ebdccfd530e2339601ef27", |
| 57 | urls = ["https://github.com/bazelbuild/rules_python/archive/4b84ad270387a7c439ebdccfd530e2339601ef27.tar.gz"], |
| 58 | ) |
| 59 | |
| 60 | http_archive( |
| 61 | name = "zlib", |
| 62 | build_file = "@com_google_protobuf//:third_party/zlib.BUILD", |
| 63 | sha256 = "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff", |
| 64 | strip_prefix = "zlib-1.2.11", |
| 65 | urls = ["https://github.com/madler/zlib/archive/v1.2.11.tar.gz"], |
| 66 | ) |
| 67 | |
danysantiago | 646e033 | 2019-09-05 08:05:21 -0700 | [diff] [blame] | 68 | load("@rules_jvm_external//:defs.bzl", "maven_install") |
| 69 | |
Zac Sweers | 2597f5a | 2020-05-06 18:29:14 -0700 | [diff] [blame] | 70 | ANDROID_LINT_VERSION = "26.6.2" |
| 71 | |
danysantiago | 646e033 | 2019-09-05 08:05:21 -0700 | [diff] [blame] | 72 | maven_install( |
| 73 | artifacts = [ |
danysantiago | f45213e | 2020-01-22 16:04:12 -0800 | [diff] [blame] | 74 | "androidx.annotation:annotation:1.1.0", |
danysantiago | f45213e | 2020-01-22 16:04:12 -0800 | [diff] [blame] | 75 | "androidx.appcompat:appcompat:1.1.0", |
danysantiago | 2704f5d | 2020-03-20 17:11:04 -0700 | [diff] [blame] | 76 | "androidx.activity:activity:1.1.0", |
| 77 | "androidx.fragment:fragment:1.2.0", |
| 78 | "androidx.lifecycle:lifecycle-viewmodel:2.2.0", |
| 79 | "androidx.multidex:multidex:2.0.1", |
bcorso | 94bddc3 | 2020-02-10 14:09:13 -0800 | [diff] [blame] | 80 | "androidx.test:monitor:1.1.1", |
| 81 | "androidx.test:core:1.1.0", |
danysantiago | 2704f5d | 2020-03-20 17:11:04 -0700 | [diff] [blame] | 82 | "com.android.support:appcompat-v7:25.0.0", |
| 83 | "com.android.support:support-annotations:25.0.0", |
| 84 | "com.android.support:support-fragment:25.0.0", |
Zac Sweers | 2597f5a | 2020-05-06 18:29:14 -0700 | [diff] [blame] | 85 | "com.android.tools.external.org-jetbrains:uast:%s" % ANDROID_LINT_VERSION, |
| 86 | "com.android.tools.external.com-intellij:intellij-core:%s" % ANDROID_LINT_VERSION, |
| 87 | "com.android.tools.external.com-intellij:kotlin-compiler:%s" % ANDROID_LINT_VERSION, |
| 88 | "com.android.tools.lint:lint:%s" % ANDROID_LINT_VERSION, |
| 89 | "com.android.tools.lint:lint-api:%s" % ANDROID_LINT_VERSION, |
| 90 | "com.android.tools.lint:lint-checks:%s" % ANDROID_LINT_VERSION, |
| 91 | "com.android.tools.lint:lint-tests:%s" % ANDROID_LINT_VERSION, |
| 92 | "com.android.tools:testutils:%s" % ANDROID_LINT_VERSION, |
danysantiago | 2d43349 | 2020-06-16 18:19:22 -0700 | [diff] [blame] | 93 | "com.github.tschuchortdev:kotlin-compile-testing:1.2.8", |
danysantiago | 2704f5d | 2020-03-20 17:11:04 -0700 | [diff] [blame] | 94 | "com.google.guava:guava:27.1-android", |
danysantiago | 646e033 | 2019-09-05 08:05:21 -0700 | [diff] [blame] | 95 | "org.jetbrains.kotlin:kotlin-stdlib:1.3.50", |
| 96 | "org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.1.0", |
danysantiago | 2704f5d | 2020-03-20 17:11:04 -0700 | [diff] [blame] | 97 | "org.robolectric:robolectric:4.3.1", |
danysantiago | 646e033 | 2019-09-05 08:05:21 -0700 | [diff] [blame] | 98 | ], |
| 99 | repositories = [ |
| 100 | "https://repo1.maven.org/maven2", |
erichang | 39fa2cc | 2019-10-23 15:34:24 -0700 | [diff] [blame] | 101 | "https://maven.google.com", |
Zac Sweers | 2597f5a | 2020-05-06 18:29:14 -0700 | [diff] [blame] | 102 | "https://jcenter.bintray.com/", # Lint has one trove4j dependency in jCenter |
danysantiago | 646e033 | 2019-09-05 08:05:21 -0700 | [diff] [blame] | 103 | ], |
| 104 | ) |
danysantiago | 25228ea | 2019-12-10 15:33:29 -0800 | [diff] [blame] | 105 | |
| 106 | # TODO(user): Remove once Google publishes internal Kotlin rules. |
cpovirk | 072ece8 | 2020-02-27 08:53:21 -0800 | [diff] [blame] | 107 | RULES_KOTLIN_VERSION = "186c1e1e27d699a8953b75461f2de7c295987cfb" |
danysantiago | 25228ea | 2019-12-10 15:33:29 -0800 | [diff] [blame] | 108 | |
cpovirk | 072ece8 | 2020-02-27 08:53:21 -0800 | [diff] [blame] | 109 | RULES_KOTLIN_SHA = "ef2f9cfb724b1f1eaf0ede2636515969eb4c6e10b75a71d1850f6e692a7d5f06" |
danysantiago | 25228ea | 2019-12-10 15:33:29 -0800 | [diff] [blame] | 110 | |
| 111 | http_archive( |
| 112 | name = "io_bazel_rules_kotlin", |
| 113 | sha256 = RULES_KOTLIN_SHA, |
| 114 | strip_prefix = "rules_kotlin-%s" % RULES_KOTLIN_VERSION, |
| 115 | type = "zip", |
| 116 | urls = ["https://github.com/bazelbuild/rules_kotlin/archive/%s.zip" % RULES_KOTLIN_VERSION], |
| 117 | ) |
| 118 | |
| 119 | load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains") |
| 120 | |
| 121 | kotlin_repositories() |
| 122 | |
| 123 | kt_register_toolchains() |
bcorso | 912457b | 2020-08-03 11:37:17 -0700 | [diff] [blame^] | 124 | |
| 125 | BAZEL_SKYLIB_VERSION = "1.0.2" |
| 126 | |
| 127 | BAZEL_SKYLIB_SHA = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44" |
| 128 | |
| 129 | http_archive( |
| 130 | name = "bazel_skylib", |
| 131 | sha256 = BAZEL_SKYLIB_SHA, |
| 132 | urls = [ |
| 133 | "https://github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = BAZEL_SKYLIB_VERSION), |
| 134 | ], |
| 135 | ) |
| 136 | |
| 137 | load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") |
| 138 | |
| 139 | bazel_skylib_workspace() |