WIP: Implement native pihelper library
Signed-off-by: William Brawner <me@wbrawner.com>
This commit is contained in:
parent
b6bf045fd0
commit
f01cae55ae
10 changed files with 93 additions and 2 deletions
9
.gitmodules
vendored
Normal file
9
.gitmodules
vendored
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
[submodule "libpihelper/src/main/c/libpihelper"]
|
||||||
|
path = libpihelper/src/main/c/libpihelper
|
||||||
|
url = git@git.wbrawner.com:/pub/git/Pi-Helper/pihelper.git
|
||||||
|
[submodule "libpihelper/src/main/c/curl"]
|
||||||
|
path = libpihelper/src/main/c/curl
|
||||||
|
url = https://github.com/curl/curl
|
||||||
|
[submodule "libpihelper/src/main/c/openssl"]
|
||||||
|
path = libpihelper/src/main/c/openssl
|
||||||
|
url = https://github.com/openssl/openssl
|
1
libpihelper/.gitignore
vendored
Normal file
1
libpihelper/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
/build
|
43
libpihelper/build.gradle
Normal file
43
libpihelper/build.gradle
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
apply plugin: 'com.android.library'
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 29
|
||||||
|
defaultConfig {
|
||||||
|
minSdkVersion 23
|
||||||
|
targetSdkVersion 29
|
||||||
|
versionCode 1
|
||||||
|
versionName "1.0"
|
||||||
|
|
||||||
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
consumerProguardFiles 'consumer-rules.pro'
|
||||||
|
|
||||||
|
externalNativeBuild {
|
||||||
|
cmake {
|
||||||
|
cppFlags ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
externalNativeBuild {
|
||||||
|
cmake {
|
||||||
|
path "src/main/c/CMakeLists.txt"
|
||||||
|
version "3.10.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
}
|
5
libpihelper/src/main/AndroidManifest.xml
Normal file
5
libpihelper/src/main/AndroidManifest.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.wbrawner.libpihelper">
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<application android:usesCleartextTraffic="true" />
|
||||||
|
</manifest>
|
27
libpihelper/src/main/c/CMakeLists.txt
Normal file
27
libpihelper/src/main/c/CMakeLists.txt
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
# Set the minimum required version for cmake
|
||||||
|
cmake_minimum_required(VERSION 3.4.1)
|
||||||
|
|
||||||
|
|
||||||
|
set(PIHELPER_STATIC off CACHE BOOL "")
|
||||||
|
set(PIHELPER_SHARED on CACHE BOOL "")
|
||||||
|
|
||||||
|
add_subdirectory(libpihelper)
|
||||||
|
|
||||||
|
add_library(
|
||||||
|
pihelper
|
||||||
|
SHARED
|
||||||
|
pihelper-android.c
|
||||||
|
)
|
||||||
|
|
||||||
|
# Include the Android logging library for native code
|
||||||
|
find_library(
|
||||||
|
log-lib
|
||||||
|
log
|
||||||
|
)
|
||||||
|
|
||||||
|
# Link our library with the Android logging library
|
||||||
|
target_link_libraries(
|
||||||
|
pihelper
|
||||||
|
${log-lib}
|
||||||
|
libpihelpershared
|
||||||
|
)
|
1
libpihelper/src/main/c/libpihelper
Submodule
1
libpihelper/src/main/c/libpihelper
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 7e599ee5f180c0526914686826fa64b4403f09d2
|
0
libpihelper/src/main/c/pihelper-android.c
Normal file
0
libpihelper/src/main/c/pihelper-android.c
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
package com.wbrawner.libpihelper;
|
||||||
|
|
||||||
|
public class PiHelperNative {
|
||||||
|
}
|
|
@ -27,7 +27,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation project(':libpihelper')
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
|
||||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
include ':app', ':piholeclient'
|
include ':app', ':piholeclient', ':libpihelper'
|
||||||
rootProject.name='Pi-helper'
|
rootProject.name='Pi-helper'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue