blob: 07724c9963e53301f1866d0eaced74b661b9d4df [file] [log] [blame]
ronshapiro31d711c2017-01-13 08:58:02 -08001# 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
bcorso51c9a1d2020-06-08 17:40:40 -070015# Declare the nested workspace so that the top-level workspace doesn't try to
16# traverse it when calling `bazel build //...`
17local_repository(
18 name = "examples_bazel",
19 path = "examples/bazel",
20)
21
ronshapiro40c9a992018-12-19 20:42:26 -080022load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
23
ronshapiro87abe782017-04-27 12:39:35 -070024http_archive(
ronshapiroc7fb9742018-06-07 20:47:25 -070025 name = "google_bazel_common",
Eric Changa7872c72020-12-29 15:56:49 -080026 sha256 = "d8aa0ef609248c2a494d5dbdd4c89ef2a527a97c5a87687e5a218eb0b77ff640",
27 strip_prefix = "bazel-common-4a8d451e57fb7e1efecbf9495587a10684a19eb2",
28 urls = ["https://github.com/google/bazel-common/archive/4a8d451e57fb7e1efecbf9495587a10684a19eb2.zip"],
ronshapiro87abe782017-04-27 12:39:35 -070029)
30
ronshapiroc7fb9742018-06-07 20:47:25 -070031load("@google_bazel_common//:workspace_defs.bzl", "google_common_workspace_rules")
ronshapiro87abe782017-04-27 12:39:35 -070032
ronshapiroc7fb9742018-06-07 20:47:25 -070033google_common_workspace_rules()
ronshapirof1d49252019-04-11 13:47:03 -070034
danysantiago646e0332019-09-05 08:05:21 -070035RULES_JVM_EXTERNAL_TAG = "2.7"
36
37RULES_JVM_EXTERNAL_SHA = "f04b1466a00a2845106801e0c5cec96841f49ea4e7d1df88dc8e4bf31523df74"
38
39http_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
cpovirk072ece82020-02-27 08:53:21 -080046# 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
53http_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
60http_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
Dagger Teamb5990a02020-12-04 12:18:34 -080068RULES_KOTLIN_COMMIT = "2c283821911439e244285b5bfec39148e7d90e21"
69
70RULES_KOTLIN_SHA = "b04cd539e7e3571745179da95069586b6fa76a64306b24bb286154e652010608"
71
72http_archive(
73 name = "io_bazel_rules_kotlin",
74 sha256 = RULES_KOTLIN_SHA,
75 strip_prefix = "rules_kotlin-%s" % RULES_KOTLIN_COMMIT,
76 type = "zip",
77 urls = ["https://github.com/bazelbuild/rules_kotlin/archive/%s.zip" % RULES_KOTLIN_COMMIT],
78)
79
80load("@io_bazel_rules_kotlin//kotlin:dependencies.bzl", "kt_download_local_dev_dependencies")
81
82kt_download_local_dev_dependencies()
83
84load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories")
85
86KOTLIN_VERSION = "1.4.20"
87
88KOTLINC_RELEASE_SHA = "11db93a4d6789e3406c7f60b9f267eba26d6483dcd771eff9f85bb7e9837011f"
89
90KOTLINC_RELEASE = {
91 "sha256": KOTLINC_RELEASE_SHA,
92 "urls": ["https://github.com/JetBrains/kotlin/releases/download/v{v}/kotlin-compiler-{v}.zip".format(v = KOTLIN_VERSION)],
93}
94
95kotlin_repositories(compiler_release = KOTLINC_RELEASE)
96
97register_toolchains("//:kotlin_toolchain")
98
danysantiago646e0332019-09-05 08:05:21 -070099load("@rules_jvm_external//:defs.bzl", "maven_install")
100
Zac Sweers2597f5a2020-05-06 18:29:14 -0700101ANDROID_LINT_VERSION = "26.6.2"
102
danysantiago646e0332019-09-05 08:05:21 -0700103maven_install(
104 artifacts = [
danysantiagof45213e2020-01-22 16:04:12 -0800105 "androidx.annotation:annotation:1.1.0",
Brad Corsodeff5e52020-10-26 11:50:20 -0700106 "androidx.appcompat:appcompat:1.2.0",
Daniel Santiago623d3a62021-02-16 16:24:06 -0800107 "androidx.activity:activity:1.2.0",
108 "androidx.fragment:fragment:1.3.0",
109 "androidx.lifecycle:lifecycle-viewmodel:2.3.0",
110 "androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.0",
danysantiago2704f5d2020-03-20 17:11:04 -0700111 "androidx.multidex:multidex:2.0.1",
Dagger Team06caf172020-11-30 16:16:47 -0800112 "androidx.savedstate:savedstate:1.0.0",
bcorso94bddc32020-02-10 14:09:13 -0800113 "androidx.test:monitor:1.1.1",
114 "androidx.test:core:1.1.0",
bcorso06d2d2a2020-08-12 12:57:40 -0700115 "com.google.auto:auto-common:0.11",
danysantiago2704f5d2020-03-20 17:11:04 -0700116 "com.android.support:appcompat-v7:25.0.0",
117 "com.android.support:support-annotations:25.0.0",
118 "com.android.support:support-fragment:25.0.0",
Zac Sweers2597f5a2020-05-06 18:29:14 -0700119 "com.android.tools.external.org-jetbrains:uast:%s" % ANDROID_LINT_VERSION,
120 "com.android.tools.external.com-intellij:intellij-core:%s" % ANDROID_LINT_VERSION,
121 "com.android.tools.external.com-intellij:kotlin-compiler:%s" % ANDROID_LINT_VERSION,
122 "com.android.tools.lint:lint:%s" % ANDROID_LINT_VERSION,
123 "com.android.tools.lint:lint-api:%s" % ANDROID_LINT_VERSION,
124 "com.android.tools.lint:lint-checks:%s" % ANDROID_LINT_VERSION,
125 "com.android.tools.lint:lint-tests:%s" % ANDROID_LINT_VERSION,
126 "com.android.tools:testutils:%s" % ANDROID_LINT_VERSION,
danysantiago2d433492020-06-16 18:19:22 -0700127 "com.github.tschuchortdev:kotlin-compile-testing:1.2.8",
danysantiago2704f5d2020-03-20 17:11:04 -0700128 "com.google.guava:guava:27.1-android",
Dagger Teamb5990a02020-12-04 12:18:34 -0800129 "org.jetbrains.kotlin:kotlin-stdlib:%s" % KOTLIN_VERSION,
danysantiago646e0332019-09-05 08:05:21 -0700130 "org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.1.0",
danysantiago2704f5d2020-03-20 17:11:04 -0700131 "org.robolectric:robolectric:4.3.1",
danysantiago646e0332019-09-05 08:05:21 -0700132 ],
133 repositories = [
134 "https://repo1.maven.org/maven2",
erichang39fa2cc2019-10-23 15:34:24 -0700135 "https://maven.google.com",
Zac Sweers2597f5a2020-05-06 18:29:14 -0700136 "https://jcenter.bintray.com/", # Lint has one trove4j dependency in jCenter
danysantiago646e0332019-09-05 08:05:21 -0700137 ],
138)
danysantiago25228ea2019-12-10 15:33:29 -0800139
bcorso912457b2020-08-03 11:37:17 -0700140BAZEL_SKYLIB_VERSION = "1.0.2"
141
142BAZEL_SKYLIB_SHA = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44"
143
144http_archive(
145 name = "bazel_skylib",
146 sha256 = BAZEL_SKYLIB_SHA,
147 urls = [
148 "https://github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = BAZEL_SKYLIB_VERSION),
149 ],
150)
151
152load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
153
154bazel_skylib_workspace()