Skip to content

Conversation

@dratwas
Copy link
Contributor

@dratwas dratwas commented Jul 12, 2019

Summary:

Regex that is used for finding class name of ReactPackage doesn't support custom formatting and implementation of more than one interface

Current regex doesn't work for code like this:

class ReactNativeSamplePackage: ReactPackage {
}

because there is no whitespace between ReactNativeSamplePackage and :
Module is not linked also when package class implements other interface before ReactPackage one

class ReactNativeSamplePackage: SomeInterface, NextInterface, ReactPackage {
}

Test Plan:

Green tests
Try autolink module with package class like below

class ReactNativePackage
    : 
  ReactPackage {
    override fun createViewManagers(reactContext: ReactApplicationContext): MutableList<ViewManager<View, ReactShadowNode<*>>> {
        return Collections.emptyList()
    }

    override fun createNativeModules(reactContext: ReactApplicationContext): MutableList<NativeModule> {
        return Collections.emptyList()
    }
}

Copy link
Member

@thymikee thymikee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@thymikee thymikee changed the title fix: Android findClassName regex fix: finding package class name regex on Android Jul 12, 2019
@thymikee thymikee changed the title fix: finding package class name regex on Android fix: better package class name regex on Android Jul 12, 2019
@thymikee thymikee merged commit 074e742 into react-native-community:master Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants