Skip to content

Commit c40d2e5

Browse files
committed
1 parent ff12c2c commit c40d2e5

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

examples/jetpack_compose/.bazelrc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,11 @@ build --define=android_dexmerger_tool=d8_dexmerger
55
build --define=android_incremental_dexing_tool=d8_dexbuilder
66
build --define=android_standalone_dexing_tool=d8_compat_dx
77

8-
common --enable_workspace=true --enable_bzlmod=false
8+
common --enable_workspace=true --enable_bzlmod=false
9+
common --noincompatible_enable_android_toolchain_resolution
10+
build --platform_mappings=platform_mappings
11+
build --fat_apk_cpu arm64-v8a
12+
# Uncomment the below lines to build for x86
13+
# build --fat_apk_cpu x86_64
14+
build --android_crosstool_top=@androidndk//:toolchain
15+
build --@rules_kotlin//kotlin/settings:jvm_emit_jdeps=False

examples/jetpack_compose/BUILD

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,11 @@ platform(
3333
"@platforms//os:android",
3434
],
3535
)
36+
37+
platform(
38+
name = "x86_64",
39+
constraint_values = [
40+
"@platforms//cpu:x86_64",
41+
"@platforms//os:android",
42+
],
43+
)

examples/jetpack_compose/WORKSPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ KOTLIN_TO_COMPOSE = {
8181
load("@rules_jvm_external//:defs.bzl", "maven_install")
8282

8383
maven_install(
84+
name = "maven",
8485
artifacts = KOTLIN_TO_COMPOSE[KOTLINC_RELEASE.version],
86+
fetch_sources = True,
8587
maven_install_json = "//:maven_install-%s.json" % KOTLINC_RELEASE.version,
8688
repositories = [
8789
"https://maven.google.com",
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
flags:
2+
# Android
3+
# Mostly, native code is compiled after the android_binary rule has run a transition to compile for that platform.
4+
# We just detect the transition, which sets "Android configuration distinguisher", and then translate the CPU it set.
5+
--Android configuration distinguisher=android
6+
--cpu=arm64-v8a
7+
//:arm64-v8a
8+
--Android configuration distinguisher=android
9+
--cpu=x86_64
10+
//:x86_64

0 commit comments

Comments
 (0)