Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

pbxProject.prototype.addFramework: automatically create Frameworks Group if it does not exist

Aperta
#28 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
ios, javascript, nodejs
Ambito
mobile

Direzione di ricerca

Inizia da pbxProject.prototype.addFramework e segui come vengono gestiti il gruppo Frameworks e project mainGroup. Usa il workaround dell’issue come riferimento per il comportamento. Il lavoro è completato quando un gruppo Frameworks mancante viene sia creato sia referenziato da mainGroup, così Xcode non inserisce il framework in Recovered References.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

This is a feature proposal

Initial Situation:

Your xcode project tree looks like this:
bildschirmfoto 2018-12-09 um 22 28 11

You have a Xcode project without a Framworks group and you want to add a new framework using pbxProject.prototype.addFramework.

Current behaviour:

The Frameworks group is created but not added to the mainGroup of the project which references all files (that are not part of a subgroup) and all groups (that are no subgroups).

If you open the updated xcode project with xcode you see the following:

bildschirmfoto 2018-12-09 um 22 15 28

This is because xcode cannot find a reference to the Frameworks group on the mainGroup and therefore "autofixes" the project by adding the library added with pbxProject.prototype.addFramework to a newly generated group Recovered References.

Expected behaviour:

The Framework group is created and also automatically added to the mainGroup.

When you open the project in xcode it should look like this:

bildschirmfoto 2018-12-09 um 22 23 26

Current workaround:

Add the Frameworks group to mainGroupmanually:

  const project = xcode.project(projectPath);
  project.parseSync();

  project.addFramework(path.resolve(frameworksDirectory, 'GoogleInterchangeUtilities.framework'), {
    customFramework: true,
    embed: true,
    link: true,
  });

  const mainProject = project.getPBXGroupByKey(project.getFirstProject().firstProject.mainGroup);
  if (!mainProject.children.some(children => children.comment === 'Frameworks')) {
    const [groupKey] = Object.entries(project.hash.project.objects['PBXGroup']).find(
      ([, group]) => group.name === 'Frameworks',
    );
    project.addToPbxGroup(groupKey, project.getFirstProject().firstProject.mainGroup);
  }

If you are okay with this feature proposal I would love to implement it!

Lingua principale
JavaScript
Stelle
217
Fork
102
Merge medio
2g 9h
PR unite (30g)
8

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/cordova-node-xcode

Tutte le issue di apache/cordova-node-xcode

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.