-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(react-native-cli): ensure kotlin files are updated
- Loading branch information
1 parent
030ac98
commit 8d2c830
Showing
6 changed files
with
275 additions
and
21 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
48 changes: 48 additions & 0 deletions
48
packages/react-native-cli/src/lib/__test__/fixtures/MainApplication-after-2.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,48 @@ | ||
package com.bugsnagreactnativeclitest | ||
|
||
import com.bugsnag.android.Bugsnag | ||
import android.app.Application | ||
import com.facebook.react.PackageList | ||
import com.facebook.react.ReactApplication | ||
import com.facebook.react.ReactHost | ||
import com.facebook.react.ReactNativeHost | ||
import com.facebook.react.ReactPackage | ||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load | ||
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost | ||
import com.facebook.react.defaults.DefaultReactNativeHost | ||
import com.facebook.react.flipper.ReactNativeFlipper | ||
import com.facebook.soloader.SoLoader | ||
|
||
class MainApplication : Application(), ReactApplication { | ||
|
||
override val reactNativeHost: ReactNativeHost = | ||
object : DefaultReactNativeHost(this) { | ||
override fun getPackages(): List<ReactPackage> = | ||
PackageList(this).packages.apply { | ||
// Packages that cannot be autolinked yet can be added manually here, for example: | ||
// add(MyReactNativePackage()) | ||
} | ||
|
||
override fun getJSMainModuleName(): String = "index" | ||
|
||
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG | ||
|
||
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED | ||
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED | ||
} | ||
|
||
override val reactHost: ReactHost | ||
get() = getDefaultReactHost(this.applicationContext, reactNativeHost) | ||
|
||
override fun onCreate() { | ||
// something between curly brace and super call | ||
super.onCreate() | ||
Bugsnag.start(this) | ||
SoLoader.init(this, false) | ||
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { | ||
// If you opted-in for the New Architecture, we load the native entry point for this app. | ||
load() | ||
} | ||
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager) | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
packages/react-native-cli/src/lib/__test__/fixtures/MainApplication-after.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,47 @@ | ||
package com.bugsnagreactnativeclitest | ||
|
||
import com.bugsnag.android.Bugsnag | ||
import android.app.Application | ||
import com.facebook.react.PackageList | ||
import com.facebook.react.ReactApplication | ||
import com.facebook.react.ReactHost | ||
import com.facebook.react.ReactNativeHost | ||
import com.facebook.react.ReactPackage | ||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load | ||
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost | ||
import com.facebook.react.defaults.DefaultReactNativeHost | ||
import com.facebook.react.flipper.ReactNativeFlipper | ||
import com.facebook.soloader.SoLoader | ||
|
||
class MainApplication : Application(), ReactApplication { | ||
|
||
override val reactNativeHost: ReactNativeHost = | ||
object : DefaultReactNativeHost(this) { | ||
override fun getPackages(): List<ReactPackage> = | ||
PackageList(this).packages.apply { | ||
// Packages that cannot be autolinked yet can be added manually here, for example: | ||
// add(MyReactNativePackage()) | ||
} | ||
|
||
override fun getJSMainModuleName(): String = "index" | ||
|
||
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG | ||
|
||
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED | ||
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED | ||
} | ||
|
||
override val reactHost: ReactHost | ||
get() = getDefaultReactHost(this.applicationContext, reactNativeHost) | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
Bugsnag.start(this) | ||
SoLoader.init(this, false) | ||
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { | ||
// If you opted-in for the New Architecture, we load the native entry point for this app. | ||
load() | ||
} | ||
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager) | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
packages/react-native-cli/src/lib/__test__/fixtures/MainApplication-before-2.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,46 @@ | ||
package com.bugsnagreactnativeclitest | ||
|
||
import android.app.Application | ||
import com.facebook.react.PackageList | ||
import com.facebook.react.ReactApplication | ||
import com.facebook.react.ReactHost | ||
import com.facebook.react.ReactNativeHost | ||
import com.facebook.react.ReactPackage | ||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load | ||
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost | ||
import com.facebook.react.defaults.DefaultReactNativeHost | ||
import com.facebook.react.flipper.ReactNativeFlipper | ||
import com.facebook.soloader.SoLoader | ||
|
||
class MainApplication : Application(), ReactApplication { | ||
|
||
override val reactNativeHost: ReactNativeHost = | ||
object : DefaultReactNativeHost(this) { | ||
override fun getPackages(): List<ReactPackage> = | ||
PackageList(this).packages.apply { | ||
// Packages that cannot be autolinked yet can be added manually here, for example: | ||
// add(MyReactNativePackage()) | ||
} | ||
|
||
override fun getJSMainModuleName(): String = "index" | ||
|
||
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG | ||
|
||
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED | ||
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED | ||
} | ||
|
||
override val reactHost: ReactHost | ||
get() = getDefaultReactHost(this.applicationContext, reactNativeHost) | ||
|
||
override fun onCreate() { | ||
// something between curly brace and super call | ||
super.onCreate() | ||
SoLoader.init(this, false) | ||
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { | ||
// If you opted-in for the New Architecture, we load the native entry point for this app. | ||
load() | ||
} | ||
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager) | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
packages/react-native-cli/src/lib/__test__/fixtures/MainApplication-before.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,45 @@ | ||
package com.bugsnagreactnativeclitest | ||
|
||
import android.app.Application | ||
import com.facebook.react.PackageList | ||
import com.facebook.react.ReactApplication | ||
import com.facebook.react.ReactHost | ||
import com.facebook.react.ReactNativeHost | ||
import com.facebook.react.ReactPackage | ||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load | ||
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost | ||
import com.facebook.react.defaults.DefaultReactNativeHost | ||
import com.facebook.react.flipper.ReactNativeFlipper | ||
import com.facebook.soloader.SoLoader | ||
|
||
class MainApplication : Application(), ReactApplication { | ||
|
||
override val reactNativeHost: ReactNativeHost = | ||
object : DefaultReactNativeHost(this) { | ||
override fun getPackages(): List<ReactPackage> = | ||
PackageList(this).packages.apply { | ||
// Packages that cannot be autolinked yet can be added manually here, for example: | ||
// add(MyReactNativePackage()) | ||
} | ||
|
||
override fun getJSMainModuleName(): String = "index" | ||
|
||
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG | ||
|
||
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED | ||
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED | ||
} | ||
|
||
override val reactHost: ReactHost | ||
get() = getDefaultReactHost(this.applicationContext, reactNativeHost) | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
SoLoader.init(this, false) | ||
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { | ||
// If you opted-in for the New Architecture, we load the native entry point for this app. | ||
load() | ||
} | ||
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager) | ||
} | ||
} |