Skip to content

Sanity check of Hermes source directory via environment variable, when building Android projects #163

@kraenhansen

Description

@kraenhansen

I've investigated ways of letting the host package drive building Hermes from (our) source. So far, I haven't found any.

In the absence of a fully automated solution, it would be good if we exist early with instructions on how to set the REACT_NATIVE_OVERRIDE_HERMES_DIR environment variable if missing:

export REACT_NATIVE_OVERRIDE_HERMES_DIR=`npx react-native-node-api vendor-hermes --silent`

I would expect the error to be thrown from a new task around here:

// Custom task to fetch jniLibs paths via CLI
task linkNodeApiModules {
doLast {
exec {
// TODO: Support --strip-path-suffix
commandLine 'npx', 'react-native-node-api', 'link', '--android', rootProject.rootDir.absolutePath
standardOutput = System.out
errorOutput = System.err
// Enable color output
environment "FORCE_COLOR", "1"
}
android.sourceSets.main.jniLibs.srcDirs += file("../auto-linked/android").listFiles()
}
}
preBuild.dependsOn linkNodeApiModules

Metadata

Metadata

Assignees

No one assigned

    Labels

    Android 🤖Anything related to the Android platform (Gradle, NDK, Android SDK)good first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions