Skip to content

Commit

Permalink
Add rn-tester Android BUCK configuration (#39987)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #39987

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D49983211

fbshipit-source-id: c362d5b93e159bfb5ca17bea0ec0484adcdb4dca
  • Loading branch information
christophpurrer authored and huntie committed Oct 19, 2023
1 parent 6dcf468 commit c9980fb
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/react-native/ReactCommon/react/bridging/Object.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct Bridging<
std::shared_ptr<T>,
std::enable_if_t<std::is_base_of_v<jsi::HostObject, T>>> {
static std::shared_ptr<T> fromJs(jsi::Runtime& rt, const jsi::Object& value) {
return value.asHostObject<T>(rt);
return value.getHostObject<T>(rt);
}

static jsi::Object toJs(jsi::Runtime& rt, std::shared_ptr<T> value) {
Expand Down
2 changes: 2 additions & 0 deletions packages/rn-tester/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ android {
versionName "1.0"
testBuildType System.getProperty('testBuildType', 'debug') // This will later be used to control the test apk build type
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
buildConfigField("String", "JS_MAIN_MODULE_NAME", "\"js/RNTesterApp.android\"")
buildConfigField("String", "BUNDLE_ASSET_NAME", "\"RNTesterApp.android.bundle\"")
}
externalNativeBuild {
cmake {
Expand Down
5 changes: 5 additions & 0 deletions packages/rn-tester/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
package="com.facebook.react.uiapp"
xmlns:android="http://schemas.android.com/apk/res/android">

<uses-feature
Expand All @@ -15,6 +16,10 @@
android:name="android.hardware.camera"
android:required="false" />

<uses-sdk
android:minSdkVersion="23"
android:targetSdkVersion="34" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ class RNTesterApplication : Application(), ReactApplication {
throw RuntimeException("Should not use ReactNativeHost when Bridgeless enabled")
}
object : DefaultReactNativeHost(this) {
public override fun getJSMainModuleName(): String = "js/RNTesterApp.android"
public override fun getJSMainModuleName(): String = BuildConfig.JS_MAIN_MODULE_NAME

public override fun getBundleAssetName(): String = "RNTesterApp.android.bundle"
public override fun getBundleAssetName(): String = BuildConfig.BUNDLE_ASSET_NAME

override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ import com.facebook.react.uimanager.ViewManager
class RNTesterReactHostDelegate internal constructor(context: Context) : ReactHostDelegate {
var reactHost: ReactHostImpl? = null

override val jsMainModulePath: String = "js/RNTesterApp.android"
override val jsMainModulePath: String = BuildConfig.JS_MAIN_MODULE_NAME

override val jsBundleLoader: JSBundleLoader =
JSBundleLoader.createAssetLoader(context, "assets://RNTesterApp.android.bundle", true)
JSBundleLoader.createAssetLoader(context, "assets:" + BuildConfig.BUNDLE_ASSET_NAME, true)

@get:Synchronized override val bindingsInstaller: BindingsInstaller? = null

Expand Down

0 comments on commit c9980fb

Please sign in to comment.