Skip to content

Commit

Permalink
Merge pull request #1168 from shankari/upgrade_android_14
Browse files Browse the repository at this point in the history
⬆️ Upgrade to the latest everything
  • Loading branch information
shankari authored Aug 27, 2024
2 parents adb7cf2 + b93faf9 commit ae46281
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 90 deletions.
2 changes: 1 addition & 1 deletion config.cordovabuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</feature>
<platform name="ios">
<preference name="deployment-target" value="13.0"/>
<hook src="hooks/before_build/ios/ios_change_deployment.js" type="before_build" />
<hook src="hooks/before_compile/ios/ios_change_deployment.js" type="before_compile" />
<hook src="hooks/after_platform_add/ios/ios_copy_locales.js" type="after_platform_add" />
<resource-file src="GoogleService-Info.plist" />
<preference name="WKWebViewOnly" value="true" />
Expand Down
37 changes: 0 additions & 37 deletions hooks/before_build/ios/ios_change_deployment.js

This file was deleted.

60 changes: 60 additions & 0 deletions hooks/before_compile/ios/ios_change_deployment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
const fs = require('fs');
const path = require('path');
const { exec } = require('child_process');

function findFilePathsByFilename(directory, filename) {
const files = fs.readdirSync(directory);
const filePaths = [];

for (const file of files) {
const filePath = path.join(directory, file);
const stats = fs.statSync(filePath);

if (stats.isDirectory()) {
// Recursively search in subdirectories
const subdirectoryFilePaths = findFilePathsByFilename(filePath, filename);
filePaths.push(...subdirectoryFilePaths);
} else if (stats.isFile() && file === filename) {
// If the file matches the filename, add its path to the result
filePaths.push(filePath);
}
}
return filePaths;
}

function logTarget(directory, logmsg) {
const grepstmt = `grep -r IPHONEOS_DEPLOYMENT_TARGET ${directory} | sort | uniq`
exec(grepstmt, (err, stdout, stderr) => {
if (err) {
console.log(`${logmsg}, ${grepstmt}:\n`, stderr)
return;
}

// the *entire* stdout and stderr (buffered)
console.log(`${logmsg}, ${grepstmt}:\n`, stdout);
});
}

module.exports = function(context) {
if (context.opts.verbose) console.log(context);

if (context.opts.verbose) logTarget("platforms/ios", "before patching");

const paths1 = findFilePathsByFilename('.', 'project.pbxproj');
const paths2 = findFilePathsByFilename('.', 'Pods.xcodeproj');
const paths = paths1.concat(paths2)

console.log('Apply patch to', paths);

for (let path of paths) {
let content = fs.readFileSync(path, { encoding: 'utf-8' });
content = content.replace(/IPHONEOS_DEPLOYMENT_TARGET = [0-9]+.0;/g, 'IPHONEOS_DEPLOYMENT_TARGET = 13.0;');
fs.writeFileSync(path, content);
}

console.log('Done setting IPHONEOS_DEPLOYMENT_TARGET');

if (context.opts.verbose) logTarget("platforms/ios", "after patching");
}


