Skip to content

Commit fbd257c

Browse files
committed
Finally get a working set of libraries
1 parent b0b3abd commit fbd257c

File tree

4 files changed

+4149
-24
lines changed

4 files changed

+4149
-24
lines changed

examples/jetpack_compose/WORKSPACE

Lines changed: 65 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,93 @@
11
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
22

3-
KOTLIN_TO_COMPOSE = {
4-
"1.9.5": "1.1.1",
5-
"2.0.0": "1.2.1",
6-
"2.1.0": "1.7.6",
7-
}
8-
93
# Setup Kotlin
4+
105
http_archive(
116
name = "rules_kotlin",
127
sha256 = "34e8c0351764b71d78f76c8746e98063979ce08dcf1a91666f3f3bc2949a533d",
138
url = "https://github.com/bazelbuild/rules_kotlin/releases/download/v1.9.5/rules_kotlin-v1.9.5.tar.gz",
149
)
1510

16-
load("@rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories", "versions")
11+
load("@rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories", "kotlinc_version", "versions")
12+
13+
KOTLINC_RELEASE = versions.KOTLIN_CURRENT_COMPILER_RELEASE
1714

18-
kotlin_repositories()
15+
kotlin_repositories(
16+
compiler_release = kotlinc_version(
17+
release = "2.0.0",
18+
sha256 = "ef578730976154fd2c5968d75af8c2703b3de84a78dffe913f670326e149da3b",
19+
) if KOTLINC_RELEASE.version == "1.9.22" else kotlinc_version(
20+
release = KOTLINC_RELEASE.version,
21+
sha256 = KOTLINC_RELEASE.sha256,
22+
),
23+
)
1924

2025
register_toolchains("//:kotlin_toolchain")
2126

2227
## JVM External
2328

29+
versions.use_repository(
30+
name = "io_bazel_stardoc",
31+
rule = http_archive,
32+
version = versions.IO_BAZEL_STARDOC,
33+
)
34+
35+
RULES_JVM_EXTERNAL_TAG = "6.6"
36+
37+
RULES_JVM_EXTERNAL_SHA = "3afe5195069bd379373528899c03a3072f568d33bd96fe037bd43b1f590535e7"
38+
2439
http_archive(
2540
name = "rules_jvm_external",
26-
sha256 = versions.RULES_JVM_EXTERNAL_SHA,
27-
strip_prefix = "rules_jvm_external-%s" % versions.RULES_JVM_EXTERNAL_TAG,
41+
sha256 = RULES_JVM_EXTERNAL_SHA,
42+
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
2843
url = "https://github.com/bazelbuild/rules_jvm_external/releases/download/%s/rules_jvm_external-%s.tar.gz" % (
29-
versions.RULES_JVM_EXTERNAL_TAG,
30-
versions.RULES_JVM_EXTERNAL_TAG,
44+
RULES_JVM_EXTERNAL_TAG,
45+
RULES_JVM_EXTERNAL_TAG,
3146
),
3247
)
3348

34-
load("@rules_jvm_external//:defs.bzl", "maven_install")
49+
load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")
3550

36-
maven_install(
37-
artifacts = [
38-
"org.jetbrains.kotlin:kotlin-compose-compiler-plugin-embeddable:{}".format(versions.KOTLIN_CURRENT_COMPILER_RELEASE.version),
39-
"org.jetbrains.kotlin:kotlin-stdlib:{}".format(versions.KOTLIN_CURRENT_COMPILER_RELEASE.version),
51+
rules_jvm_external_deps()
52+
53+
load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup")
54+
55+
rules_jvm_external_setup()
56+
57+
KOTLIN_TO_COMPOSE = {
58+
"1.9.22": [
59+
"org.jetbrains.kotlin:kotlin-compose-compiler-plugin-embeddable:2.0.0",
60+
"androidx.core:core-ktx:1.7.0",
61+
"androidx.appcompat:appcompat:1.4.1",
62+
"androidx.activity:activity-compose:1.3.0",
63+
"androidx.compose.material:material:1.2.1",
64+
"androidx.compose.ui:ui:1.2.1",
65+
"androidx.compose.ui:ui-tooling:1.2.1",
66+
"androidx.compose.runtime:runtime:1.2.1",
67+
],
68+
"2.1.0": [
69+
"org.jetbrains.kotlin:kotlin-compose-compiler-plugin-embeddable:2.1.0",
4070
"androidx.core:core-ktx:1.15.0",
4171
"androidx.appcompat:appcompat:1.7.0",
42-
"androidx.activity:activity-compose:1.9.3",
43-
"androidx.collection:collection:1.0.0",
44-
"androidx.compose.material:material:{}".format(KOTLIN_TO_COMPOSE[versions.KOTLIN_CURRENT_COMPILER_RELEASE.version]),
45-
"androidx.compose.ui:ui:{}".format(KOTLIN_TO_COMPOSE[versions.KOTLIN_CURRENT_COMPILER_RELEASE.version]),
46-
"androidx.compose.ui:ui-tooling:{}".format(KOTLIN_TO_COMPOSE[versions.KOTLIN_CURRENT_COMPILER_RELEASE.version]),
47-
"androidx.compose.runtime:runtime:{}".format(KOTLIN_TO_COMPOSE[versions.KOTLIN_CURRENT_COMPILER_RELEASE.version]),
72+
"androidx.activity:activity-compose:1.7.0",
73+
"androidx.collection:collection:1.5.0-alpha06",
74+
"androidx.compose.material:material:1.7.6",
75+
"androidx.compose.ui:ui:1.7.6",
76+
"androidx.compose.ui:ui-tooling:1.7.6",
77+
"androidx.compose.runtime:runtime:1.7.6",
4878
],
79+
}
80+
81+
load("@rules_jvm_external//:defs.bzl", "maven_install")
82+
83+
maven_install(
84+
artifacts = KOTLIN_TO_COMPOSE[KOTLINC_RELEASE.version],
85+
maven_install_json = "//:maven_install-%s.json" % KOTLINC_RELEASE.version,
4986
repositories = [
5087
"https://maven.google.com",
5188
"https://repo1.maven.org/maven2",
5289
],
90+
resolver = "coursier" if KOTLINC_RELEASE.version == "1.9.22" else "maven",
5391
)
5492

5593
http_archive(
@@ -74,4 +112,7 @@ load("@rules_android//android:rules.bzl", "android_sdk_repository")
74112

75113
android_sdk_repository(name = "androidsdk")
76114

77-
android_ndk_repository(name = "androidndk")
115+
android_ndk_repository(
116+
name = "androidndk",
117+
api_level = 21,
118+
)

0 commit comments

Comments
 (0)