deependhulla commented on issue #1379:
URL: https://github.com/apache/cordova-ios/issues/1379#issuecomment-2963581215
below code helped ....
<code>
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()) {
const subdirectoryFilePaths =
findFilePathsByFilename(filePath, filename);
filePaths.push(...subdirectoryFilePaths);
} else if (stats.isFile() && file === filename) {
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');
</code>
it help thanks to @connyhald
we created folder scripts and updated above code in
scripts/fix_ios_target.js ...and call in via config.xml as below .
`
<platform name="ios">
<preference name="deployment-target" value="15.0" />
<hook type="after_prepare" src="scripts/fix_ios_target.js" />
</platform>
`
it helped ..it showed like below ..all was good .
<code>
bash-3.2$ cordova platform add ios
Using cordova-fetch for cordova-ios
Adding ios project...
Creating Cordova project for the iOS platform:
Path: platforms/ios
Package: com.deependhulla.clubemeraldteams
Name: Teams
iOS project created with [email protected]
Apply patch to [
'node_modules/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj',
'node_modules/cordova-ios/templates/project/__PROJECT_NAME__.xcodeproj/project.pbxproj',
'platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj',
'platforms/ios/Teams.xcodeproj/project.pbxproj'
]
</code>
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]