Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const pluginSourcePath = await config.composite.getNativeDependencyPath(
plugin
)
if (!pluginSourcePath) {
throw new Error(`path to ${plugin.basePath} not found in composite`)
}
if (await coreUtils.isDependencyPathNativeApiImpl(pluginSourcePath)) {
// For native api implementations, if a 'ern.pluginConfig' object
// exists in its package.json, replace pluginConfig with this one.
const pluginPackageJson = await readPackageJson(pluginSourcePath)
if (pluginPackageJson.ern.pluginConfig) {
pluginConfig = pluginPackageJson.ern.pluginConfig
}
populateApiImplMustacheView(pluginSourcePath, mustacheView, true)
}
pathToPluginProject = path.join(
pluginSourcePath,
pluginConfig.android.root
)
shell.pushd(pathToPluginProject)
try {
if (await coreUtils.isDependencyPathNativeApiImpl(pluginSourcePath)) {
// Special handling for native api implementation as we don't
// want to copy the API and bridge code (part of native api implementations projects)
const relPathToApiImplSource = path.normalize(
'lib/src/main/java/com/ern'
)
const absPathToCopyPluginSourceTo = path.join(
for (const plugin of plugins) {
const pluginConfig = await manifest.getPluginConfig(
plugin,
projectSpec.projectName
)
if (!pluginConfig) {
continue
}
const pluginSourcePath = await composite.getNativeDependencyPath(plugin)
if (!pluginSourcePath) {
throw new Error(`path to ${plugin.basePath} not found in composite`)
}
if (await utils.isDependencyPathNativeApiImpl(pluginSourcePath)) {
populateApiImplMustacheView(pluginSourcePath, mustacheView, true)
}
}
if (mustacheView.apiImplementations) {
mustacheView.hasApiImpl = true
for (const api of mustacheView.apiImplementations) {
if (api.hasConfig) {
mustacheView.hasAtleastOneApiImplConfig = true
break
}
}
}
}
}