Skip to content

Commit 01f3c22

Browse files
author
ICIA
committed
2 parents 5154f9c + dc3b274 commit 01f3c22

File tree

7 files changed

+59
-6
lines changed

7 files changed

+59
-6
lines changed

.github/workflows/android-automated-sdk-install.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ on:
66
push:
77
paths:
88
- 'setup/prereq_android_sdk_install.sh'
9+
- '.github/workflows/android-automated-sdk-install.yml'
910
pull_request:
1011
paths:
1112
- 'setup/prereq_android_sdk_install.sh'
13+
- '.github/workflows/android-automated-sdk-install.yml'
1214
schedule:
1315
# * is a special character in YAML so you have to quote this string
1416
- cron: '5 4 * * 0'
@@ -71,7 +73,17 @@ jobs:
7173
export JAVA_HOME=$JAVA_HOME_11_X64
7274
export ANDROID_SDK_ROOT=$NEW_ANDROID_SDK_ROOT
7375
echo "New SDK root $ANDROID_SDK_ROOT"
76+
echo "About to run the emulator at $ANDROID_SDK_ROOT/emulator/emulator"
7477
$ANDROID_SDK_ROOT/emulator/emulator -list-avds
78+
echo "About to run the avdmanager at $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/avdmanager"
79+
$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/avdmanager list avds
80+
81+
- name: Setup the cordova environment
82+
shell: bash -l {0}
83+
run: |
84+
export JAVA_HOME=$JAVA_HOME_11_X64
85+
export ANDROID_SDK_ROOT=$NEW_ANDROID_SDK_ROOT
86+
bash setup/setup_android_native.sh
7587
7688
- name: Ensure that the path is correct and the project can be activated
7789
shell: bash -l {0}
@@ -80,3 +92,5 @@ jobs:
8092
export ANDROID_SDK_ROOT=$NEW_ANDROID_SDK_ROOT
8193
echo "New SDK root $ANDROID_SDK_ROOT"
8294
source setup/activate_native.sh
95+
echo "About to run the avdmanager from the path" `which avdmanager`
96+
avdmanager list avd

.github/workflows/ios-build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ jobs:
3232
- name: Print the xcode setup
3333
run: xcodebuild -version -sdk
3434

35+
- name: Print the brew and ruby versions
36+
run: |
37+
echo "brew version is "`brew --version`
38+
echo "ruby version is" `ruby --version`
39+
3540
- name: Print applications through dmg
3641
run: ls /Applications
3742

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ Pre-requisites
120120
```
121121
122122
</details>
123+
- if you are not on the most recent version of OSX, `homebrew`
124+
- this allows us to install the current version of cocoapods without
125+
running into ruby incompatibilities - e.g.
126+
https://github.com/CocoaPods/CocoaPods/issues/11763
123127
124128
Important
125129
---

setup/activate_native.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ echo "Activating sdkman, and by default, gradle"
1414
source ~/.sdkman/bin/sdkman-init.sh
1515

1616
echo "Ensuring that we use the most recent version of the command line tools"
17-
export PATH=$ANDROID_SDK_ROOT/sdk/cmdline-tools/bin:$ANDROID_SDK_ROOT/emulator:$PATH
17+
export PATH=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin:$ANDROID_SDK_ROOT/emulator:$PATH
1818

1919
echo "Configuring the repo for building native code"
2020
./bin/configure_xml_and_json.js cordovabuild

setup/export_shared_dep_versions.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
export NVM_VERSION=0.39.0
22
export NODE_VERSION=14.18.1
33
export NPM_VERSION=6.14.15
4-
export RUBY_VERSION=2.6.0
4+
# make sure that this is a stable version from
5+
# so that https://github.com/postmodern/ruby-versions
6+
# ideally, this would be the same version as the CI
7+
# Looks like brew supports only major and minor, not patch version
8+
export RUBY_VERSION=2.7
59
export COCOAPODS_VERSION=1.11.2
610
export GRADLE_VERSION=7.1.1
11+
export OSX_EXP_VERSION=12
712

813
export NVM_DIR="$HOME/.nvm"
9-
export RUBY_PATH=$HOME/.gem/ruby/$RUBY_VERSION/bin
14+
export RUBY_PATH=$HOME/.gem/ruby/$RUBY_VERSION.0/bin

setup/setup_android_native.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ JAVA_VERSION=`javac -version`
1313
echo "Found java in the path with version $JAVA_VERSION"
1414

1515
echo "Setting up SDK environment"
16-
ANDROID_BUILD_TOOLS_VERSION=27.0.3
1716
MIN_SDK_VERSION=21
1817
TARGET_SDK_VERSION=28
1918

setup/setup_ios_native.sh

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,34 @@ set -e
44
# Setup the development environment
55
source setup/setup_shared.sh
66

7-
echo "Installing cocoapods"
7+
OSX_MAJOR_VERSION=`sw_vers | grep ProductVersion | cut -d ':' -f 2 | cut -d '.' -f 1`
8+
echo "Found OSX major version" $OSX_MAJOR_VERSION
9+
10+
CURR_RUBY_VERSION=`ruby --version | cut -d ' ' -f 2 | cut -d '.' -f 1-2`
11+
echo "Found ruby version "$CURR_RUBY_VERSION
12+
13+
if [ $CURR_RUBY_VERSION == $RUBY_VERSION ]; then
14+
echo "Found ruby version "$CURR_RUBY_VERSION" expected "$RUBY_VERSION" no need to upgrade"
15+
else
16+
if [ -x /usr/local/bin/brew ]; then
17+
echo "Found brew installation with version" `/usr/local/bin/brew --version`
18+
echo "Installing ruby version to brew" $RUBY_VERSION
19+
brew install ruby@$RUBY_VERSION
20+
else
21+
if [ $OSX_MAJOR_VERSION -ge $OSX_EXP_VERSION ]; then
22+
echo "No brew installation found, but OSX major version "$OSX_MAJOR_VERSION" and expected version "$OSX_EXP_VERSION" so CocoaPods should work"
23+
else
24+
echo "No brew installation found, but OSX major version "$OSX_MAJOR_VERSION" != expected version "$OSX_EXP_VERSION" CocoaPods install will likely fail"
25+
echo "Found ruby version "`ruby --version`
26+
exit 1
27+
fi
28+
fi
29+
fi
30+
31+
echo "Adding $RUBY_PATH to the path before the install"
832
export PATH=$RUBY_PATH:$PATH
9-
gem install --no-document --user-install cocoapods -v $COCOAPODS_VERSION
33+
34+
echo "Installing cocoapods"
35+
/usr/local/opt/ruby@$RUBY_VERSION/bin/gem install --no-document --user-install cocoapods -v $COCOAPODS_VERSION
1036

1137
source setup/setup_shared_native.sh

0 commit comments

Comments
 (0)