Skip to content

Commit ce4d35e

Browse files
cortinicofacebook-github-bot
authored andcommitted
Fix missing native dependencies on packaged artifacts (#2748)
Summary: ## Motivation (required) Latest versions of Fresco have missing .so files due to a race condition on Gradle tasks. I'm imposing a task dependencies on `ndk_build_*` steps and `preBuild` steps to prevent this. Fixes #2722 Fixes #2747 ## Test Plan (required) I've tested this against `./gradlew publishToMavenLocal` upon clean build. Here the output: ``` $ unzip -l ~/.m2/repository/com/facebook/fresco/nativeimagetranscoder/3.1.1/nativeimagetranscoder-3.1.1.aar Archive: /Users/ncor/.m2/repository/com/facebook/fresco/nativeimagetranscoder/3.1.1/nativeimagetranscoder-3.1.1.aar Length Date Time Name --------- ---------- ----- ---- 7297 02-01-1980 00:00 R.txt 216 02-01-1980 00:00 AndroidManifest.xml 6034 02-01-1980 00:00 classes.jar 121 02-01-1980 00:00 META-INF/com/android/build/gradle/aar-metadata.properties 0 02-01-1980 00:00 jni/ 0 02-01-1980 00:00 jni/arm64-v8a/ 475392 02-01-1980 00:00 jni/arm64-v8a/libnative-imagetranscoder.so 0 02-01-1980 00:00 jni/armeabi-v7a/ 271736 02-01-1980 00:00 jni/armeabi-v7a/libnative-imagetranscoder.so 0 02-01-1980 00:00 jni/x86/ 557648 02-01-1980 00:00 jni/x86/libnative-imagetranscoder.so 0 02-01-1980 00:00 jni/x86_64/ 621000 02-01-1980 00:00 jni/x86_64/libnative-imagetranscoder.so --------- ------- 1939444 13 files ``` Pull Request resolved: #2748 Reviewed By: passy Differential Revision: D50641344 Pulled By: cortinico fbshipit-source-id: c518b4cf4e418dcec1ac30a78c03a649d5c66c13
1 parent c266579 commit ce4d35e

File tree

5 files changed

+20
-1
lines changed

5 files changed

+20
-1
lines changed

animated-gif/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ android {
6060
}
6161
}
6262
ndkLibs.each { lib -> makeNdkTasks lib[0], lib[1] }
63+
preBuild.dependsOn("ndk_build_gifimage")
6364
}
6465

6566
apply plugin: "com.vanniktech.maven.publish"

imagepipeline-native/build.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ android {
7171
}
7272
}
7373
ndkLibs.each { lib -> makeNdkTasks lib[0], lib[1] }
74+
preBuild.dependsOn(
75+
"ndk_build_bitmaps",
76+
"ndk_build_imagepipeline",
77+
"ndk_build_memchunk"
78+
)
7479
}
7580

7681
apply plugin: "com.vanniktech.maven.publish"

native-filters/build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ android {
7575
abortOnError false
7676
}
7777
ndkLibs.each { lib -> makeNdkTasks lib[0], lib[1] }
78+
preBuild.dependsOn(
79+
"ndk_build_filters",
80+
"ndk_build_native-filters"
81+
)
7882
}
7983

8084
apply plugin: "com.vanniktech.maven.publish"

native-imagetranscoder/build.gradle

+4-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ task fetchNativeDeps(dependsOn: [copyLibjpeg]) {
4848
}
4949

5050
android {
51-
5251
def ndkLibs = [
5352
['native-imagetranscoder', [copyLibjpeg]]]
5453

@@ -76,6 +75,10 @@ android {
7675
abortOnError false
7776
}
7877
ndkLibs.each { lib -> makeNdkTasks lib[0], lib[1] }
78+
preBuild.dependsOn(
79+
"ndk_build_native-imagetranscoder",
80+
"copyLibjpeg"
81+
)
7982
}
8083

8184
apply plugin: "com.vanniktech.maven.publish"

static-webp/build.gradle

+6
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ android {
5757
abortOnError false
5858
}
5959
ndkLibs.each { lib -> makeNdkTasks lib[0], lib[1] }
60+
preBuild.dependsOn(
61+
"ndk_build_static-webp",
62+
"copyLibjpeg",
63+
"copyLibpng",
64+
"copyLibwebp"
65+
)
6066
}
6167

6268
apply plugin: "com.vanniktech.maven.publish"

0 commit comments

Comments
 (0)