.llms/rules/ACR_no_internal_imports_in_oss.md
Severity: HIGH — libraries/fresco/ is open-source and synced to GitHub
Fresco has two build systems: internal Buck and OSS Gradle. Changes that work internally often break the OSS Gradle build (ci/build-and-test.sh). This rule covers the common breakage patterns.
import com.meta.* in any file under libraries/fresco/PrimitiveImage from com.facebook.litho.widget)Image.create(c)...build() to PrimitiveImage(...) which does not exist in OSS Litho 0.50.1Before bumping a dependency version in buildSrc/dependencies.kt, verify the artifact actually exists on Maven Central. Several libraries used by Fresco are archived and have no new releases.
AndroidX library upgrades can require a higher compileSdkVersion. For example, androidx.core:core:1.15.0 requires compileSdk 35 but Fresco uses 34. Check the AAR metadata for minCompileSdk requirements before bumping.
The imagepipeline-okhttp3 module uses OkHttp 3 Java method-call syntax (response.body(), okHttpClient.dispatcher().executorService()). OkHttp 4 is a Kotlin rewrite where these became properties (response.body, okHttpClient.dispatcher.executorService). Do not bump to OkHttp 4.x without updating all call sites.
When adding a test file or test dependency via Buck, also add the corresponding testImplementation in the module's build.gradle. Common missing deps:
TestDeps.junit — needed for @Test, assertEqualsTestDeps.assertjCore — needed for assertThatTestDeps.robolectric — needed for @RunWith(RobolectricTestRunner::class)Deps.inferAnnotation — needed if test files use @NullsafeTestDeps.mockitoKotlin3 — needed for mock<T>(), whenever, verifyui-common, vito:view, native-filters, imagepipeline all had tests added internally without Gradle dependency updatesThe OSS build uses mockito-kotlin 3.1.0. The following APIs are NOT available until 4.x:
org.mockito.kotlin.verifyNoInteractions — use org.mockito.Mockito.verifyNoInteractions insteadMockito.mock<T>() (reified, no class param) — use mock<T>() from mockito-kotlin or Mockito.mock(T::class.java)org.mockito.kotlin.verifyNoInteractions which does not exist in 3.1.0import com.meta.* in FB-internal code (java/com/facebook/fresco/, java/com/meta/images/)