0.2.4 • Published 2 years ago

kraken-npbt v0.2.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Native(C/C++) plugin build tool for Kraken

Native(C/C++) plugin build tool is a useful tool when you work with C/C++ and JavaScript source file in Kraken plugin development.

It can generate CMake projects to support the development of Kraken native plugin addons.

Support platforms

  1. macOS

Install

npm install -g kraken-npbt

Requirement

  1. CMake version > 3.2.0
  2. XCode installed
  3. Android SDK Installed at ~/Library/Android/sdk

Usage

To compile your native addon, first go to your kraken plugin directory.

cd your_kraken_plugin

The next step is to generate the appropriate project build files. Use configure for that:

kraken-npbt configure

All configure files will generated at your_kraken_plugin/bridge folder.

Note: kraken-npbt will search all C/C++ source files and JavaScripts files under your_kraken_plugin/bridge folder and manage all deps for you.

when you add new files at your_kraken_plugin/bridge, just re-run kraken-npbt configure to make compile works.

Now you will have a CMakeLists.txt in the your_kraken_plugin/bridge directory. Next, invoke the build command:

kraken-npbt build

Now you have your compiled library file! And your compiled file will automatic copy to the following folders:

  • macOS: your_kraken_plugin/macos/your_plugin.dylib
  • iOS: your_kraken_plugin/ios/your_plugin.dylib
  • android: your_kraken_plugin/android/jniLibs/${ANDROID_ABI}/your_plugin.so

To let your compiled library file will be embedded in your App. Make sure add to following configurations:

macOS:

your_kraken_plugin/macos/your_kraken_plugin.pubspec

  s.vendored_libraries = 'your_kraken_plugin_jsc.dylib'

iOS: your_kraken_plugin/ios/your_kraken_plugin.pubspec

  s.vendored_libraries = 'your_kraken_plugin_jsc.dylib'

Android: your_kraken_plugin/android/build.gradle

android {
    sourceSets {
        main {
            jniLibs.srcDirs = ['jniLibs']
        }
    }
}
0.2.3

2 years ago

0.2.4

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.2.2

2 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.2

3 years ago

0.1.3

3 years ago

0.1.1

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago