Skip to content

Commit

Permalink
Upgrade the devapp to the most recent version of everything
Browse files Browse the repository at this point in the history
To be consistent with 2023 phone upgrades
Related issue: e-mission/e-mission-docs#838
Related PR: e-mission/e-mission-phone#952

Since the rest of the app is not the same, I applied the changes by diffing the
config.xml and package.json and the setup directory with the corresponding
locations in the e-mission-phone repo

Additional minor changes:
+ comment out the `configure_xml_and_json` step, since we don't have the
cordovabuild versions in this release
+ change the package name to `edu.berkeley.eecs.emission.devapp`
+ bump up the versions

Testing done:
- devapp builds successfully
- after making phone app changes, devapp displays phone app successfully
  • Loading branch information
shankari committed Apr 23, 2023
1 parent 77e2342 commit a324e18
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 63 deletions.
17 changes: 11 additions & 6 deletions config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="47" id="edu.berkeley.eecs.emission" ios-CFBundleVersion="45" version="3.2.4" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget android-versionCode="48" id="edu.berkeley.eecs.emission.devapp" ios-CFBundleVersion="46" version="3.2.5" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>em-devapp</name>
<description>
The emission Developer app is a clone of the PhoneGap Developer app with the emission plugins. It is a testing utility for web developers and designers using the emission platform. After installing this app on your device or simulator you will be able to use phonegap serve to autorefresh without re-deploying the app everytime.
Expand Down Expand Up @@ -48,8 +48,8 @@
<preference name="WKWebViewOnly" value="true" />
<preference name="WKSuspendInBackground" value="false" />
<preference name="AutoHideSplashScreen" value="true" />
<config-file file="*-Info.plist" mode="merge" target="NSCameraUsageDescription">
<string>To scan the barcode for the study</string>
<config-file parent="NSCameraUsageDescription" target="*-Info.plist" mode="merge">
<string>To scan QR codes for the login token and the study</string>
</config-file>
<icon height="167" src="resources/icon/ios/icon-83.5@2x.png" width="167" />
<icon height="76" src="resources/icon/ios/icon-76.png" width="76" />
Expand Down Expand Up @@ -82,11 +82,16 @@
<splash height="1242" src="resources/splash/ios/Default-Landscape-736h.png" width="2208" />
</platform>
<platform name="android">
<preference name="android-minSdkVersion" value="22" />
<preference name="android-targetSdkVersion" value="30" />