12 changes: 6 additions & 6 deletions package.cordovabuild.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"babel-loader": "^9.1.2",
"babel-plugin-optional-require": "^0.3.1",
"concurrently": "^8.0.1",
"cordova": "^11.1.0",
"cordova": "12.0.0",
"css-loader": "^6.7.4",
"exports-loader": "^4.0.0",
"expose-loader": "^4.1.0",
Expand Down Expand Up @@ -98,7 +98,7 @@
},
"cordova-plugin-bluetooth-classic-serial-port": {},
"cordova-custom-config": {},
"cordova-plugin-ibeacon": {}
"com.unarin.cordova.beacon": {}
}
},
"dependencies": {
Expand All @@ -113,8 +113,8 @@
"chart.js": "^4.3.0",
"chartjs-adapter-luxon": "^1.3.1",
"chartjs-plugin-annotation": "^3.0.1",
"cordova-android": "12.0.0",
"cordova-ios": "6.2.0",
"cordova-android": "13.0.0",
"cordova-ios": "7.1.1",
"cordova-plugin-advanced-http": "3.3.1",
"cordova-plugin-androidx-adapter": "1.1.3",
"cordova-plugin-app-version": "0.1.14",
Expand All @@ -128,14 +128,14 @@
"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.9",
"cordova-plugin-file": "8.0.0",
"cordova-plugin-inappbrowser": "5.0.0",
"cordova-plugin-inappbrowser": "6.0.0",
"cordova-plugin-ionic-keyboard": "2.2.0",
"cordova-plugin-ionic-webview": "5.0.0",
"cordova-plugin-local-notification-12": "github:e-mission/cordova-plugin-local-notification-12#v0.1.4-fix-android-action",
"cordova-plugin-x-socialsharing": "6.0.4",
"cordova-plugin-bluetooth-classic-serial-port": "git+https://github.com/louisg1337/cordova-plugin-bluetooth-classic-serial-port.git",
"cordova-custom-config": "^5.1.1",
"cordova-plugin-ibeacon": "git+https://github.com/louisg1337/cordova-plugin-ibeacon.git",
"com.unarin.cordova.beacon": "github:louisg1337/cordova-plugin-ibeacon",
"core-js": "^2.5.7",
"e-mission-common": "github:JGreenlee/e-mission-common#semver:0.5.4",
"enketo-core": "^6.1.7",
Expand Down
3 changes: 0 additions & 3 deletions setup/activate_native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ then
echo "ANDROID_HOME and ANDROID_SDK_ROOT not set, android SDK not found"
fi

echo "Activating sdkman, and by default, gradle"
source ~/.sdkman/bin/sdkman-init.sh

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

Expand Down
3 changes: 0 additions & 3 deletions setup/activate_shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,3 @@ echo "Activating nvm"

echo "Using version $NODE_VERSION"
nvm use $NODE_VERSION

CURR_NPM_VERSION=`npm --version`
echo "npm version = $CURR_NPM_VERSION"
12 changes: 0 additions & 12 deletions setup/android_sdk_packages
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
build-tools;31.0.0
build-tools;32.0.0
build-tools;33.0.2
build-tools;34.0.0
emulator
extras;google;google_play_services
platform-tools
platforms;android-30
platforms;android-31
platforms;android-32
platforms;android-33
platforms;android-34
system-images;android-22;google_apis;x86_64
system-images;android-23;google_apis;x86_64
system-images;android-24;google_apis_playstore;x86
system-images;android-25;google_apis_playstore;x86
system-images;android-26;google_apis_playstore;x86
Expand All @@ -20,9 +11,6 @@ system-images;android-28;google_apis_playstore;x86_64
system-images;android-29;google_apis_playstore;x86_64
system-images;android-30;google_apis_playstore;x86_64
system-images;android-31;google_apis_playstore;x86_64
system-images;android-32;google_apis;x86_64
system-images;android-32;google_apis_playstore;x86_64
system-images;android-33;google_apis;x86_64
system-images;android-33;google_apis_playstore;x86_64
system-images;android-34;google_apis;x86_64
system-images;android-34;google_apis_playstore;x86_64
8 changes: 3 additions & 5 deletions setup/export_shared_dep_versions.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
export NVM_VERSION=0.39.3
export NODE_VERSION=19.5.0
export NPM_VERSION=9.3.1
export NVM_VERSION=0.40.0
export NODE_VERSION=20.9.0
# 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.12.1
export GRADLE_VERSION=7.6
export COCOAPODS_VERSION=1.15.2
export OSX_EXP_VERSION=12

export NVM_DIR="$HOME/.nvm"
Expand Down
15 changes: 0 additions & 15 deletions setup/setup_android_native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,4 @@ else
echo "ANDROID_HOME = $ANDROID_HOME; ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT"
fi

echo "Setting up sdkman"
curl -s "https://get.sdkman.io" | bash
source ~/.sdkman/bin/sdkman-init.sh

CURR_GRADLE_VER=`sdk current gradle | cut -d " " -f 4 | xargs`

echo "CURR_GRADLE_VER = '$CURR_GRADLE_VER', expected $GRADLE_VERSION"

if [[ $CURR_GRADLE_VER == $GRADLE_VERSION ]]; then
echo "Already have gradle version $GRADLE_VERSION"
else
echo "Setting up gradle using SDKMan"
sdk install gradle $GRADLE_VERSION
fi

source setup/setup_shared_native.sh
8 changes: 0 additions & 8 deletions setup/setup_shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,3 @@ echo "Setting up the variables to run nvm"

echo "Installing the correct node version"
nvm install $NODE_VERSION

echo "Check the version of npm"
CURR_NPM_VERSION=`npm --version`
if [ $CURR_NPM_VERSION != $NPM_VERSION ];
then
echo "Invalid npm version, expected $NPM_VERSION, got $CURR_NPM_VERSION"
npm install npm@$NPM_VERSION
fi

0 comments on commit ae46281

Please sign in to comment.