diff --git a/config.cordovabuild.xml b/config.cordovabuild.xml index 3401b9b9b..858f7fd4d 100644 --- a/config.cordovabuild.xml +++ b/config.cordovabuild.xml @@ -37,7 +37,7 @@ - + diff --git a/hooks/before_build/ios/ios_change_deployment.js b/hooks/before_build/ios/ios_change_deployment.js deleted file mode 100644 index ad381162d..000000000 --- a/hooks/before_build/ios/ios_change_deployment.js +++ /dev/null @@ -1,37 +0,0 @@ -const fs = require('fs'); -const path = require('path'); - -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; -} - - -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'); diff --git a/hooks/before_compile/ios/ios_change_deployment.js b/hooks/before_compile/ios/ios_change_deployment.js new file mode 100644 index 000000000..cb848cef4 --- /dev/null +++ b/hooks/before_compile/ios/ios_change_deployment.js @@ -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"); +} + + diff --git a/package.cordovabuild.json b/package.cordovabuild.json index a2c36e855..3ee023ae8 100644 --- a/package.cordovabuild.json +++ b/package.cordovabuild.json @@ -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", @@ -98,7 +98,7 @@ }, "cordova-plugin-bluetooth-classic-serial-port": {}, "cordova-custom-config": {}, - "cordova-plugin-ibeacon": {} + "com.unarin.cordova.beacon": {} } }, "dependencies": { @@ -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", @@ -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", diff --git a/setup/activate_native.sh b/setup/activate_native.sh index c1014c987..21e8f7566 100644 --- a/setup/activate_native.sh +++ b/setup/activate_native.sh @@ -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 diff --git a/setup/activate_shared.sh b/setup/activate_shared.sh index 40f0c3fe7..1e46c9579 100644 --- a/setup/activate_shared.sh +++ b/setup/activate_shared.sh @@ -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" diff --git a/setup/android_sdk_packages b/setup/android_sdk_packages index a870852f1..27959824c 100644 --- a/setup/android_sdk_packages +++ b/setup/android_sdk_packages @@ -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 @@ -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 diff --git a/setup/export_shared_dep_versions.sh b/setup/export_shared_dep_versions.sh index ae3a5d58e..49d062a8b 100644 --- a/setup/export_shared_dep_versions.sh +++ b/setup/export_shared_dep_versions.sh @@ -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" diff --git a/setup/setup_android_native.sh b/setup/setup_android_native.sh index 95dc9222e..3dfd5279e 100644 --- a/setup/setup_android_native.sh +++ b/setup/setup_android_native.sh @@ -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 diff --git a/setup/setup_shared.sh b/setup/setup_shared.sh index c47e892dd..53be485e6 100644 --- a/setup/setup_shared.sh +++ b/setup/setup_shared.sh @@ -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