<preference name="android-minSdkVersion" value="23" />
<preference name="android-targetSdkVersion" value="32" />
<preference name="AndroidLaunchMode" value="singleInstance"/>
<preference name="AndroidXEnabled" value="true" />
<preference name="GradlePluginKotlinEnabled" value="true" />
<preference name="GradlePluginKotlinVersion" value="1.7.10" />
<resource-file src="google-services.json" target="app/google-services.json" />
<!-- <hook src="hooks/before_build/android/android_set_provider.js" type="before_build" /> -->
<hook src="hooks/before_build/android/android_set_provider.js" type="before_build" />
<hook src="hooks/before_build/android/android_change_compile_implementation.js" type="before_build" />
<config-file parent="/manifest/application" target="AndroidManifest.xml">
<uses-library android:name="org.apache.http.legacy" android:required="false" />
</config-file>
Expand Down
79 changes: 36 additions & 43 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "phonegap-app-developer",
"version": "3.2.4",
"description": "PhoneGap Developer app.",
"version": "3.2.5",
"description": "e-mission Developer app.",
"homepage": "http://app.phonegap.com",
"repository": {
"type": "git",
Expand All @@ -25,9 +25,9 @@
},
"devDependencies": {
"app-root-path": "1.0.0",
"cordova": "10.0.0",
"cordova-common": "4.0.2",
"@ionic/cli": "6.10.1",
"cordova": "11.1.0",
"cordova-common": "5.0.0",
"@ionic/cli": "6.20.8",
"fs-extra": "0.24.0",
"jasmine-node": "1.14.5",
"less": "2.7.1",
Expand All @@ -45,9 +45,9 @@
"cordova-plugin-insomnia": {},
"phonegap-plugin-contentsync": {},
"@havesource/cordova-plugin-push": {
"ANDROID_SUPPORT_V13_VERSION": "28.0.0",
"FCM_VERSION": "18.+",
"IOS_FIREBASE_MESSAGING_VERSION": "~> 6.32.2"
"ANDROIDX_CORE_VERSION": "1.6.+",
"FCM_VERSION": "23.+",
"IOS_FIREBASE_MESSAGING_VERSION": "~> 8.1.1"
},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-app-version": {},
Expand All @@ -59,71 +59,64 @@
"ANDROID_HOST": " ",
"ANDROID_PATHPREFIX": "/"
},
"cordova-plugin-email-composer": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-email-composer": {},
"cordova-plugin-x-socialsharing": {
"PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to share photos on social media.",
"PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to share photos on social media."
},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-local-notification": {},
"cordova-plugin-ionic": {
"APP_ID": "e0d8cdec",
"CHANNEL_NAME": "Production",
"UPDATE_METHOD": "none",
"UPDATE_API": "https://api.ionicjs.com",
"MAX_STORE": "2"
"cordova-plugin-local-notification-12": {
"ANDROID_SUPPORT_V4_VERSION": "26.+",
"ANDROIDX_VERSION": "1.2.0",
"ANDROIDX_APPCOMPAT_VERSION": "1.3.1"
},
"cordova-plugin-advanced-http": {},
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
"cordova-plugin-em-jwt-auth": {
"AUTH_VERSION": "19.2.0"
},
"cordova-plugin-em-opcodeauth": {},
"cordova-plugin-em-server-communication": {},
"cordova-plugin-em-datacollection": {
"LOCATION_VERSION": "18.0.0",
"ANDROIDX_CORE_VERSION": "1.7.0"
"LOCATION_VERSION": "21.0.1",
"ANDROIDX_CORE_VERSION": "1.8.0",
"ANDROIDX_WORK_VERSION": "2.7.1"
},
"cordova-plugin-em-serversync": {},
"cordova-plugin-em-settings": {},
"cordova-plugin-em-transition-notify": {},
"cordova-plugin-em-unifiedlogger": {},
"cordova-plugin-em-usercache": {},
"cordova-plugin-androidx-adapter": {},
"phonegap-plugin-barcodescanner": {}
"phonegap-plugin-barcodescanner": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
}
}
},
"dependencies": {
"cordova-android": "10.1.0",
"cordova-android": "11.0.0",
"cordova-ios": "6.2.0",
"cordova-plugin-advanced-http": "3.2.2",
"cordova-plugin-androidx-adapter": "git+https://github.com/dpa99c/cordova-plugin-androidx-adapter.git",
"cordova-plugin-app-version": "0.1.12",
"cordova-plugin-advanced-http": "3.3.1",
"cordova-plugin-androidx-adapter": "1.1.3",
"cordova-plugin-app-version": "0.1.14",
"cordova-plugin-customurlscheme": "5.0.2",
"cordova-plugin-device": "2.0.3",
"cordova-plugin-em-datacollection": "git+https://github.com/e-mission/e-mission-data-collection.git#v1.7.2",
"cordova-plugin-em-jwt-auth": "git+https://github.com/e-mission/cordova-jwt-auth.git#v1.6.5",
"cordova-plugin-em-server-communication": "git+https://github.com/e-mission/cordova-server-communication.git#v1.2.4",
"cordova-plugin-em-serversync": "git+https://github.com/e-mission/cordova-server-sync.git#v1.2.9",
"cordova-plugin-device": "2.1.0",
"cordova-plugin-em-datacollection": "git+https://github.com/e-mission/e-mission-data-collection.git#v1.7.7",
"cordova-plugin-em-opcodeauth": "git+https://github.com/e-mission/cordova-jwt-auth.git#v1.7.1",
"cordova-plugin-em-server-communication": "git+https://github.com/e-mission/cordova-server-communication.git#v1.2.5",
"cordova-plugin-em-serversync": "git+https://github.com/e-mission/cordova-server-sync.git#v1.3.1",
"cordova-plugin-em-settings": "git+https://github.com/e-mission/cordova-connection-settings.git#v1.2.3",
"cordova-plugin-em-transition-notify": "git+https://github.com/e-mission/e-mission-transition-notify.git#v1.2.7",
"cordova-plugin-em-unifiedlogger": "git+https://github.com/e-mission/cordova-unified-logger.git#v1.3.5",
"cordova-plugin-em-unifiedlogger": "git+https://github.com/e-mission/cordova-unified-logger.git#v1.3.6",
"cordova-plugin-em-usercache": "git+https://github.com/e-mission/cordova-usercache.git#v1.1.5",
"cordova-plugin-email-composer": "0.9.2",
"cordova-plugin-file": "6.0.2",
"cordova-plugin-email-composer": "git+https://github.com/katzer/cordova-plugin-email-composer.git#0.10.1",
"cordova-plugin-file": "7.0.0",
"cordova-plugin-inappbrowser": "5.0.0",
"cordova-plugin-ionic": "5.5.1",
"cordova-plugin-ionic-keyboard": "2.2.0",
"cordova-plugin-ionic-webview": "5.0.0",
"cordova-plugin-local-notification": "https://github.com/timkellypa/cordova-plugin-local-notifications.git#083ccca0f4eee8fbec0cde1edd32207c286d2a04",
"cordova-plugin-whitelist": "~1.3.3",
"cordova-plugin-x-socialsharing": "6.0.3",
"cordova-res": "^0.15.1",
"cordova-plugin-local-notification-12": "0.1.4",
"cordova-plugin-x-socialsharing": "6.0.4",
"fs-extra": "^9.0.1",
"klaw-sync": "^6.0.0",
"phonegap-plugin-barcodescanner": "git+https://github.com/phonegap/phonegap-plugin-barcodescanner#v8.1.0",
"@havesource/cordova-plugin-push": "git+https://github.com/havesource/cordova-plugin-push.git#4.0.0-dev.0",
"phonegap-plugin-contentsync": "git+https://github.com/e-mission/phonegap-plugin-contentsync.git"
}
}
2 changes: 1 addition & 1 deletion setup/GoogleService-Info.fake.for_ci.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>edu.berkeley.eecs.devapp</string>
<string>edu.berkeley.eecs.emission.devapp</string>
<key>PROJECT_ID</key>
<string>emission-push-both</string>
<key>IS_ADS_ENABLED</key>
Expand Down
2 changes: 1 addition & 1 deletion setup/activate_native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ echo "Ensuring that we use the most recent version of the command line tools"
export PATH=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin:$ANDROID_SDK_ROOT/emulator:$PATH

