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 | |
Brad Corso | 7368a7d | 2021-02-18 09:14:05 -0800 | [diff] [blame^] | 15 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 16 | |
| 17 | ############################# |
| 18 | # Load nested repository |
| 19 | ############################# |
| 20 | |
bcorso | 51c9a1d | 2020-06-08 17:40:40 -0700 | [diff] [blame] | 21 | # Declare the nested workspace so that the top-level workspace doesn't try to |
| 22 | # traverse it when calling `bazel build //...` |
| 23 | local_repository( |
| 24 | name = "examples_bazel", |
| 25 | path = "examples/bazel", |
| 26 | ) |
| 27 | |
Brad Corso | 7368a7d | 2021-02-18 09:14:05 -0800 | [diff] [blame^] | 28 | ############################# |
| 29 | # Load Bazel-Common repository |
| 30 | ############################# |
ronshapiro | 40c9a99 | 2018-12-19 20:42:26 -0800 | [diff] [blame] | 31 | |
ronshapiro | 87abe78 | 2017-04-27 12:39:35 -0700 | [diff] [blame] | 32 | http_archive( |
ronshapiro | c7fb974 | 2018-06-07 20:47:25 -0700 | [diff] [blame] | 33 | name = "google_bazel_common", |
Eric Chang | a7872c7 | 2020-12-29 15:56:49 -0800 | [diff] [blame] | 34 | sha256 = "d8aa0ef609248c2a494d5dbdd4c89ef2a527a97c5a87687e5a218eb0b77ff640", |
| 35 | strip_prefix = "bazel-common-4a8d451e57fb7e1efecbf9495587a10684a19eb2", |
| 36 | urls = ["https://github.com/google/bazel-common/archive/4a8d451e57fb7e1efecbf9495587a10684a19eb2.zip"], |
ronshapiro | 87abe78 | 2017-04-27 12:39:35 -0700 | [diff] [blame] | 37 | ) |
| 38 | |
ronshapiro | c7fb974 | 2018-06-07 20:47:25 -0700 | [diff] [blame] | 39 | load("@google_bazel_common//:workspace_defs.bzl", "google_common_workspace_rules") |
ronshapiro | 87abe78 | 2017-04-27 12:39:35 -0700 | [diff] [blame] | 40 | |
ronshapiro | c7fb974 | 2018-06-07 20:47:25 -0700 | [diff] [blame] | 41 | google_common_workspace_rules() |
ronshapiro | f1d4925 | 2019-04-11 13:47:03 -0700 | [diff] [blame] | 42 | |
Brad Corso | 7368a7d | 2021-02-18 09:14:05 -0800 | [diff] [blame^] | 43 | ############################# |
| 44 | # Load Protobuf dependencies |
| 45 | ############################# |
danysantiago | 646e033 | 2019-09-05 08:05:21 -0700 | [diff] [blame] | 46 | |
cpovirk | 072ece8 | 2020-02-27 08:53:21 -0800 | [diff] [blame] | 47 | # rules_python and zlib are required by protobuf. |
| 48 | # TODO(ronshapiro): Figure out if zlib is in fact necessary, or if proto can depend on the |
| 49 | # @bazel_tools library directly. See discussion in |
| 50 | # https://github.com/protocolbuffers/protobuf/pull/5389#issuecomment-481785716 |
| 51 | # TODO(cpovirk): Should we eventually get rules_python from "Bazel Federation?" |
| 52 | # https://github.com/bazelbuild/rules_python#getting-started |
| 53 | |
| 54 | http_archive( |
| 55 | name = "rules_python", |
| 56 | sha256 = "e5470e92a18aa51830db99a4d9c492cc613761d5bdb7131c04bd92b9834380f6", |
| 57 | strip_prefix = "rules_python-4b84ad270387a7c439ebdccfd530e2339601ef27", |
| 58 | urls = ["https://github.com/bazelbuild/rules_python/archive/4b84ad270387a7c439ebdccfd530e2339601ef27.tar.gz"], |
| 59 | ) |
| 60 | |
| 61 | http_archive( |
| 62 | name = "zlib", |
| 63 | build_file = "@com_google_protobuf//:third_party/zlib.BUILD", |
| 64 | sha256 = "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff", |
| 65 | strip_prefix = "zlib-1.2.11", |
| 66 | urls = ["https://github.com/madler/zlib/archive/v1.2.11.tar.gz"], |
| 67 | ) |
| 68 | |
Brad Corso | 7368a7d | 2021-02-18 09:14:05 -0800 | [diff] [blame^] | 69 | ############################# |
| 70 | # Load Robolectric repository |
| 71 | ############################# |
| 72 | |
| 73 | ROBOLECTRIC_VERSION = "4.4" |
| 74 | |
| 75 | http_archive( |
| 76 | name = "robolectric", |
| 77 | sha256 = "d4f2eb078a51f4e534ebf5e18b6cd4646d05eae9b362ac40b93831bdf46112c7", |
| 78 | strip_prefix = "robolectric-bazel-%s" % ROBOLECTRIC_VERSION, |
| 79 | urls = ["https://github.com/robolectric/robolectric-bazel/archive/%s.tar.gz" % ROBOLECTRIC_VERSION], |
| 80 | ) |
| 81 | |
| 82 | load("@robolectric//bazel:robolectric.bzl", "robolectric_repositories") |
| 83 | |
| 84 | robolectric_repositories() |
| 85 | |
| 86 | ############################# |
| 87 | # Load Kotlin repository |
| 88 | ############################# |
| 89 | |
Dagger Team | b5990a0 | 2020-12-04 12:18:34 -0800 | [diff] [blame] | 90 | RULES_KOTLIN_COMMIT = "2c283821911439e244285b5bfec39148e7d90e21" |
| 91 | |
| 92 | RULES_KOTLIN_SHA = "b04cd539e7e3571745179da95069586b6fa76a64306b24bb286154e652010608" |
| 93 | |
| 94 | http_archive( |
| 95 | name = "io_bazel_rules_kotlin", |
| 96 | sha256 = RULES_KOTLIN_SHA, |
| 97 | strip_prefix = "rules_kotlin-%s" % RULES_KOTLIN_COMMIT, |
| 98 | type = "zip", |
| 99 | urls = ["https://github.com/bazelbuild/rules_kotlin/archive/%s.zip" % RULES_KOTLIN_COMMIT], |
| 100 | ) |
| 101 | |
| 102 | load("@io_bazel_rules_kotlin//kotlin:dependencies.bzl", "kt_download_local_dev_dependencies") |
| 103 | |
| 104 | kt_download_local_dev_dependencies() |
| 105 | |
| 106 | load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories") |
| 107 | |
| 108 | KOTLIN_VERSION = "1.4.20" |
| 109 | |
| 110 | KOTLINC_RELEASE_SHA = "11db93a4d6789e3406c7f60b9f267eba26d6483dcd771eff9f85bb7e9837011f" |
| 111 | |
| 112 | KOTLINC_RELEASE = { |
| 113 | "sha256": KOTLINC_RELEASE_SHA, |
| 114 | "urls": ["https://github.com/JetBrains/kotlin/releases/download/v{v}/kotlin-compiler-{v}.zip".format(v = KOTLIN_VERSION)], |
| 115 | } |
| 116 | |
| 117 | kotlin_repositories(compiler_release = KOTLINC_RELEASE) |
| 118 | |
| 119 | register_toolchains("//:kotlin_toolchain") |
| 120 | |
Brad Corso | 7368a7d | 2021-02-18 09:14:05 -0800 | [diff] [blame^] | 121 | ############################# |
| 122 | # Load Maven dependencies |
| 123 | ############################# |
| 124 | |
| 125 | RULES_JVM_EXTERNAL_TAG = "2.7" |
| 126 | |
| 127 | RULES_JVM_EXTERNAL_SHA = "f04b1466a00a2845106801e0c5cec96841f49ea4e7d1df88dc8e4bf31523df74" |
| 128 | |
| 129 | http_archive( |
| 130 | name = "rules_jvm_external", |
| 131 | sha256 = RULES_JVM_EXTERNAL_SHA, |
| 132 | strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, |
| 133 | url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG, |
| 134 | ) |
| 135 | |
danysantiago | 646e033 | 2019-09-05 08:05:21 -0700 | [diff] [blame] | 136 | load("@rules_jvm_external//:defs.bzl", "maven_install") |
| 137 | |
Zac Sweers | 2597f5a | 2020-05-06 18:29:14 -0700 | [diff] [blame] | 138 | ANDROID_LINT_VERSION = "26.6.2" |
| 139 | |
danysantiago | 646e033 | 2019-09-05 08:05:21 -0700 | [diff] [blame] | 140 | maven_install( |
| 141 | artifacts = [ |
danysantiago | f45213e | 2020-01-22 16:04:12 -0800 | [diff] [blame] | 142 | "androidx.annotation:annotation:1.1.0", |
Brad Corso | deff5e5 | 2020-10-26 11:50:20 -0700 | [diff] [blame] | 143 | "androidx.appcompat:appcompat:1.2.0", |
Daniel Santiago | 623d3a6 | 2021-02-16 16:24:06 -0800 | [diff] [blame] | 144 | "androidx.activity:activity:1.2.0", |
| 145 | "androidx.fragment:fragment:1.3.0", |
Brad Corso | 7368a7d | 2021-02-18 09:14:05 -0800 | [diff] [blame^] | 146 | "androidx.lifecycle:lifecycle-common:2.3.0", |
Daniel Santiago | 623d3a6 | 2021-02-16 16:24:06 -0800 | [diff] [blame] | 147 | "androidx.lifecycle:lifecycle-viewmodel:2.3.0", |
| 148 | "androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.0", |
danysantiago | 2704f5d | 2020-03-20 17:11:04 -0700 | [diff] [blame] | 149 | "androidx.multidex:multidex:2.0.1", |
Dagger Team | 06caf17 | 2020-11-30 16:16:47 -0800 | [diff] [blame] | 150 | "androidx.savedstate:savedstate:1.0.0", |
bcorso | 94bddc3 | 2020-02-10 14:09:13 -0800 | [diff] [blame] | 151 | "androidx.test:monitor:1.1.1", |
| 152 | "androidx.test:core:1.1.0", |
Brad Corso | 7368a7d | 2021-02-18 09:14:05 -0800 | [diff] [blame^] | 153 | "androidx.test.ext:junit:1.1.2", |
bcorso | 06d2d2a | 2020-08-12 12:57:40 -0700 | [diff] [blame] | 154 | "com.google.auto:auto-common:0.11", |
danysantiago | 2704f5d | 2020-03-20 17:11:04 -0700 | [diff] [blame] | 155 | "com.android.support:appcompat-v7:25.0.0", |
| 156 | "com.android.support:support-annotations:25.0.0", |
| 157 | "com.android.support:support-fragment:25.0.0", |
Zac Sweers | 2597f5a | 2020-05-06 18:29:14 -0700 | [diff] [blame] | 158 | "com.android.tools.external.org-jetbrains:uast:%s" % ANDROID_LINT_VERSION, |
| 159 | "com.android.tools.external.com-intellij:intellij-core:%s" % ANDROID_LINT_VERSION, |
| 160 | "com.android.tools.external.com-intellij:kotlin-compiler:%s" % ANDROID_LINT_VERSION, |
| 161 | "com.android.tools.lint:lint:%s" % ANDROID_LINT_VERSION, |
| 162 | "com.android.tools.lint:lint-api:%s" % ANDROID_LINT_VERSION, |
| 163 | "com.android.tools.lint:lint-checks:%s" % ANDROID_LINT_VERSION, |
| 164 | "com.android.tools.lint:lint-tests:%s" % ANDROID_LINT_VERSION, |
| 165 | "com.android.tools:testutils:%s" % ANDROID_LINT_VERSION, |
danysantiago | 2d43349 | 2020-06-16 18:19:22 -0700 | [diff] [blame] | 166 | "com.github.tschuchortdev:kotlin-compile-testing:1.2.8", |
danysantiago | 2704f5d | 2020-03-20 17:11:04 -0700 | [diff] [blame] | 167 | "com.google.guava:guava:27.1-android", |
Brad Corso | 7368a7d | 2021-02-18 09:14:05 -0800 | [diff] [blame^] | 168 | "junit:junit:4.13", |
Dagger Team | b5990a0 | 2020-12-04 12:18:34 -0800 | [diff] [blame] | 169 | "org.jetbrains.kotlin:kotlin-stdlib:%s" % KOTLIN_VERSION, |
danysantiago | 646e033 | 2019-09-05 08:05:21 -0700 | [diff] [blame] | 170 | "org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.1.0", |
Brad Corso | 7368a7d | 2021-02-18 09:14:05 -0800 | [diff] [blame^] | 171 | "org.robolectric:robolectric:4.4", |
| 172 | "org.robolectric:shadows-framework:4.4", # For ActivityController |
danysantiago | 646e033 | 2019-09-05 08:05:21 -0700 | [diff] [blame] | 173 | ], |
| 174 | repositories = [ |
| 175 | "https://repo1.maven.org/maven2", |
erichang | 39fa2cc | 2019-10-23 15:34:24 -0700 | [diff] [blame] | 176 | "https://maven.google.com", |
Zac Sweers | 2597f5a | 2020-05-06 18:29:14 -0700 | [diff] [blame] | 177 | "https://jcenter.bintray.com/", # Lint has one trove4j dependency in jCenter |
danysantiago | 646e033 | 2019-09-05 08:05:21 -0700 | [diff] [blame] | 178 | ], |
| 179 | ) |
danysantiago | 25228ea | 2019-12-10 15:33:29 -0800 | [diff] [blame] | 180 | |
Brad Corso | 7368a7d | 2021-02-18 09:14:05 -0800 | [diff] [blame^] | 181 | ############################# |
| 182 | # Load Bazel Skylib rules |
| 183 | ############################# |
| 184 | |
bcorso | 912457b | 2020-08-03 11:37:17 -0700 | [diff] [blame] | 185 | BAZEL_SKYLIB_VERSION = "1.0.2" |
| 186 | |
| 187 | BAZEL_SKYLIB_SHA = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44" |
| 188 | |
| 189 | http_archive( |
| 190 | name = "bazel_skylib", |
| 191 | sha256 = BAZEL_SKYLIB_SHA, |
| 192 | urls = [ |
| 193 | "https://github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = BAZEL_SKYLIB_VERSION), |
| 194 | ], |
| 195 | ) |
| 196 | |
| 197 | load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") |
| 198 | |
| 199 | bazel_skylib_workspace() |