Skip to content

Commit

Permalink
Fix Android autolink plugin for libraries that are platform specific
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldonadel committed Jun 28, 2024
1 parent 84a9f5e commit f57b142
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,14 @@ abstract class ReactSettingsExtension @Inject constructor(val settings: Settings

internal fun getLibrariesToAutolink(buildFile: File): Map<String, File> {
val model = JsonUtils.fromAutolinkingConfigJson(buildFile)
return model?.dependencies?.values?.associate { deps ->
":${deps.nameCleansed}" to File(deps.platforms?.android?.sourceDir)
} ?: emptyMap()
return model?.dependencies?.values?.mapNotNull { deps ->
val sourceDir = deps.platforms?.android?.sourceDir
if (sourceDir != null) {
":${deps.nameCleansed}" to File(sourceDir)
} else {
null
}
}?.toMap() ?: emptyMap()
}

internal fun computeSha256(lockFile: File) =
Expand Down

0 comments on commit f57b142

Please sign in to comment.