apache / apache/cordova-node-xcode

addBuildPhase keeps adding phases when they already exist

Open
#110 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
217
Forks
102
Avg merge
2d 3h
Merged PRs (30d)
6

Description

This is the build script line

```
xcodeProject.addBuildPhase(
[], 'PBXShellScriptBuildPhase', 'Configure Crashlytics', undefined, options
).buildPhase;
fs.writeFileSync(xcodeProjectPath, xcodeProject.writeSync());
$logger.trace('Xcode project written');
} else {
$logger.error(xcodeProjectPath + ' is missing.');
reject();
return;
}
```

So I guess everytime the CLI build runs it adds a NEW "Configure Crashlytics" to the build phase. Eventually my machine just outright died because the script was running hundreds of times.

Is there maybe a way before this I can check to see if it exists first before just adding it again?

Contributor guide

Open the contributing guide

Research direction

Start by locating the addBuildPhase call shown in the build script and inspect how it handles existing phases named "Configure Crashlytics". Re-run the CLI build against an Xcode project more than once; done means repeated runs leave one such build phase and still write the project successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, javascript, node.js
Domain
cli, mobile-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.