aboutsummaryrefslogtreecommitdiff
path: root/examples/bazel/WORKSPACE
blob: 009f99e10dcee4a634e55d0bcfa29449ff277bf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Copyright (C) 2020 The Dagger Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Description:
#   Defines the Bazel workspace rules for the Dagger examples.

########################
# Load Dagger repository
########################

# TODO(user): Replace with `http_archive` pointing to tagged released.
local_repository(
    name = "dagger",
    path = "../../",
)

load("@dagger//:workspace_defs.bzl", "DAGGER_ARTIFACTS", "DAGGER_REPOSITORIES")

#########################
# Load Android repository
#########################

android_sdk_repository(
    name = "androidsdk",
    api_level = 29,
    build_tools_version = "29.0.2",
)

#############################
# Load Robolectric repository
#############################

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "robolectric",
    strip_prefix = "robolectric-bazel-4.1",
    urls = ["https://github.com/robolectric/robolectric-bazel/archive/4.1.tar.gz"],
)

load("@robolectric//bazel:robolectric.bzl", "robolectric_repositories")

robolectric_repositories()

#########################
# Load Maven repositories
#########################

RULES_JVM_EXTERNAL_TAG = "2.7"

RULES_JVM_EXTERNAL_SHA = "f04b1466a00a2845106801e0c5cec96841f49ea4e7d1df88dc8e4bf31523df74"

http_archive(
    name = "rules_jvm_external",
    sha256 = RULES_JVM_EXTERNAL_SHA,
    strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
    url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
)

load("@rules_jvm_external//:defs.bzl", "maven_install")

maven_install(
    artifacts = DAGGER_ARTIFACTS + [
        "androidx.test.ext:junit:1.1.1",
        "androidx.test:runner:1.1.1",
        "com.google.truth:truth:1.0.1",
        "junit:junit:4.13",
        "org.robolectric:robolectric:4.1",
        "org.robolectric:annotations:4.1",
    ],
    repositories = DAGGER_REPOSITORIES,
)