-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Hermes] Android integration #410
Changes from all commits
93f3f15
79ef3e4
d4d6c0a
fd8c9d2
df4ce9f
0c8b18e
8d0ef0c
05ff72f
6c52da3
6b40f5b
faacc96
3bf94f7
18d0752
b91f14a
8b714ba
6fdd9f1
071c943
c1148f9
0469f44
d580ce0
de47cdc
5c13252
6c46714
6534859
58cca1c
eafbfa7
8522335
05ff3fb
9470473
6c966c6
280da27
9e48890
b90b260
acfdfeb
aa115ab
a62bb4b
4d7d167
4a1ac67
66f1353
ba0915e
4d7baff
b0aa65d
edc631c
8e2a1dd
78248d8
07f35b1
06828e0
8400548
dc54a69
6a3cba8
ec7e14c
151cfd5
a457bba
d013b31
7feec54
167afa0
3de2414
2def3cf
1ed1bc8
d75de1d
be7c8fd
28a06da
e10f14a
5bfa3aa
a6befe4
3642b46
095bb2f
dcb609f
2ce8889
e57488f
edebbfa
271d015
0ae5119
4140ddc
73b5f92
e779860
cadf1d3
f20931e
17acf81
5584fdd
3a0b21f
bd0f50e
bc1fb11
9005344
19f6635
8e06211
ae8d211
efe31be
755d5d8
377f777
c10ea6b
a622bee
eb216b0
20cec9b
3ce86c4
6cc8a96
012829a
ad0d871
a99d3b6
fcf55d8
127c033
ffa205e
b71bfff
80160ca
9e53539
09ebaa5
a384f04
f1b32d1
bba9dd0
0d6900f
fe04079
8c1e834
c2bd6c2
e917a36
ad6d7ca
d2c3484
513b5e5
612b3d0
e92e509
9f4f1e8
becf214
a728ef6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ orbs: | |
executors: | ||
base: | ||
docker: | ||
- image: docker.io/playerui/bazel-docker | ||
- image: docker.io/playerui/bazel-docker:11 | ||
working_directory: ~/player | ||
resource_class: xlarge | ||
environment: | ||
|
@@ -99,10 +99,10 @@ jobs: | |
echo "coverage --remote_header=x-buildbuddy-api-key=${BUILDBUDDY_API_KEY}" >> .bazelrc.local | ||
if [ "${CIRCLE_BRANCH}" == "main" ]; then | ||
echo "Running on main" | ||
echo 'build:ci --define build_type=release' >> .bazelrc.local | ||
echo 'common --//android/player:runtime=j2v8 >> .bazelrc.local | ||
else | ||
echo "Running on PR" | ||
echo 'build:ci --define build_type=debug' >> .bazelrc.local | ||
echo 'common --//android/player:runtime=j2v8-debug >> .bazelrc.local | ||
fi | ||
- persist_to_workspace: | ||
root: . | ||
|
@@ -114,7 +114,7 @@ jobs: | |
steps: | ||
- attach_workspace: | ||
at: ~/player | ||
# need to filter because //android/demo rules dont resolve | ||
|
||
- run: bazel build --config=ci -- $(bazel query 'filter("native_bundle$", //...)') | ||
|
||
- save_cache: | ||
|
@@ -237,6 +237,7 @@ jobs: | |
|
||
- run: | | ||
bazel test --config=ci -- $(bazel query 'kind(".*_test", //...) except filter("ios|swiftui", //...)') -//android/demo:android_instrumentation_test | ||
bazel test --config=ci --//android/player:runtime=hermes -- $(bazel query 'kind(".*_test", //...) except filter("ios|swiftui", //...)') -//android/demo:android_instrumentation_test | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This, plus the one below ensure we re-run all relevant tests (that depend on |
||
|
||
- run: | ||
when: always | ||
|
@@ -292,7 +293,9 @@ jobs: | |
command: | | ||
circle-android wait-for-boot | ||
|
||
- run: bazel test --config=ci -- //android/demo:android_instrumentation_test | ||
- run: | | ||
bazel test --config=ci -- //android/demo:android_instrumentation_test | ||
bazel test --config=ci --//android/player:runtime=hermes -- //android/demo:android_instrumentation_test | ||
|
||
- run: | ||
when: always | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ typedoc | |
/.idea/ | ||
/.ijwb/ | ||
/.aswb/ | ||
/.clwb/ | ||
/.project | ||
/.settings | ||
/.vscode/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
load("@rules_player//ios:defs.bzl", "assemble_pod", "ios_publish") | ||
load("@rules_player//internal:defs.bzl", "stamp") | ||
load("@npm//:defs.bzl", "npm_link_all_packages") | ||
load("@aspect_rules_js//js:defs.bzl", "js_library") | ||
load("@bazel_gazelle//:def.bzl", "gazelle_binary", "gazelle") | ||
load("@bazel_skylib//rules:common_settings.bzl", "string_flag") | ||
load("@npm//:defs.bzl", "npm_link_all_packages") | ||
load("@rules_player//internal:defs.bzl", "stamp") | ||
load("@rules_player//ios:defs.bzl", "assemble_pod", "ios_publish") | ||
load("@rules_swift_package_manager//swiftpkg:defs.bzl", "swift_update_packages") | ||
load("@bazel_tools//tools/jdk:default_java_toolchain.bzl", "default_java_toolchain") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
|
@@ -90,14 +90,14 @@ stamp( | |
name = "PlayerUI_Podspec", | ||
files = ["//:PlayerUI.podspec"], | ||
stable = True, | ||
stamp = -1, | ||
substitutions = { | ||
"0.0.1-placeholder": "{STABLE_VERSION}", | ||
}, | ||
stamp = -1, | ||
) | ||
|
||
exports_files([ | ||
"PlayerUI.podspec" | ||
"PlayerUI.podspec", | ||
]) | ||
|
||
assemble_pod( | ||
|
@@ -286,3 +286,66 @@ java_plugin( | |
) | ||
#SwiftLint | ||
exports_files([".swiftlint.yml"]) | ||
|
||
# Native platform settings | ||
|
||
string_flag( | ||
name = "cmake_build_type", | ||
build_setting_default = "Debug", | ||
make_variable = "CMAKE_BUILD_TYPE", | ||
values = [ | ||
"Debug", | ||
"Release", | ||
"MinSizeRel", | ||
"RelWithDebInfo", | ||
], | ||
) | ||
|
||
config_setting( | ||
name = "cmake_build_type_debug", | ||
flag_values = { | ||
":cmake_build_type": "Debug", | ||
}, | ||
) | ||
|
||
config_setting( | ||
name = "cmake_build_type_release", | ||
flag_values = { | ||
":cmake_build_type": "Release", | ||
}, | ||
) | ||
|
||
config_setting( | ||
name = "cmake_build_type_minsizerel", | ||
flag_values = { | ||
":cmake_build_type": "MinSizeRel", | ||
}, | ||
) | ||
|
||
config_setting( | ||
name = "cmake_build_type_relwithdebinfo", | ||
flag_values = { | ||
":cmake_build_type": "RelWithDebInfo", | ||
}, | ||
) | ||
|
||
# TODO: Enable platform support for detecting Android OS as well as cpu | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will be something we'll have better support for w/ Bazel 7 |
||
config_setting( | ||
name = "arm64-v8a", | ||
values = {"cpu": "arm64-v8a"}, | ||
) | ||
|
||
config_setting( | ||
name = "armeabi-v7a", | ||
values = {"cpu": "armeabi-v7a"}, | ||
) | ||
|
||
config_setting( | ||
name = "x86", | ||
values = {"cpu": "x86"}, | ||
) | ||
|
||
config_setting( | ||
name = "x86_64", | ||
values = {"cpu": "x86_64"}, | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ module( | |
) | ||
|
||
bazel_dep(name = "rules_player") | ||
|
||
archive_override( | ||
module_name = "rules_player", | ||
strip_prefix = "rules_player-1.1.1", | ||
|
@@ -19,6 +18,10 @@ bazel_dep(name = "bazel_skylib", version = "1.7.1") | |
bazel_dep(name = "rules_pkg", version = "1.0.1") | ||
bazel_dep(name = "aspect_rules_ts", version = "2.4.2") | ||
|
||
# C++ | ||
bazel_dep(name = "rules_foreign_cc", version = "0.10.1") | ||
bazel_dep(name = "googletest", version = "1.14.0") | ||
|
||
####### Node.js version ######### | ||
bazel_dep(name = "rules_nodejs", version = "6.2.0") | ||
|
||
|
@@ -78,9 +81,10 @@ rules_ts_ext.deps() | |
use_repo(rules_ts_ext, "npm_typescript") | ||
|
||
# Kotlin | ||
bazel_dep( | ||
name = "rules_kotlin", | ||
version = "1.9.1", | ||
bazel_dep(name = "rules_kotlin", version = "1.9.1") | ||
single_version_override( | ||
module_name = "rules_kotlin", | ||
patches = ["//patches:rules_kotlin.context_receivers.patch"], | ||
) | ||
|
||
# TODO: Custom compiler version breaks embedded jdeps generator plugin - enable when removing custom kotlinc (see .bazelrc jvm_emit_jdeps) | ||
|
@@ -120,8 +124,7 @@ use_repo(remote_android_extensions, "android_gmaven_r8") | |
bazel_dep(name = "rules_jvm_external") | ||
git_override( | ||
module_name = "rules_jvm_external", | ||
# bazel-6 branch | ||
commit = "44f4355b2dbe0d6fd73d690ad66bf5744d482a29", | ||
commit = "73b63ba801f14d1bde7807994cc8c15db226ceec", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue encountered when packaging large binaries: |
||
remote = "https://github.com/sugarmanz/rules_jvm_external.git", | ||
) | ||
|
||
|
@@ -175,10 +178,16 @@ maven.install( | |
"org.graalvm.js:js-scriptengine:21.2.0", | ||
"org.graalvm.sdk:graal-sdk:21.2.0", | ||
|
||
# J2V8 debug | ||
# J2V8 | ||
"com.eclipsesource.j2v8:j2v8:aar:6.1.0", | ||
"com.github.AlexTrotsenko:j2v8-debugger:0.2.3", | ||
"com.facebook.stetho:stetho:1.5.1", | ||
|
||
# Hermes | ||
"com.facebook.fbjni:fbjni-java-only:0.6.0", | ||
"com.facebook.fbjni:fbjni:0.6.0", | ||
"com.facebook.soloader:soloader:0.11.0", | ||
|
||
# Test utils | ||
"org.junit.jupiter:junit-jupiter-api:5.6.0", | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we merge the docker changes in before merging this so we're not targeting a specific image?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can! I was avoiding merging that PR until the release was done to make sure it wouldn't accidentally break CI (does make a strong case for tagging our images per release and always targeting a tag).