Skip to content

Commit

Permalink
fix: [Codegen] log supported apple platforms if there are any (#42819)
Browse files Browse the repository at this point in the history
Summary:
This PR adds check if there are any supported platforms to log.

For built-in modules this was logging empty line (as some of them doesn't contain podspecs):

![CleanShot 2024-02-02 at 15 54 42@2x](https://github.com/facebook/react-native/assets/52801365/c7e36052-9c48-4e00-a539-6ee5d528bbee)

## Changelog:

[GENERAL] [FIXED] - Log Codegen supported platforms if any are available

Pull Request resolved: #42819

Test Plan: Run Codegen and check if it prints empty `Supported Apple platforms`

Reviewed By: cortinico

Differential Revision: D53566301

Pulled By: cipolleschi

fbshipit-source-id: 3f6b6d3b44da1ab7174432a5fac7f7d3fde11103
  • Loading branch information
okwasniewski authored and facebook-github-bot committed Feb 8, 2024
1 parent 527d193 commit 2ca7bec
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,18 @@ function extractSupportedApplePlatforms(dependency, dependencyPath) {
{},
);

console.log(
`[Codegen] Supported Apple platforms: ${Object.keys(supportedPlatformsMap)
.filter(key => supportedPlatformsMap[key])
.join(', ')} for ${dependency}`,
const supportedPlatformsList = Object.keys(supportedPlatformsMap).filter(
key => supportedPlatformsMap[key],
);

if (supportedPlatformsList.length > 0) {
console.log(
`[Codegen] Supported Apple platforms: ${supportedPlatformsList.join(
', ',
)} for ${dependency}`,
);
}

return supportedPlatformsMap;
}

Expand Down

0 comments on commit 2ca7bec

Please sign in to comment.