Skip to content

Commit

Permalink
more accurate product-name regex
Browse files Browse the repository at this point in the history
Summary:
Some projects define multiple targets, including app extensions, which are built with a “.appex” extension.   This fix prevents the buildProject method from selecting any app extension (e.g. a Today.appex today-widget extension) as the product name.

Thanks for submitting a PR! Please read these instructions carefully:

- [X] Explain the **motivation** for making this change.
- [X] Provide a **test plan** demonstrating that the code is solid.
- [X] Match the **code formatting** of the rest of the codebase.
- [X] Target the `master` branch, NOT a "stable" branch.

When building our workspace, ReactNative was failing to install the app to the simulator because it calculated an incorrect path to the app itself.   It was attempting to install "Today.app" when it should have been installing "Remitly.app".   I discovered that ReactNative parses the build output to identify the generated app name, and that this was broken when the build also generated an app extension.  The f
Closes #13001

Differential Revision: D4735360

fbshipit-source-id: afeeb2073ccd65c95916b153fcde574b5343af8c
  • Loading branch information
TomSwift authored and facebook-github-bot committed Mar 18, 2017
1 parent 22da6f2 commit cbd46aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion local-cli/runIOS/runIOS.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function buildProject(xcodeProject, udid, scheme, configuration = 'Debug', launc
});
buildProcess.on('close', function(code) {
//FULL_PRODUCT_NAME is the actual file name of the app, which actually comes from the Product Name in the build config, which does not necessary match a scheme name, example output line: export FULL_PRODUCT_NAME="Super App Dev.app"
let productNameMatch = /export FULL_PRODUCT_NAME="?(.+).app/.exec(buildOutput);
let productNameMatch = /export FULL_PRODUCT_NAME="?(.+).app"?$/.exec(buildOutput);
if (productNameMatch && productNameMatch.length && productNameMatch.length > 1) {
return resolve(productNameMatch[1]);//0 is the full match, 1 is the app name
}
Expand Down

0 comments on commit cbd46aa

Please sign in to comment.