echo "Configuring the repo for building native code"
./bin/configure_xml_and_json.js cordovabuild
# ./bin/configure_xml_and_json.js cordovabuild
19 changes: 12 additions & 7 deletions setup/export_shared_dep_versions.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
export NVM_VERSION=0.39.0
export NODE_VERSION=14.18.1
export NPM_VERSION=6.14.15
export RUBY_VERSION=2.6.0
export COCOAPODS_VERSION=1.11.2
export GRADLE_VERSION=7.1.1
export NVM_VERSION=0.39.3
export NODE_VERSION=19.5.0
export NPM_VERSION=9.3.1
# make sure that this is a stable version from
# so that https://github.com/postmodern/ruby-versions
# ideally, this would be the same version as the CI
# Looks like brew supports only major and minor, not patch version
export RUBY_VERSION=3.0
export COCOAPODS_VERSION=1.11.3
export GRADLE_VERSION=7.6
export OSX_EXP_VERSION=12

export NVM_DIR="$HOME/.nvm"
export RUBY_PATH=$HOME/.gem/ruby/$RUBY_VERSION/bin
export RUBY_PATH=$HOME/.gem/ruby/$RUBY_VERSION.0/bin
30 changes: 28 additions & 2 deletions setup/setup_ios_native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,34 @@ set -e
# Setup the development environment
source setup/setup_shared.sh

echo "Installing cocoapods"
OSX_MAJOR_VERSION=`sw_vers | grep ProductVersion | cut -d ':' -f 2 | cut -d '.' -f 1`
echo "Found OSX major version" $OSX_MAJOR_VERSION

CURR_RUBY_VERSION=`ruby --version | cut -d ' ' -f 2 | cut -d '.' -f 1-2`
echo "Found ruby version "$CURR_RUBY_VERSION

if [ $CURR_RUBY_VERSION == $RUBY_VERSION ]; then
echo "Found ruby version "$CURR_RUBY_VERSION" expected "$RUBY_VERSION" no need to upgrade"
else
if [ -x /usr/local/bin/brew ]; then
echo "Found brew installation with version" `/usr/local/bin/brew --version`
echo "Installing ruby version to brew" $RUBY_VERSION
brew install ruby@$RUBY_VERSION
else
if [ $OSX_MAJOR_VERSION -ge $OSX_EXP_VERSION ]; then
echo "No brew installation found, but OSX major version "$OSX_MAJOR_VERSION" and expected version "$OSX_EXP_VERSION" so CocoaPods should work"
else
echo "No brew installation found, but OSX major version "$OSX_MAJOR_VERSION" != expected version "$OSX_EXP_VERSION" CocoaPods install will likely fail"
echo "Found ruby version "`ruby --version`
exit 1
fi
fi
fi

echo "Adding $RUBY_PATH to the path before the install"
export PATH=$RUBY_PATH:$PATH
gem install --no-document --user-install cocoapods -v $COCOAPODS_VERSION

echo "Installing cocoapods"
/usr/local/opt/ruby@$RUBY_VERSION/bin/gem install --no-document --user-install cocoapods -v $COCOAPODS_VERSION

source setup/setup_shared_native.sh
6 changes: 3 additions & 3 deletions setup/setup_shared_native.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
echo "Ensure that we fail on error"

set -e
./bin/configure_xml_and_json.js cordovabuild
# ./bin/configure_xml_and_json.js cordovabuild

echo "Copying fake FCM configurations for android and iOS"
cp setup/GoogleService-Info.fake.for_ci.plist GoogleService-Info.plist
Expand All @@ -26,8 +26,8 @@ sed -i -e "s|/usr/bin/env node|/usr/bin/env node --unhandled-rejections=strict|"

npx cordova prepare

# Original 25 + insomnia + contentsync
EXPECTED_COUNT=27
# Original 23 + insomnia + contentsync
EXPECTED_COUNT=25
INSTALLED_COUNT=`npx cordova plugin list | wc -l`
echo "Found $INSTALLED_COUNT plugins, expected $EXPECTED_COUNT"
if [ $INSTALLED_COUNT -lt $EXPECTED_COUNT ];
Expand Down

0 comments on commit a324e18

Please sign in to comment.