Can the Podfile generation better handle logical blocks
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- ruby, typescript
Rechercherichtung
Beginne mit lib/services/cocoapods-platform-manager.ts, insbesondere mit selectPlatformDataFromProjectPodfile und seinem Ausdruck zur Plattformübereinstimmung. Verfolge, wie Podfile-Zeilen nach oben verschoben werden und wie nicht in Anführungszeichen gesetzte Ruby-Ausdrücke sowie Code außerhalb von Hooks behandelt werden. Als erledigt gilt die Aufgabe, wenn das angeforderte variablenbasierte Deployment Target und die erforderlichen Zeilen nutzbar bleiben, ohne entfernt zu werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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 in two separate files to ensure both the target application and all dependencies meet our minimum desired version.
- App_Resources/iOS/build.xcconfig
IPHONEOS_DEPLOYMENT_TARGET=16 - App_Resources/iOS/Podfile
platform :ios, '16.0'
As 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.
platform :ios, '13.0'
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
This makes 3 places where I need to update the target version for iOS.
Inspired by this answer, if I try to apply any kind of logic in the application Podfile, it is either stripped by the CocoaPodsPlatformManager or ignored altogether.
Doing this:
app_ios_deployment_target = Gem::Version.new('16.0')
platform :ios, app_ios_deployment_target.version
Results in this:
platform :ios,
It looks like the Regex is trying to match a platform within quotes('") only.
^\\s*?#\\s*?(platform\\b\\s*?\\:\\s*?ios\\b(?:,\\s*?['"](.+)['"])?)
Ruby 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.
Describe the solution you'd like
It would be great if CocoaPodsPlatformManager.selectPlatformDataFromProjectPodfile could be expanded to match other expressions.
It 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.
This 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.
Describe alternatives you've considered
No response
Anything else?
No response
Please accept these terms
- I have searched the existing issues as well as StackOverflow and this has not been posted before
- I agree to follow this project's Code of Conduct
- Vorherrschende Sprache
- JavaScript
- Sterne
- 1.1k
- Forks
- 204
- Ø Merge
- 1 T. 9 Std.
- Gemergte PRs (30 T.)
- 8
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus NativeScript/nativescript-cli
-
in-progress
NativeScript/nativescript-cli#6140 · 2 Kommentare · 1 zugewiesene Person ·
-
NativeScript/nativescript-cli#6090 · 1 zugewiesene Person ·
-
in progress
NativeScript/nativescript-cli#6015 · 1 Reaktion · 1 zugewiesene Person ·
-
question
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
NativeScript/nativescript-cli#5992 · 5 Kommentare ·
-
feature-pending-triage
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
NativeScript/nativescript-cli#5975 ·
Alle Issues in NativeScript/nativescript-cli
Ähnliche Issues
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
babalae/bettergi-scripts-list#3674 ·
-
ecosystem wording
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
matrix-org/matrix.org#3649 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
vadimdemedes/ink#1029 ·
-
code-quality refactoring
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
langchain-ai/deepagents#6450 ·