Skip to content

Commit 1d10a83

Browse files
committed
Update Gradle for current version
1 parent 26d3b2f commit 1d10a83

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ gradle.properties
99
*.apk
1010
*.ap_
1111
*.jar
12+
.externalNativeBuild
1213

1314
# files for the dex VM
1415
*.dex

JniBitmapOperationsLibrary/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ android {
2727
}
2828
}
2929

30-
30+
externalNativeBuild {
31+
ndkBuild {
32+
path 'jni/Android.mk'
33+
}
34+
}
3135

3236
/*
3337
task buildNative(type: Exec, description: 'Compile JNI source via NDK') {

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,29 @@ Just import the whole cloned project and run the sample.
8080

8181
#### Further configuring and using as the library
8282

83+
#### Option 1
84+
1. Add this repository as a git submodule. For these instructions we added in a folder named `AndroidJniBitmapOperations`
85+
2. Add the following lines to your `settings.gradle` file
86+
87+
```
88+
include ':JniBitmapOperationsLibrary'
89+
project(':JniBitmapOperationsLibrary').projectDir = new File(settingsDir, '../AndroidJniBitmapOperations/JniBitmapOperationsLibrary')
90+
```
91+
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.
92+
93+
```
94+
// Variables for JniBitmapOperationsLibrary
95+
ext.propCompileSdkVersion = 23
96+
ext.propBuildToolsVersion = "27.0.3"
97+
```
98+
4. Add the following lines to your app `build.gradle` file inside the `dependancies` section
99+
100+
```
101+
implementation project(':JniBitmapOperationsLibrary')
102+
```
103+
104+
#### Option 2
105+
83106
1. Copy `JniBitmapOperationsLibrary.cpp` into `src/main/jni` directory:
84107
85108
![Studio folder structure](https://s3.amazonaws.com/uploads.hipchat.com/22412/120721/qZyoFrgpUnFmnHu/upload.png)

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
buildscript {
88
repositories {
99
mavenCentral()
10+
google()
1011
}
1112
dependencies {
12-
classpath 'com.android.tools.build:gradle:1.2.3'
13+
classpath 'com.android.tools.build:gradle:3.1.2'
1314

1415
// NOTE: Do not place your application dependencies here; they belong
1516
// in the individual module build.gradle files

0 commit comments

Comments
 (0)