forked from cgruber/bazel_maven_repository
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWORKSPACE
140 lines (123 loc) · 6.92 KB
/
WORKSPACE
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
workspace(name = "test_workspace")
# Set up maven
local_repository(
name = "maven_repository_rules",
path = "../..",
)
load("@maven_repository_rules//maven:maven.bzl", "maven_repository_specification")
load(
":build_substitution_templates.bzl",
"AUTO_VALUE_BUILD_SNIPPET_WITH_PLUGIN",
"DAGGER_BUILD_SNIPPET_WITH_PLUGIN",
)
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
KOTLIN_VERSION = "1.3.50"
KOTLINC_ROOT = "https://github.com/JetBrains/kotlin/releases/download"
KOTLINC_SHA = "69424091a6b7f52d93eed8bba2ace921b02b113dbb71388d704f8180a6bdc6ec"
KOTLIN_RULES_VERSION = "sq_02"
KOTLIN_RULES_SHA = "03606649fb705d114ef7ca05de38551614c1530cda22fb39d973bd0d3aa69c22"
http_archive(
name = "io_bazel_rules_kotlin",
strip_prefix = "rules_kotlin-%s" % KOTLIN_RULES_VERSION,
type = "zip",
urls = ["https://github.com/cgruber/rules_kotlin/archive/%s.zip" % KOTLIN_RULES_VERSION],
sha256 = KOTLIN_RULES_SHA,
)
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains")
kotlin_repositories(compiler_release = {
"urls": [
"{root}/v{v}/kotlin-compiler-{v}.zip".format(root = KOTLINC_ROOT, v = KOTLIN_VERSION),
],
"sha256": KOTLINC_SHA,
})
kt_register_toolchains()
maven_repository_specification(
name = "maven",
# If true, then any pom files for which a pom_sha256 attribute is not supplied will be
# insecurely cached (after first download) using hashes stored in this folder.
cache_poms_insecurely = True, # default False
# If supplied, this will be the alternate location for insecure sha hashes.
#
# This can be an absolute or a path relative to ${HOME}
insecure_cache = ".cache/bazel_maven_repository", # This is the default
# Enable the creation of older-style mangling where foo-bar becomes foo_bar (for migration)
legacy_artifact_id_munge = True,
# Substitute old android artifacts in poms' deps for androidx ones, and process jars.
use_jetifier = True,
# The artifact spec list.
artifacts = {
# This is the proper way to specify an artifact. It contains the artifact, plus a configuration dictionary.
# The config dictionary contains a sha256 hash. This both ensures the file downloaded is the expected one, but
# also caches the file in bazel's "content addressable" cache, which survives build clean.
"com.google.guava:guava:25.0-jre": {
"sha256": "3fd4341776428c7e0e5c18a7c10de129475b69ab9d30aeafbb5c277bb6074fa9",
# This is optional, but more secure. Failing this, the pom's sha will be locally
# stored in the insecure_pom_cache
"pom_sha256": "68c1ac2817572d6a6eb5c36072c37379f912ec75e99f6bc25aaa7ed2eb2b5ff1",
},
"com.google.dagger:dagger:2.20": {
"sha256": "d37a556d8d57e2428c20e222b95346512d11fcf2174d581489a69a1439b886fb",
"build_snippet": DAGGER_BUILD_SNIPPET_WITH_PLUGIN.format(version = "2.20"),
},
# This is how you specify an artifact that has no hash. You must either supply a sha256 hash of the jar file
# or specify that the dep is insecure.
"com.google.dagger:dagger-compiler:2.20": {"insecure": True},
"com.google.dagger:dagger-producers:2.20": {"insecure": True},
"com.google.dagger:dagger-spi:2.20": {"insecure": True},
"com.google.code.findbugs:jsr305:3.0.2": {"insecure": True},
"com.google.errorprone:javac-shaded:9+181-r4173-1": {"insecure": True},
"com.google.googlejavaformat:google-java-format:1.6": {"insecure": True},
"com.google.truth:truth:1.0": {
"insecure": True,
"testonly": True,
"exclude": ["org.checkerframework:checker-qual"], # for demonstration - don't alter truth in a real project.
},
"com.squareup:javapoet:1.11.1": {"insecure": True},
"io.reactivex.rxjava2:rxjava:2.2.6": {"insecure": True},
"org.reactivestreams:reactive-streams:1.0.2": {"insecure": True},
"org.checkerframework:checker-compat-qual:2.5.5": {"insecure": True},
"javax.annotation:jsr250-api:1.0": {"insecure": True},
"javax.inject:javax.inject:1": {"insecure": True},
"junit:junit:4.13-beta-1": {"insecure": True, "testonly": True},
"com.google.errorprone:error_prone_annotations:2.1.3": {"insecure": True},
"com.google.j2objc:j2objc-annotations:1.1": {"insecure": True},
"org.codehaus.mojo:animal-sniffer-annotations:1.14": {"insecure": True},
"org.hamcrest:hamcrest-core:1.3": {"insecure": True, "testonly": True},
"org.jetbrains:annotations:13.0": {"insecure": True},
"org.jetbrains.kotlin:kotlin-test:%s" % KOTLIN_VERSION: {"insecure": True},
"org.jetbrains.kotlin:kotlin-test-common:%s" % KOTLIN_VERSION: {"insecure": True},
"org.jetbrains.kotlin:kotlin-stdlib:%s" % KOTLIN_VERSION: {"insecure": True},
"org.jetbrains.kotlin:kotlin-stdlib-common:%s" % KOTLIN_VERSION: {"insecure": True},
"com.android.tools.build:builder-model:2.3.0": {"insecure": True}, # tests regression #38
"com.android.tools:annotations:25.3.0": {"insecure": True},
"javax.annotation:javax.annotation-api:1.2": {"insecure": True}, # tests regression #40
"org.checkerframework:checker-qual:2.5.3": {"insecure": True},
"com.googlecode.java-diff-utils:diffutils:1.3.0": {"insecure": True},
"com.google.auto.value:auto-value-annotations:1.6.3": {"insecure": True},
"com.google.auto.value:auto-value:1.6.3": {"insecure": True, "build_snippet": AUTO_VALUE_BUILD_SNIPPET_WITH_PLUGIN.format(version = "1.6.3")},
"org.reflections:reflections:0.9.11": {"insecure": True }, # test leniency related to #62.
"org.javassist:javassist:3.21.0-GA": {"insecure": True}, # Only needed if #62 is fixed.
"androidx.arch.core:core-runtime:2.0.0": {"insecure": True},
"androidx.annotation:annotation:1.0.0": { "insecure": True },
"androidx.arch.core:core-common:2.0.0": { "insecure": True },
# Legacy android dep. Uncommenting this will cause an error if use_jetifier = True.
# "com.android.support:support-v4:26.1.0:aar": { "insecure": True },
},
repository_urls = [
"https://repo1.maven.org/maven2",
"https://maven.google.com",
],
# Because these apply to all targets within a group, it's specified separately from the artifact list.
dependency_target_substitutes = {
# Because we rewrite dagger -> dagger_api (and make a wrapper target "dagger" that exports the dagger
# annotation processor) we need to rewrite the internal dependencies inside the com/google/dagger package
# to reflect this.
# "groupId": { "full bazel target": "full alternate target" }
"com.google.dagger": {"@maven//com/google/dagger:dagger": "@maven//com/google/dagger:dagger-api"},
},
)
android_sdk_repository(
name = "androidsdk",
api_level = 28,
build_tools_version = "28.0.3",
)