connyhald commented on issue #1379: URL: https://github.com/apache/cordova-ios/issues/1379#issuecomment-2052414835
We solved this using a rather ugly (but working) hack using the following script to post-process the project files. ```js 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 = 12.0;'); fs.writeFileSync(path, content); } console.log('Done setting IPHONEOS_DEPLOYMENT_TARGET'); ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org