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 authored and cortinico committed Jul 1, 2024
1 parent cef17ba commit 123f721
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 123f721

Please sign in to comment.