NEW: updated the build to publish to local maven repo for flutter purposes, updated docs because I confused myself..arrg
This commit is contained in:
parent
f5fddbe3ee
commit
660af53553
|
@ -3,18 +3,25 @@ DEVELOPER README
|
||||||
================
|
================
|
||||||
|
|
||||||
|
|
||||||
application details
|
Project Details
|
||||||
-------------------
|
---------------
|
||||||
* ./wolfssl-lib
|
* ./wolfssl-lib
|
||||||
- builds source from OEM WolfSSL repository!! =)
|
- builds source from OEM WolfSSL repository!! =)
|
||||||
- only needs to be built once (when you want a new library)
|
- only needs to be built once (when you want a new library)
|
||||||
|
- generates BOTH shared (.so) and static (.a)
|
||||||
|
- static (.a) is really just a zip of all the files compiled staticly
|
||||||
|
|
||||||
* ./wolfssl-jni
|
* ./wolfssl-jni
|
||||||
- JNI for the WolfSSL library
|
- JNI for the WolfSSL library
|
||||||
|
- contains BOTH C and Java files (for JNI to work dummy)
|
||||||
|
- expects "libwolfssl.a" file to link with during cmake compile
|
||||||
|
- example: ./wolfssl-jni/libs/wolfssl-lib/arm64-v8a
|
||||||
|
- OUTPUT: "wolfssl-jni.aar"
|
||||||
|
|
||||||
* ./ccc-jni (default main source code)
|
* ./ccc-jni (default main source code)
|
||||||
- JNI, java connections to the native binaries
|
- TEST: test code only, does nothing more, no C files at this time
|
||||||
- C files
|
- no C files at this time, just java files to test lib
|
||||||
|
- broken!! maybe replace
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
|
@ -12,6 +13,7 @@ buildscript {
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ android {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
// let gradle pack the shared library into apk
|
// let gradle pack the shared library into apk
|
||||||
jniLibs.srcDirs = ['lib/wolfssl-jni']
|
jniLibs.srcDirs = ['nc-libs/wolfssl-jni']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// externalNativeBuild {
|
// externalNativeBuild {
|
||||||
|
|
|
@ -7,4 +7,5 @@ gradle clean
|
||||||
# there is a bug in the cleaner task, we need to blow away this artifact directory too
|
# there is a bug in the cleaner task, we need to blow away this artifact directory too
|
||||||
rm -rf .externalNativeBuild/
|
rm -rf .externalNativeBuild/
|
||||||
# build and copy the libs
|
# build and copy the libs
|
||||||
gradle build copyLibs
|
# copy maven local so that flutter can find the lib (because Goog sucks at engineering)
|
||||||
|
gradle build copyLibs publishToMavenLocal
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
// include this at the top, for shared libraries
|
// include this at the top, for shared libraries
|
||||||
// include ':wolfssl-lib'
|
// include ':wolfssl-lib'
|
||||||
// include ':wolfssl-jni'
|
|
||||||
include ':ccc-jni'
|
// contains Java and C for JNI purposes
|
||||||
|
// will generate a .aar file in ./dist folder
|
||||||
|
include ':wolfssl-jni'
|
||||||
|
|
||||||
|
// broken, was test code, but now we use .aar file
|
||||||
|
// include ':nc-jni'
|
||||||
|
|
|
@ -28,22 +28,44 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// we are going to "publish" to local maven repository
|
||||||
|
apply plugin: 'maven-publish'
|
||||||
|
project.afterEvaluate {
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
library(MavenPublication) {
|
||||||
|
groupId 'io.malloc.ccc'
|
||||||
|
artifactId 'nc-jni'
|
||||||
|
version "1.1"
|
||||||
|
artifact(bundleReleaseAar)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Copies files to the dist/ folder, adds a timestamp
|
// Copies files to the dist/ folder, adds a timestamp
|
||||||
// instead of using a bash script I ventured out to try this file copy in Groovy (Gradle)
|
// instead of using a bash script I ventured out to try this file copy in Groovy (Gradle)
|
||||||
// ...and yay, I was successful =)
|
// ...and yay, I was successful =)
|
||||||
task copyLibs(type: Copy) {
|
task copyLibs(type: Copy) {
|
||||||
def thisDate = new Date().format('yyyyMMdd_HHmmssSSS')
|
def thisDate = new Date().format('yyyyMMdd_HHmmssSSS')
|
||||||
|
def destDir = "dist/wolfssl-jni_${thisDate}"
|
||||||
|
|
||||||
|
// copy the library package
|
||||||
|
from('build/outputs/aar/') {
|
||||||
|
include '**/*.aar'
|
||||||
|
}
|
||||||
from('build/intermediates/cmake/debug/obj/') {
|
from('build/intermediates/cmake/debug/obj/') {
|
||||||
include '**/*.so'
|
include '**/*.so'
|
||||||
into 'debug'
|
into 'libwolfssl-jni/debug/'
|
||||||
}
|
}
|
||||||
from('build/intermediates/cmake/release/obj/') {
|
from('build/intermediates/cmake/release/obj/') {
|
||||||
include '**/*.so'
|
include '**/*.so'
|
||||||
into 'release'
|
into 'libwolfssl-jni/release/'
|
||||||
}
|
|
||||||
into "dist/wolfssl-jni_${thisDate}/"
|
|
||||||
}
|
}
|
||||||
|
into "${destDir}/"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testImplementation 'junit:junit:4.12'
|
testImplementation 'junit:junit:4.12'
|
||||||
|
|
Loading…
Reference in New Issue