Skip to content
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

Bazel 6 JVM + Android #391

Merged
merged 134 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from 116 commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
ad29b47
Merge branch 'main' into bazel-6
sugarmanz Apr 24, 2024
dfd27ae
wip reference assets cli plugin
sugarmanz Apr 24, 2024
2856275
Saving progress. Split targets based on src folder
adierkens Apr 24, 2024
8970bba
Saving progress. Config loads
adierkens Apr 24, 2024
234c044
Skip testing mocks for now
adierkens Apr 24, 2024
e90f36d
Add cli-preset & generate xlrs for reference assets + types
adierkens Apr 25, 2024
0979043
Update preset
adierkens Apr 25, 2024
6e0bf15
Add other asset types to plugin
adierkens Apr 25, 2024
1eecc6d
Use js_xlr_pipeline macro for ref assets & types
adierkens Apr 25, 2024
27091a5
set up maven
brocollie08 Apr 4, 2024
f7fa513
kotlin serialization builds..
brocollie08 Apr 6, 2024
3030a91
jvm core building
brocollie08 Apr 10, 2024
c01fc64
test running
brocollie08 Apr 10, 2024
4ad017c
jvm building
brocollie08 Apr 10, 2024
d62126e
fix most of the tests
brocollie08 Apr 13, 2024
8da3036
target es5 for native build
sugarmanz Apr 30, 2024
836511f
bundled reference assets mocks
sugarmanz May 20, 2024
7b0f4ab
aggregate mocks into //tools/mocks
sugarmanz May 21, 2024
8d19e33
build all the plugins
brocollie08 May 21, 2024
f5ec475
playerui in packages
brocollie08 May 21, 2024
84c9790
grab bazel common works
brocollie08 May 23, 2024
114838f
android player building
brocollie08 May 23, 2024
451616c
android test building
brocollie08 May 28, 2024
d9010c0
demo lib building
brocollie08 May 29, 2024
a03690a
android_ndk_respository cuz how can this NOT be needed for native and…
brocollie08 May 30, 2024
d639007
building reference assets android
brocollie08 May 30, 2024
cfabdda
everything building
brocollie08 Jun 6, 2024
a7fb44b
revert some unneeded changes
brocollie08 Jun 6, 2024
22b3f26
enabled and fixed most andriod reference asset tests
brocollie08 Jun 8, 2024
675d400
fix a bunch more unit tests
brocollie08 Jun 10, 2024
20c63b1
package apk properly
brocollie08 Jun 12, 2024
4a46e15
latest rules_jvm before bazel7
brocollie08 Jun 12, 2024
637ddb7
update rules jvm and tests
brocollie08 Jun 17, 2024
7e6d724
replace local rules with git repos
brocollie08 Jun 17, 2024
6d69a43
install android 33
brocollie08 Jun 18, 2024
dcfe0f5
enable distribution + use original rules_jvm
brocollie08 Jun 20, 2024
b4980c3
merge bazel-6
brocollie08 Jun 20, 2024
1c9b5d2
fix merge
brocollie08 Jun 20, 2024
6f7efd2
fix mocks
brocollie08 Jun 21, 2024
e5a2287
remove aar
brocollie08 Jun 21, 2024
95ffdef
updated docker
brocollie08 Jun 21, 2024
74a0163
update android image
brocollie08 Jun 21, 2024
711f2b0
set android ndk home
brocollie08 Jun 24, 2024
198084d
also add tools to ios build
brocollie08 Jun 24, 2024
8066e87
re-enable android script to enable workspace ndk config
brocollie08 Jun 24, 2024
749152d
define android_home
brocollie08 Jun 24, 2024
b8c15da
specify java environment
brocollie08 Jun 24, 2024
8faa70c
log java env
brocollie08 Jun 24, 2024
c483fef
what am i doing..
brocollie08 Jun 24, 2024
7bde635
gotta install jdk first
brocollie08 Jun 24, 2024
32dfaa6
try 11
brocollie08 Jun 24, 2024
a76acfc
and use it
brocollie08 Jun 24, 2024
1b8e06b
what is in here
brocollie08 Jun 24, 2024
41b59ba
change java_home?
brocollie08 Jun 24, 2024
3af2fa0
apple silicon install location?
brocollie08 Jun 24, 2024
d2e4412
correct location
brocollie08 Jun 24, 2024
402ab25
rosetta?
brocollie08 Jun 24, 2024
bea8ce2
install only ndk
brocollie08 Jun 24, 2024
0400274
brew install on rosetta
brocollie08 Jun 24, 2024
06fa51c
revert
brocollie08 Jun 24, 2024
06a9297
accept 1 less license
brocollie08 Jun 24, 2024
8df6f28
skip license accept
brocollie08 Jun 25, 2024
b80134a
zulu
brocollie08 Jun 25, 2024
41ed0cf
don't tap
brocollie08 Jun 25, 2024
82602b3
@
brocollie08 Jun 25, 2024
99e3081
change java_home
brocollie08 Jun 25, 2024
f18fbd5
caskroom
brocollie08 Jun 25, 2024
2f660bf
don't install anything just create folder
brocollie08 Jun 25, 2024
9d5940e
back to 11
brocollie08 Jun 25, 2024
24f7f11
revert script and install temurin8
brocollie08 Jun 25, 2024
4722768
temurin requires rosetta
brocollie08 Jun 25, 2024
d415c61
install rosetta at teh top
brocollie08 Jun 25, 2024
197e662
install rosetta at the top
brocollie08 Jun 25, 2024
fe41062
root installer
brocollie08 Jun 25, 2024
2792f8b
proper JAVA_HOME maybe
brocollie08 Jun 25, 2024
4c2b4e8
remove evals
brocollie08 Jun 25, 2024
31763c5
install sdk too
brocollie08 Jun 25, 2024
f7c2646
Merge branch 'bazel-6' into bazel-6-android
brocollie08 Jun 25, 2024
6ed30c1
remove duplicate classes
brocollie08 Jun 25, 2024
0b4a8cd
change test to match bazel6
brocollie08 Jun 25, 2024
39db253
change type-provider back
brocollie08 Jun 25, 2024
a121305
remove all NATIVE_BUILD_DEPS
brocollie08 Jun 25, 2024
02d8147
Revert "remove all NATIVE_BUILD_DEPS"
nancywu1 Jun 25, 2024
1ac0ed8
Revert "change type-provider back"
nancywu1 Jun 25, 2024
20a15f1
fix swift test check
brocollie08 Jun 25, 2024
65be5e1
add choiceAsset and unify test framework versions
brocollie08 Jun 26, 2024
287bf20
lint
brocollie08 Jun 26, 2024
3df09dc
try removing the directory from working directory to see impact on wo…
brocollie08 Jun 26, 2024
5bcdf65
git rm
brocollie08 Jun 26, 2024
843f6f1
forget it, gitignore it is
brocollie08 Jun 26, 2024
2cc17e1
comment out non-existing things from rules_palyer
brocollie08 Jun 27, 2024
120f654
remove jvm deps.bzl
brocollie08 Jun 27, 2024
728f088
latest rules player with publishing
brocollie08 Jun 27, 2024
be0454a
embedded jdk
brocollie08 Jun 27, 2024
66ec24f
remove debugger from j2v8 deps
brocollie08 Jun 28, 2024
ee4abc1
add debugger to demo
brocollie08 Jun 28, 2024
674ebab
attempt at solving lint issues
brocollie08 Jun 30, 2024
5b58416
remote jdk over embedded
brocollie08 Jul 1, 2024
3eae3f2
does this do anything
brocollie08 Jul 1, 2024
0f8552a
set all java options
brocollie08 Jul 1, 2024
f4fe964
jdk11
brocollie08 Jul 1, 2024
ac99569
java_language_version
brocollie08 Jul 1, 2024
596bd5f
fix targets
brocollie08 Jul 1, 2024
7df8055
update release scripts to call proper js package target
KetanReddy Jul 2, 2024
40b1dbf
remove embedded jdk
brocollie08 Jul 3, 2024
95f8042
iOS - Use reference assets in swiftui tests (#368)
nancywu1 Jun 10, 2024
5f0cdc5
Ayncnode comments cleanup (#385)
sakuntala-motukuri Jun 12, 2024
9fd647e
update readme
Jun 13, 2024
69480d8
Merge branch 'bazel-6' into separate-out-uitests
nancywu1 Jul 3, 2024
f87cb6d
Merge branch 'bazel-6-android' into separate-out-uitests
nancywu1 Jul 3, 2024
41a1694
Merge pull request #390 from player-ui/separate-out-uitests
nancywu1 Jul 4, 2024
c4a20de
some clarification docs for binding classes
brocollie08 Jul 5, 2024
d9a7a5e
Merge branch 'bazel-6-android' of github.com:player-ui/player into ba…
brocollie08 Jul 5, 2024
da15b86
enable ndk 23
sugarmanz Jul 5, 2024
9afb83e
remove workspace ndk setup
brocollie08 Jul 5, 2024
cf46da3
compile against kotlin 1.7 to be compatible with gradle 7
sugarmanz Jul 6, 2024
be1b030
remove grab db
brocollie08 Jul 8, 2024
d4a5109
Revert "remove grab db"
brocollie08 Jul 8, 2024
bdabfad
address most of the comments
brocollie08 Jul 8, 2024
9f1e019
address some more comments
brocollie08 Jul 8, 2024
52d3d27
add test back in
brocollie08 Jul 8, 2024
640ac60
more comments
brocollie08 Jul 8, 2024
172c4d0
remove dummy API classes
brocollie08 Jul 8, 2024
b6493ae
all targets except ios
brocollie08 Jul 8, 2024
3fd4c4c
install tools
brocollie08 Jul 9, 2024
44eed30
doc builds working
KetanReddy Jul 9, 2024
c6a75ed
Fix storybook addons
KetanReddy Jul 9, 2024
cc330a5
Merge branch 'bazel-6-android' of https://github.com/player-ui/player…
KetanReddy Jul 9, 2024
a8d0190
fix a bunch of tests and change test command
brocollie08 Jul 9, 2024
7dea55a
Merge branch 'bazel-6-android' of github.com:player-ui/player into ba…
brocollie08 Jul 9, 2024
2de2bab
super mocks bundle
KetanReddy Jul 9, 2024
ece8bac
Merge branch 'bazel-6-android' of https://github.com/player-ui/player…
KetanReddy Jul 9, 2024
839b313
fix player test
brocollie08 Jul 9, 2024
6068f96
last test
brocollie08 Jul 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ plugins/meta-plugin/core/node_modules
plugins/partial-match-fingerprint/core/node_modules
plugins/pubsub/core/node_modules
plugins/reference-assets/components/node_modules
plugins/reference-assets/cli-preset/node_modules
plugins/reference-assets/core/node_modules
plugins/reference-assets/react/node_modules
plugins/shared-constants/core/node_modules
Expand Down
6 changes: 6 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
common --enable_bzlmod
test --test_output=errors
coverage --combined_report=lcov

# TODO: Custom compiler version breaks embedded jdeps generator plugin - enable when removing custom kotlinc
build --@rules_kotlin//kotlin/settings:jvm_emit_jdeps=False

# Android databinding flags
# TODO: Verify the follow doesn't break host compil
build --android_crosstool_top=@androidndk//:toolchain
build --experimental_android_databinding_v2
build --android_databinding_use_v3_4_args
build --android_databinding_use_androidx
Expand Down
43 changes: 37 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ orbs:
executors:
base:
docker:
- image: docker.io/playerui/bazel-docker:7
- image: docker.io/playerui/bazel-docker:10
working_directory: ~/player
resource_class: xlarge
environment:
Expand All @@ -30,7 +30,7 @@ executors:
TZ: "/usr/share/zoneinfo/America/Los_Angeles"
android:
machine:
image: android:202102-01
image: android:2024.04.1
working_directory: ~/player
resource_class: large
environment:
Expand Down Expand Up @@ -114,10 +114,34 @@ jobs:
- attach_workspace:
at: ~/player

- macos/install-rosetta

- run:
name: Homebrew Dependencies
command: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install bazelisk lcov
brew install --cask temurin@8
sudo installer -pkg /opt/homebrew/Caskroom/temurin@8/8,412,08/OpenJDK8U-jdk_x64_mac_hotspot_8u412b08.pkg -target /

- restore_cache:
keys:
- android-tools-{{ arch }}-{{ checksum "scripts/install-android-tools.sh" }}

- run: echo 'export ANDROID_HOME=~/android-tools' >> $BASH_ENV

- run:
name: Install Android tools
command: |
sh scripts/install-android-tools.sh
echo 'export ANDROID_SDK_HOME=$ANDROID_HOME' >> $BASH_ENV
echo 'export ANDROID_NDK_HOME=$ANDROID_SDK_HOME/ndk/21.4.7075529' >> $BASH_ENV
echo 'export PATH=$ANDROID_SDK_HOME/tools/bin:$PATH' >> $BASH_ENV
echo 'export PATH=$ANDROID_SDK_HOME/tools:$PATH' >> $BASH_ENV
echo 'export PATH=$ANDROID_SDK_HOME/platform-tools:$PATH' >> $BASH_ENV
echo 'export PATH=$ANDROID_SDK_HOME/emulator:$PATH' >> $BASH_ENV
source $BASH_ENV
environment:
JAVA_HOME: /Library/Java/JavaVirtualMachines/temurin-8.jdk/Contents/Home

- macos/preboot-simulator:
version: "17.4"
Expand Down Expand Up @@ -199,10 +223,17 @@ jobs:
sudo ln -s /opt/bazelisk-v1.11.0/bazelisk /usr/local/bin/bazel

- run:
name: Create avd
name: Install Android tools
command: |
sdkmanager "system-images;android-29;default;x86"
echo "no" | avdmanager --verbose create avd -n test -k "system-images;android-29;default;x86"
rm -rf $ANDROID_HOME/build-tools/*
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64 \
$ANDROID_HOME/tools/bin/sdkmanager "build-tools;33.0.1"\
"ndk;21.4.7075529" \
"system-images;android-33;default;x86_64"
echo "export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/21.4.7075529" >> $BASH_ENV
sugarmanz marked this conversation as resolved.
Show resolved Hide resolved
source $BASH_ENV
echo "no" | avdmanager --verbose create avd -n test -k "system-images;android-33;default;x86_64" -g default
source $BASH_ENV

- run:
name: Launch emulator
Expand Down Expand Up @@ -248,7 +279,7 @@ jobs:
# union the bundle targets until //... doesnt explode analyzing jvm/android targets
- run: |
BUNDLE_TARGETS=$(bazel query "kind(js_test, //plugins/...) union kind(js_test, //react/...) union kind(js_test, //core/...)" --output label 2>/dev/null | tr '\n' ' ')
sugarmanz marked this conversation as resolved.
Show resolved Hide resolved
bazel coverage --combined_report=lcov --config=ci -- $BUNDLE_TARGETS -//plugins/reference-assets/mocks:all_flows_test_binary
bazel coverage --combined_report=lcov --config=ci -- $BUNDLE_TARGETS

- run:
when: always
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,4 @@ ios/*/*/Resources/**/*.js
.ios-build-number

.bazelrc.local
_ios_coverage/
41 changes: 39 additions & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ load("@rules_player//ios:defs.bzl", "assemble_pod")
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")
load("@bazel_gazelle//:def.bzl", "gazelle_binary", "gazelle")
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"])

Expand Down Expand Up @@ -242,5 +243,41 @@ swift_update_packages(
update_bzlmod_stanzas = False,
)

# This target updates the Bazel build files for your project. Run this target
# whenever you add or remove source files from your project.
gazelle(
name = "update_build_files",
gazelle = ":gazelle_bin",
)

alias(
name = "android_tools",
actual = "@bazel_tools//src/tools/android/java/com/google/devtools/build/android:all_android_tools",
visibility = ["//visibility:public"],
)

java_plugin(
name = "compiler_annotation_processor",
generates_api = False,
processor_class = "android.databinding.annotationprocessor.ProcessDataBinding",
visibility = ["//visibility:public"],
deps = [
":android_tools",
],
)

java_import(
name = "android_sdk",
jars = ["@bazel_tools//tools/android:android_jar"],
neverlink = 1,
visibility = ["//visibility:public"],
)

java_runtime(
name = "jdk8",
java_home = "/Library/Java/JavaVirtualMachines/temurin-8.jdk/Contents/Home",
visibility = ["//visibility:public"]
)
sugarmanz marked this conversation as resolved.
Show resolved Hide resolved

#SwiftLint
exports_files([".swiftlint.yml"])
exports_files([".swiftlint.yml"])
Loading