2

Native boilerplate for Vision Camera plugins

 2 years ago
source link: https://reactnativeexample.com/native-boilerplate-for-vision-camera-plugins/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Vision Camera Plugin Builder

Vision Camera Plugin Builder logo

Create Vision Camera plugin native boilerplate in a few seconds

🤔 How it works

Gif with how Vision Camera Plugin Builder works

Library use case

For vision-camera-<pluginName>, it generates:

  • Android – inside Android source set:
    ├── android/src/main/<packageName>
    │   ├── <pluginName>
    │   ├──   ├── <pluginName>Plugin.(java|kt)
    │   ├── <pluginName>PluginPackage.(java|kt)
    
  • iOS – inside iOS library’s source code folder:
    ├── ios
    │   ├── <pluginName>
    │   ├──   ├── <pluginName>Plugin.(m|mm)
    │   ├──   ├── <pluginName>Plugin.Swift (if Swift selected)
    │   ├── <projectName>-Bridging-Header.h (if Swift selected & no bridging header specified)
    

Application use case

For local usage inside application, it generates:

  • Android – inside Android source set:
    ├── android/src/main/<packageName>
    │   ├── <pluginName>
    │   ├──   ├── <pluginName>Plugin.(java|kt)
    │   ├──   ├── <pluginName>PluginPackage.(java|kt)
    
  • iOS – inside iOS library’s source code folder:
    ├── ios
    │   ├── <pluginName>
    │   ├──   ├── <pluginName>Plugin.(m|mm)
    │   ├──   ├── <pluginName>Plugin.Swift (if Swift selected)
    │   ├── <projectName>-Bridging-Header.h (if Swift selected & no bridging header specified)
    

🚀 Usage

⚠️ To generate ios boilerplate, you must first install xcodeproj gem

npx vision-camera-plugin-builder ios
npx vision-camera-plugin-builder android

After generating native files, cli will output additional info like suggested JS setup, or Android package manual linking info

⚙️ Options

Flag Input Description
–projectPath (iOS only) [string] Path to .xcodeproj file
–manifestPath (Android only) [string] Path to project’s Android Manifest file
–pluginName [string] Name of the plugin
–methodName [string] Name of plugin’s exported method
–lang [choices] “Kotlin” or “Java” for Android & “Swift” or “ObjC” or “ObjCPP” for iOS

License

GitHub

View Github


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK