-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[0.73] Collection of Android picks for RC4 (#41221)
Co-authored-by: Lulu Wu <luluwu@meta.com> Co-authored-by: Gabriel Donadel <donadeldev@gmail.com> fix `java.lang.NoSuchMethodError` for Bridgeless (#41081) resolved: #41081 resolved: #40999 resolved: #41165 Fix RNTester not showing Redbox when Metro is not connected (#41191) resolved: #41191 resolved: #41190 resolved: #41085 resolved: #41206
- Loading branch information
1 parent
2664b8b
commit c8ad23a
Showing
11 changed files
with
177 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...native-gradle-plugin/src/test/kotlin/com/facebook/react/utils/AgpConfiguratorUtilsTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
package com.facebook.react.utils | ||
|
||
import java.io.File | ||
import org.junit.Assert.* | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.rules.TemporaryFolder | ||
|
||
class AgpConfiguratorUtilsTest { | ||
|
||
@get:Rule val tempFolder = TemporaryFolder() | ||
|
||
@Test | ||
fun getPackageNameFromManifest_withEmptyFile_returnsNull() { | ||
val mainFolder = tempFolder.newFolder("awesome-module/src/main/") | ||
val manifest = File(mainFolder, "AndroidManifest.xml").apply { writeText("") } | ||
|
||
val actual = getPackageNameFromManifest(manifest) | ||
assertNull(actual) | ||
} | ||
|
||
@Test | ||
fun getPackageNameFromManifest_withMissingPackage_returnsNull() { | ||
val mainFolder = tempFolder.newFolder("awesome-module/src/main/") | ||
val manifest = | ||
File(mainFolder, "AndroidManifest.xml").apply { | ||
writeText( | ||
// language=xml | ||
""" | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
</manifest> | ||
""" | ||
.trimIndent()) | ||
} | ||
|
||
val actual = getPackageNameFromManifest(manifest) | ||
assertNull(actual) | ||
} | ||
|
||
@Test | ||
fun getPackageNameFromManifest_withPackage_returnsPackage() { | ||
val mainFolder = tempFolder.newFolder("awesome-module/src/main/") | ||
val manifest = | ||
File(mainFolder, "AndroidManifest.xml").apply { | ||
writeText( | ||
// language=xml | ||
""" | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.facebook.react" > | ||
</manifest> | ||
""" | ||
.trimIndent()) | ||
} | ||
|
||
val actual = getPackageNameFromManifest(manifest) | ||
assertNotNull(actual) | ||
assertEquals("com.facebook.react", actual) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.