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

ios buildabling on arm mac with rosetta + Aish's Android fixes #402

Merged
merged 9 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
38 changes: 29 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ orbs:
executors:
base:
docker:
- image: docker.io/playerui/bazel-docker:7
- image: docker.io/playerui/bazel-docker:8
working_directory: ~/player
resource_class: xlarge
environment:
TZ: "/usr/share/zoneinfo/America/Los_Angeles"
ios:
working_directory: ~/player
resource_class: macos.x86.medium.gen2
resource_class: macos.m1.medium.gen1
macos:
xcode: 14.3
environment:
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 All @@ -42,7 +42,6 @@ commands:
steps:
- attach_workspace:
at: ~/player

- restore_cache:
keys:
- v1-bazel-cache-core-{{ .Branch }}-{{ .Revision }}
Expand Down Expand Up @@ -114,10 +113,16 @@ jobs:
- attach_workspace:
at: ~/player

- macos/install-rosetta

- run:
name: Homebrew Dependencies
shell: env /usr/bin/arch -x86_64 /bin/bash --login -eo pipefail
command: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- run:
command: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install bazelisk maven openjdk@8
HOMEBREW_NO_AUTO_UPDATE=1 arch -x86_64 /usr/local/bin/brew install bazelisk maven openjdk@8

- run:
name: Set Ruby Version
Expand Down Expand Up @@ -157,7 +162,10 @@ jobs:
- gem-v1-{{ arch }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
- gem-v1-{{ arch }}-main-{{ checksum "Gemfile.lock" }}

- run: bundle install
- run:
command: |
bundle config build.nokogiri --use-system-libraries
bundle install

- save_cache:
key: gem-v1-{{ arch }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
Expand Down Expand Up @@ -233,10 +241,22 @@ jobs:
sudo ln -s /opt/bazelisk-v1.11.0/bazelisk /usr/local/bin/bazel

- run:
name: Create avd
name: Install Android tools
command: |
rm -rf $ANDROID_HOME/build-tools/*
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64 \
$ANDROID_HOME/tools/bin/sdkmanager "build-tools;30.0.3"\
"ndk;21.4.7075529" \
"system-images;android-31;default;x86_64"
echo "export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/21.4.7075529" >> $BASH_ENV
source $BASH_ENV
echo "no" | avdmanager --verbose create avd -n test -k "system-images;android-31;default;x86_64" -g default
source $BASH_ENV

- run:
name: Set python to 2.7
command: |
sdkmanager "system-images;android-29;default;x86"
echo "no" | avdmanager --verbose create avd -n test -k "system-images;android-29;default;x86"
pyenv global 2.7

- run:
name: Launch emulator
Expand Down
7 changes: 5 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ http_archive(

load("@rules_player//:workspace.bzl", "deps")

deps()
deps(android_api_version = 31)

load("@rules_player//:conf.bzl", "apple", "javascript", "kotlin")

Expand Down Expand Up @@ -146,7 +146,10 @@ overridden_targets = {
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm": "@//android/demo:kotlinx_coroutines_core_jvm_fixed",
}

android_ndk_repository(name = "androidndk")
android_ndk_repository(
name = "androidndk",
api_level=21
)

register_toolchains("@androidndk//:all")

Expand Down
2 changes: 1 addition & 1 deletion scripts/install-android-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ accept_license_of() {
}

ANDROID_SDK_VERSION=4333796
ANDROID_VERSION=29
ANDROID_VERSION=31
ANDROID_BUILD_TOOLS_VERSION=30.0.0
ANDROID_NDK_VERSION=21.4.7075529

Expand Down