1
1
load ("@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" )
2
2
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
-
9
3
# Setup Kotlin
4
+
10
5
http_archive (
11
6
name = "rules_kotlin" ,
12
7
sha256 = "34e8c0351764b71d78f76c8746e98063979ce08dcf1a91666f3f3bc2949a533d" ,
13
8
url = "https://github.com/bazelbuild/rules_kotlin/releases/download/v1.9.5/rules_kotlin-v1.9.5.tar.gz" ,
14
9
)
15
10
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
17
14
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
+ )
19
24
20
25
register_toolchains ("//:kotlin_toolchain" )
21
26
22
27
## JVM External
23
28
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
+
24
39
http_archive (
25
40
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 ,
28
43
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 ,
31
46
),
32
47
)
33
48
34
- load ("@rules_jvm_external//:defs .bzl" , "maven_install " )
49
+ load ("@rules_jvm_external//:repositories .bzl" , "rules_jvm_external_deps " )
35
50
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" ,
40
70
"androidx.core:core-ktx:1.15.0" ,
41
71
"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" ,
48
78
],
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 ,
49
86
repositories = [
50
87
"https://maven.google.com" ,
51
88
"https://repo1.maven.org/maven2" ,
52
89
],
90
+ resolver = "coursier" if KOTLINC_RELEASE .version == "1.9.22" else "maven" ,
53
91
)
54
92
55
93
http_archive (
@@ -74,4 +112,7 @@ load("@rules_android//android:rules.bzl", "android_sdk_repository")
74
112
75
113
android_sdk_repository (name = "androidsdk" )
76
114
77
- android_ndk_repository (name = "androidndk" )
115
+ android_ndk_repository (
116
+ name = "androidndk" ,
117
+ api_level = 21 ,
118
+ )
0 commit comments