Skip to content

Commit e9b8097

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Integrate binary-compatibility-validator into RN Android build system
Summary: In this diff I'm integrating 'org.jetbrains.kotlinx.binary-compatibility-validator' into RN Android build gradle system. The tool allows dumping binary API of a JVM part of a Kotlin library that is public in the sense of Kotlin visibilities and ensures that the public binary API wasn't changed in a way that makes this change binary incompatible More context on https://github.com/Kotlin/binary-compatibility-validator#building-the-project-locally bypass-github-export-checks Reviewed By: cortinico Differential Revision: D51262577 fbshipit-source-id: 1894f4e55a4019e3ce1585e9df12dee69944e5ce
1 parent a481ae7 commit e9b8097

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

build.gradle.kts

+26
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ plugins {
1111
alias(libs.plugins.android.application) apply false
1212
alias(libs.plugins.download) apply false
1313
alias(libs.plugins.kotlin.android) apply false
14+
alias(libs.plugins.binary.compatibility.validator) apply true
1415
}
1516

1617
val reactAndroidProperties = java.util.Properties()
@@ -19,6 +20,31 @@ File("$rootDir/packages/react-native/ReactAndroid/gradle.properties").inputStrea
1920
reactAndroidProperties.load(it)
2021
}
2122

23+
apiValidation {
24+
ignoredPackages.addAll(
25+
listOf(
26+
"com.facebook.fbreact",
27+
"com.facebook.react.flipper",
28+
"com.facebook.debug",
29+
"com.facebook.hermes",
30+
"com.facebook.perftest",
31+
"com.facebook.proguard",
32+
"com.facebook.react.module.processing",
33+
"com.facebook.systrace",
34+
"com.facebook.yoga",
35+
"com.facebook.react.internal",
36+
"com.facebook.react.bridgeless.internal"))
37+
38+
ignoredClasses.addAll(listOf("com.facebook.react.BuildConfig"))
39+
40+
nonPublicMarkers.addAll(
41+
listOf(
42+
"com.facebook.react.common.annotations.UnstableReactNativeAPI",
43+
"com.facebook.react.common.annotations.VisibleForTesting"))
44+
45+
validationDisabled = true
46+
}
47+
2248
version =
2349
if (project.hasProperty("isSnapshot") &&
2450
(project.property("isSnapshot") as? String).toBoolean()) {

packages/react-native/gradle/libs.versions.toml

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ androidx-swiperefreshlayout = "1.1.0"
1313
androidx-test = "1.5.0"
1414
androidx-tracing = "1.1.0"
1515
assertj = "3.21.0"
16+
binary-compatibility-validator = "0.13.2"
1617
download = "5.4.0"
1718
fbjni = "0.5.1"
1819
fresco = "3.1.3"
@@ -76,3 +77,4 @@ android-library = { id = "com.android.library", version.ref = "agp" }
7677
download = { id = "de.undercouch.download", version.ref = "download" }
7778
nexus-publish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexus-publish" }
7879
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
80+
binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binary-compatibility-validator" }

0 commit comments

Comments
 (0)