0.0.7 • Published 5 months ago

react-native-perspective-document-cropper v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

react-native-perspective-document-cropper

This is a template for Nitro Modules.

Usage

Clone this repo, and change all <<*>> names according to your nitro.json file.

Contributing

Contribute a change to this template to update it for newer React Native versions.

Structure

  • android/: All your android-specific implementations.
    • build.gradle: The gradle build file. This contains four important pieces:
      1. Standard react-native library boilerplate code
      2. Configures Kotlin (apply plugin: 'org.jetbrains.kotlin.android')
      3. Adds all Nitrogen files (apply from: '.../<<androidCxxLibName>>+autolinking.gradle')
      4. Triggers the native C++ build (via CMake/externalNativeBuild)
    • CMakeLists.txt: The CMake build file to build C++ code. This contains four important pieces:
      1. Creates a library called <<androidCxxLibName>> (same as in nitro.json)
      2. Adds all Nitrogen files (include(.../<<androidCxxLibName>>+autolinking.cmake))
      3. Adds all custom C++ files (only HybridTestObjectCpp.cpp)
      4. Adds a cpp-adapter.cpp file, which autolinks all C++ HybridObjects (only HybridTestObjectCpp)
    • src/main/java/com/margelo/nitro/<<androidNamespace>>/: All Kotlin implementations.
      • <<androidCxxLibName>>Package.java: The react-native package. You need this because the react-native CLI only adds libraries if they have a *Package.java file. In here, you can autolink all Kotlin HybridObjects.
  • cpp/: All your cross-platform implementations. (only HybridTestObjectCpp.cpp)
  • ios/: All your iOS-specific implementations.
  • nitrogen/: All files generated by nitrogen. You should commit this folder to git.
  • src/: The TypeScript codebase. This defines all HybridObjects and loads them at runtime.
    • specs/: All HybridObject types. Nitrogen will run on all *.nitro.ts files.
  • nitro.json: The configuration file for nitrogen. This will define all native namespaces, as well as the library name.
  • <<iosModulename>>.podspec(<>.podspec): The iOS podspec build file to build the iOS code. This contains three important pieces:
    1. Specifies the Pod's name. This must be identical to the name specified in nitro.json.
    2. Adds all of your .swift or .cpp files (implementations).
    3. Adds all Nitrogen files (add_nitrogen_files(s))
  • package.json: The npm package.json file. react-native-nitro-modules should be a peerDependency.
0.0.7

5 months ago

0.0.6

5 months ago

0.0.5

6 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago