diff --git a/.gitignore b/.gitignore index c3740ad..74e3654 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ gradle.properties *.apk *.ap_ *.jar +.externalNativeBuild # files for the dex VM *.dex diff --git a/JniBitmapOperationsLibrary/build.gradle b/JniBitmapOperationsLibrary/build.gradle index dc7bb5f..c9e4b3c 100644 --- a/JniBitmapOperationsLibrary/build.gradle +++ b/JniBitmapOperationsLibrary/build.gradle @@ -27,7 +27,11 @@ android { } } - + externalNativeBuild { + ndkBuild { + path 'jni/Android.mk' + } + } /* task buildNative(type: Exec, description: 'Compile JNI source via NDK') { diff --git a/README.md b/README.md index e6fcabe..253292f 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,29 @@ Just import the whole cloned project and run the sample. #### Further configuring and using as the library +#### Option 1 + 1. Add this repository as a git submodule. For these instructions we added in a folder named `AndroidJniBitmapOperations` + 2. Add the following lines to your `settings.gradle` file + + ``` + include ':JniBitmapOperationsLibrary' + project(':JniBitmapOperationsLibrary').projectDir = new File(settingsDir, '../AndroidJniBitmapOperations/JniBitmapOperationsLibrary') + ``` + 3. Add the following lines to your top level `build.gradle` file inside the `buildscript` section. Replace the versions with whatever your project is using as needed. + + ``` + // Variables for JniBitmapOperationsLibrary + ext.propCompileSdkVersion = 23 + ext.propBuildToolsVersion = "27.0.3" + ``` + 4. Add the following lines to your app `build.gradle` file inside the `dependancies` section + + ``` + implementation project(':JniBitmapOperationsLibrary') + ``` + +#### Option 2 + 1. Copy `JniBitmapOperationsLibrary.cpp` into `src/main/jni` directory: ![Studio folder structure](https://s3.amazonaws.com/uploads.hipchat.com/22412/120721/qZyoFrgpUnFmnHu/upload.png) diff --git a/build.gradle b/build.gradle index b181f5f..e09bc95 100644 --- a/build.gradle +++ b/build.gradle @@ -7,9 +7,10 @@ buildscript { repositories { mavenCentral() + google() } dependencies { - classpath 'com.android.tools.build:gradle:1.2.3' + classpath 'com.android.tools.build:gradle:3.1.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files