-
Notifications
You must be signed in to change notification settings - Fork 10
/
WORKSPACE
106 lines (83 loc) · 3.28 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
workspace(name = "bazel_jetpack_compose_example")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
_COMPOSE_VERSION = "1.2.0-beta02"
_KOTLIN_COMPILER_VERSION = "1.6.21"
_KOTLIN_COMPILER_SHA = "632166fed89f3f430482f5aa07f2e20b923b72ef688c8f5a7df3aa1502c6d8ba"
## JVM External
_RULES_JVM_EXTERNAL_VERSION = "4.2"
_RULES_JVM_EXTERNAL_SHA = "cd1a77b7b02e8e008439ca76fd34f5b07aecb8c752961f9640dea15e9e5ba1ca"
http_archive(
name = "rules_jvm_external",
sha256 = _RULES_JVM_EXTERNAL_SHA,
strip_prefix = "rules_jvm_external-{}".format(_RULES_JVM_EXTERNAL_VERSION),
urls = [
"https://github.com/bazelbuild/rules_jvm_external/archive/{}.zip".format(_RULES_JVM_EXTERNAL_VERSION),
],
)
load("@rules_jvm_external//:defs.bzl", "maven_install")
maven_install(
artifacts = [
"org.jetbrains.kotlin:kotlin-stdlib:{}".format(_KOTLIN_COMPILER_VERSION),
"androidx.core:core-ktx:1.7.0",
"androidx.appcompat:appcompat:1.4.1",
"androidx.activity:activity-compose:1.4.0",
"androidx.compose.material:material:{}".format(_COMPOSE_VERSION),
"androidx.compose.ui:ui:{}".format(_COMPOSE_VERSION),
"androidx.compose.ui:ui-tooling:{}".format(_COMPOSE_VERSION),
"androidx.compose.compiler:compiler:{}".format(_COMPOSE_VERSION),
"androidx.compose.runtime:runtime:{}".format(_COMPOSE_VERSION),
],
override_targets = {
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm": "@//:kotlinx_coroutines_core_jvm",
},
repositories = [
"https://maven.google.com",
"https://repo1.maven.org/maven2",
],
version_conflict_policy = "pinned",
)
# Secondary maven repository used mainly for workarounds
maven_install(
name = "maven_secondary",
artifacts = [
# Workaround to add missing 'sun.misc' dependencies to 'kotlinx-coroutines-core-jvm' artifact
# Check root BUILD file and 'override_targets' arg of a primary 'maven_install'
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.1",
],
fetch_sources = True,
repositories = ["https://repo1.maven.org/maven2"],
)
## Android
_RULES_ANDROID_VERSION = "0.1.1"
_RULES_ANDROID_SHA = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806"
http_archive(
name = "build_bazel_rules_android",
sha256 = _RULES_ANDROID_SHA,
strip_prefix = "rules_android-{}".format(_RULES_ANDROID_VERSION),
urls = [
"https://github.com/bazelbuild/rules_android/archive/v{}.zip".format(_RULES_ANDROID_VERSION),
],
)
load("@build_bazel_rules_android//android:rules.bzl", "android_sdk_repository")
android_sdk_repository(
name = "androidsdk",
api_level = 31,
)
## Kotlin
# Enable Kotlin
_RULES_KOTLIN_VERSION = "1.6.0"
http_archive(
name = "io_bazel_rules_kotlin",
sha256 = "a57591404423a52bd6b18ebba7979e8cd2243534736c5c94d35c89718ea38f94",
urls = [
"https://github.com/bazelbuild/rules_kotlin/releases/download/v{}/rules_kotlin_release.tgz".format(_RULES_KOTLIN_VERSION),
],
)
load("@io_bazel_rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories", "kotlinc_version")
kotlin_repositories(
compiler_release = kotlinc_version(
release = _KOTLIN_COMPILER_VERSION,
sha256 = _KOTLIN_COMPILER_SHA,
),
)
register_toolchains("//:kotlin_toolchain")