Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android): ensure generated assets are included #2012

Merged
merged 1 commit into from
May 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions test-app.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ ext.applyTestAppModule = { Project project ->
androidResourceFiles.remove(androidResDir)
}

def generatedAssetsDir = file("${buildDir}/generated/rncli/src/main/assets/")
def generatedAssetsDir = file("${buildDir}/generated/rnta/src/main/assets/")
generatedAssetsDir.mkdirs()

def generatedResDir = file("${buildDir}/generated/rncli/src/main/res/")
def generatedResDir = file("${buildDir}/generated/rnta/src/main/res/")
generatedResDir.mkdirs()

// https://github.com/react-native-community/cli/blob/be880b86cdb3f4ea104cf232b95d11f84613321b/packages/cli-platform-android/native_modules.gradle#L534
def generatedSrcDir = file("${buildDir}/generated/rncli/src/main/java/")
def generatedSrcDir = file("${buildDir}/generated/rnta/src/main/java/")
generatedSrcDir.mkdirs()

// https://github.com/facebook/react-native/blob/3dfedbc1aec18a4255e126fde96d5dc7b1271ea7/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/assets/ReactFontManager.java#L25
Expand Down Expand Up @@ -209,6 +209,7 @@ ext.applyTestAppModule = { Project project ->
android {
sourceSets {
main {
java.srcDirs += generatedSrcDir
assets.srcDirs += generatedAssetsDir
res.srcDirs += generatedResDir
if (manifest.containsKey("android") && manifest["android"].containsKey("icons")) {
Expand Down