René's URL Explorer Experiment


Title: Can the Podfile generation better handle logical blocks · Issue #5805 · NativeScript/nativescript-cli · GitHub

Open Graph Title: Can the Podfile generation better handle logical blocks · Issue #5805 · NativeScript/nativescript-cli

X Title: Can the Podfile generation better handle logical blocks · Issue #5805 · NativeScript/nativescript-cli

Description: Is your feature request related to a problem? Please describe. I wish I could apply variable logic when defining iOS deployment target in the application Podfile. To set the IPHONEOS_DEPLOYMENT_TARGET we must define the platform version ...

Open Graph Description: Is your feature request related to a problem? Please describe. I wish I could apply variable logic when defining iOS deployment target in the application Podfile. To set the IPHONEOS_DEPLOYMENT_TAR...

X Description: Is your feature request related to a problem? Please describe. I wish I could apply variable logic when defining iOS deployment target in the application Podfile. To set the IPHONEOS_DEPLOYMENT_TAR...

Opengraph URL: https://github.com/NativeScript/nativescript-cli/issues/5805

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Can the Podfile generation better handle logical blocks ","articleBody":"### Is your feature request related to a problem? Please describe.\r\n\r\nI wish I could apply variable logic when defining iOS deployment target in the application Podfile.\r\n\r\nTo set the `IPHONEOS_DEPLOYMENT_TARGET` we must define the platform version in two separate files to ensure both the target application and all dependencies meet our minimum desired version.\r\n\r\n1. **App_Resources/iOS/build.xcconfig**\r\n    `IPHONEOS_DEPLOYMENT_TARGET=16`\r\n2. **App_Resources/iOS/Podfile**\r\n    `platform :ios, '16.0'`\r\n\r\nAs suggested in the troubleshooting documentation, to ensure that all dependencies are also configured to this target it is suggested that we do the following... which works fine.\r\n\r\n```\r\nplatform :ios, '13.0'\r\n\r\npost_install do |installer|\r\n  installer.pods_project.targets.each do |target|\r\n    target.build_configurations.each do |config|\r\n      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'\r\n    end\r\n  end\r\nend\r\n```\r\n*_See_ https://docs.nativescript.org/troubleshooting#cocoapods-could-not-find-compatible-versions-for-pod-higher-minimum-deployment-target\r\n\r\nThis makes 3 places where I need to update the target version for iOS.\r\n\r\nInspired by [this answer](App_Resources/iOS/build.xcconfig), if I try to apply any kind of logic in the application Podfile, it is either stripped by the [CocoaPodsPlatformManager](https://github.com/NativeScript/nativescript-cli/blob/main/lib/services/cocoapods-platform-manager.ts) or ignored altogether.\r\n\r\nDoing this:\r\n```\r\napp_ios_deployment_target = Gem::Version.new('16.0')\r\nplatform :ios, app_ios_deployment_target.version\r\n```\r\n\r\nResults in this:\r\n```\r\nplatform :ios, \r\n```\r\n\r\nIt looks like the Regex is trying to match a platform within quotes('\") only.\r\n`^\\\\s*?#\\\\s*?(platform\\\\b\\\\s*?\\\\:\\\\s*?ios\\\\b(?:,\\\\s*?['\"](.+)['\"])?)`\r\n\r\nRuby will also complain the variable `app_ios_deployment_target` does not exist, which is true because only the line matched by the Regex above is hoisted above any post_install hooks and all other code blocks are lost.\r\n\r\n\r\n\r\n### Describe the solution you'd like\r\n\r\nIt would be great if [CocoaPodsPlatformManager.selectPlatformDataFromProjectPodfile](https://github.com/NativeScript/nativescript-cli/blob/main/lib/services/cocoapods-platform-manager.ts#L139) could be expanded to match other expressions.\r\n\r\nIt would also be great if all other lines that are not the platform definition and are outside of hooks are hoisted first, so that variables could be used.\r\n\r\nThis could mean that we can have one source of truth when defining the iOS target. Which could be in `App_Resources/iOS/build.xcconfig` and the read from the Podfile, or better yet an environment variable.\r\n\r\n### Describe alternatives you've considered\r\n\r\n_No response_\r\n\r\n### Anything else?\r\n\r\n_No response_\r\n\r\n### Please accept these terms\r\n\r\n- [X] I have searched the [existing issues](https://github.com/NativeScript/nativescript-cli/issues) as well as [StackOverflow](https://stackoverflow.com/questions/tagged/nativescript) and this has not been posted before\r\n- [X] I agree to follow this project's [Code of Conduct](https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#coc)","author":{"url":"https://github.com/insytes","@type":"Person","name":"insytes"},"datePublished":"2024-07-03T14:50:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/5805/nativescript-cli/issues/5805"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:95d3ad6c-128c-fe81-9552-5a5f76f571a6
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB58C:204573:6EEFC47:92D596E:696DDD28
html-safe-noncebac05cb45504c92524a8befad02b4bf5d4d0624c857f5153eb32d3351ca807a7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNThDOjIwNDU3Mzo2RUVGQzQ3OjkyRDU5NkU6Njk2REREMjgiLCJ2aXNpdG9yX2lkIjoiNjg2MTc0ODA5NDQwODQ0OTMyMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaca40ffc6fcdc02766ada61c489c0de67b2806004504c4751c91abc6978729440a
hovercard-subject-tagissue:2388839540
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/nativescript-cli/5805/issue_layout
twitter:imagehttps://opengraph.githubassets.com/6d8302bbcb94556a411d1616a314d2da5ff4cbca87c08acb3d121ffd15fa344c/NativeScript/nativescript-cli/issues/5805
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/6d8302bbcb94556a411d1616a314d2da5ff4cbca87c08acb3d121ffd15fa344c/NativeScript/nativescript-cli/issues/5805
og:image:altIs your feature request related to a problem? Please describe. I wish I could apply variable logic when defining iOS deployment target in the application Podfile. To set the IPHONEOS_DEPLOYMENT_TAR...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameinsytes
hostnamegithub.com
expected-hostnamegithub.com
None4922b452d03cd8dbce479d866a11bc25b59ef6ee2da23aa9b0ddefa6bd4d0064
turbo-cache-controlno-preview
go-importgithub.com/NativeScript/nativescript-cli git https://github.com/NativeScript/nativescript-cli.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id21347346
octolytics-dimension-repository_nwoNativeScript/nativescript-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id21347346
octolytics-dimension-repository_network_root_nwoNativeScript/nativescript-cli
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7e5ae23c70136152637ceee8d6faceb35596ec46
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/NativeScript/nativescript-cli/issues/5805#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fnativescript-cli%2Fissues%2F5805
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fnativescript-cli%2Fissues%2F5805
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=NativeScript%2Fnativescript-cli
Reloadhttps://patch-diff.githubusercontent.com/NativeScript/nativescript-cli/issues/5805
Reloadhttps://patch-diff.githubusercontent.com/NativeScript/nativescript-cli/issues/5805
Reloadhttps://patch-diff.githubusercontent.com/NativeScript/nativescript-cli/issues/5805
NativeScript https://patch-diff.githubusercontent.com/NativeScript
nativescript-clihttps://patch-diff.githubusercontent.com/NativeScript/nativescript-cli
Please reload this pagehttps://patch-diff.githubusercontent.com/NativeScript/nativescript-cli/issues/5805
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FNativeScript%2Fnativescript-cli
Fork 198 https://patch-diff.githubusercontent.com/login?return_to=%2FNativeScript%2Fnativescript-cli
Star 1k https://patch-diff.githubusercontent.com/login?return_to=%2FNativeScript%2Fnativescript-cli
Code https://patch-diff.githubusercontent.com/NativeScript/nativescript-cli
Issues 361 https://patch-diff.githubusercontent.com/NativeScript/nativescript-cli/issues
Pull requests 13 https://patch-diff.githubusercontent.com/NativeScript/nativescript-cli/pulls
Actions https://patch-diff.githubusercontent.com/NativeScript/nativescript-cli/actions
Projects 0 https://patch-diff.githubusercontent.com/NativeScript/nativescript-cli/projects
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/NativeScript/nativescript-cli/security
Please reload this pagehttps://patch-diff.githubusercontent.com/NativeScript/nativescript-cli/issues/5805
Insights https://patch-diff.githubusercontent.com/NativeScript/nativescript-cli/pulse
Code https://patch-diff.githubusercontent.com/NativeScript/nativescript-cli
Issues https://patch-diff.githubusercontent.com/NativeScript/nativescript-cli/issues
Pull requests https://patch-diff.githubusercontent.com/NativeScript/nativescript-cli/pulls
Actions https://patch-diff.githubusercontent.com/NativeScript/nativescript-cli/actions
Projects https://patch-diff.githubusercontent.com/NativeScript/nativescript-cli/projects
Security https://patch-diff.githubusercontent.com/NativeScript/nativescript-cli/security
Insights https://patch-diff.githubusercontent.com/NativeScript/nativescript-cli/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/NativeScript/nativescript-cli/issues/5805
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/NativeScript/nativescript-cli/issues/5805
Can the Podfile generation better handle logical blocks https://patch-diff.githubusercontent.com/NativeScript/nativescript-cli/issues/5805#top
feature-pending-triageA new feature request pending triage to confirm validity.https://github.com/NativeScript/nativescript-cli/issues?q=state%3Aopen%20label%3A%22feature-pending-triage%22
https://github.com/insytes
https://github.com/insytes
insyteshttps://github.com/insytes
on Jul 3, 2024https://github.com/NativeScript/nativescript-cli/issues/5805#issue-2388839540
https://docs.nativescript.org/troubleshooting#cocoapods-could-not-find-compatible-versions-for-pod-higher-minimum-deployment-targethttps://docs.nativescript.org/troubleshooting#cocoapods-could-not-find-compatible-versions-for-pod-higher-minimum-deployment-target
this answerhttps://patch-diff.githubusercontent.com/NativeScript/nativescript-cli/issues/App_Resources/iOS/build.xcconfig
CocoaPodsPlatformManagerhttps://github.com/NativeScript/nativescript-cli/blob/main/lib/services/cocoapods-platform-manager.ts
CocoaPodsPlatformManager.selectPlatformDataFromProjectPodfilehttps://github.com/NativeScript/nativescript-cli/blob/main/lib/services/cocoapods-platform-manager.ts#L139
existing issueshttps://github.com/NativeScript/nativescript-cli/issues
StackOverflowhttps://stackoverflow.com/questions/tagged/nativescript
Code of Conducthttps://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#coc
feature-pending-triageA new feature request pending triage to confirm validity.https://github.com/NativeScript/nativescript-cli/issues?q=state%3Aopen%20label%3A%22feature-pending-triage%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.