Skip to content

Commit

Permalink
Merge pull request #402 from player-ui/m1-ios
Browse files Browse the repository at this point in the history
ios buildabling on arm mac with rosetta + Aish's Android fixes
  • Loading branch information
nancywu1 authored Jul 2, 2024
2 parents 7ee78e5 + 2712a73 commit 521e36c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 12 deletions.
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

0 comments on commit 521e36c

Please sign in to comment.