
9 changed files with 228 additions and 7 deletions
@ -0,0 +1,2 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest package="org.pEp.jniadapter" /> |
@ -0,0 +1,109 @@ |
|||
// Android pEp JNI adapter Aar gradle build script |
|||
|
|||
import org.apache.tools.ant.taskdefs.condition.Os |
|||
|
|||
buildscript { |
|||
repositories { |
|||
jcenter() |
|||
} |
|||
dependencies { |
|||
classpath 'com.android.tools.build:gradle:1.1.0' |
|||
} |
|||
} |
|||
|
|||
apply plugin: 'com.android.library' |
|||
|
|||
android { |
|||
compileSdkVersion 21 |
|||
buildToolsVersion "21.1.2" |
|||
|
|||
defaultConfig { |
|||
minSdkVersion 15 |
|||
targetSdkVersion 21 |
|||
versionCode 1 |
|||
versionName "1.0" |
|||
} |
|||
|
|||
sourceSets { |
|||
main { |
|||
|
|||
manifest.srcFile 'AndroidManifest.xml' |
|||
|
|||
// where to find generated Java source |
|||
java.srcDirs = ['../src'] |
|||
|
|||
// disable automatic ndk-build call, which ignore our Android.mk |
|||
jni.srcDirs = [] |
|||
jniLibs.srcDir 'src/main/libs' |
|||
|
|||
} |
|||
} |
|||
|
|||
lintOptions { |
|||
abortOnError false |
|||
} |
|||
|
|||
buildTypes { |
|||
release { |
|||
minifyEnabled false |
|||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
|||
} |
|||
} |
|||
|
|||
// call source generation makefile target |
|||
task genSources(type:Exec) { |
|||
workingDir '../src' |
|||
commandLine 'make', 'gensource' |
|||
} |
|||
|
|||
// unzip some of the dependencies |
|||
task unzipDeps(type: Copy) { |
|||
from zipTree(file('../../pEpEngine/android/pEpEngine-android-1.zip')) |
|||
from zipTree(file('../../libetpan/build-android/libetpan-android-1.zip')) |
|||
from zipTree(file('../../libetpan/build-android/dependencies/openssl/openssl-android-1.zip')) |
|||
from zipTree(file('../../libetpan/build-android/dependencies/cyrus-sasl/cyrus-sasl-android-1.zip')) |
|||
into file("${buildDir}") |
|||
} |
|||
|
|||
// call regular ndk-build(.cmd) script from app directory |
|||
task jniBuild(type: Exec) { |
|||
commandLine getNdkBuildCmd(), 'V=1' |
|||
} |
|||
jniBuild.dependsOn genSources |
|||
jniBuild.dependsOn unzipDeps |
|||
|
|||
// Ensure this is done before java build |
|||
tasks.withType(JavaCompile) { |
|||
compileTask -> compileTask.dependsOn jniBuild |
|||
} |
|||
|
|||
task cleanNative(type: Exec) { |
|||
commandLine getNdkBuildCmd(), 'clean' |
|||
} |
|||
|
|||
clean.dependsOn cleanNative |
|||
|
|||
} |
|||
|
|||
def getNdkDir() { |
|||
if (System.env.ANDROID_NDK_ROOT != null) |
|||
return System.env.ANDROID_NDK_ROOT |
|||
|
|||
Properties properties = new Properties() |
|||
properties.load(project.rootProject.file('local.properties').newDataInputStream()) |
|||
def ndkdir = properties.getProperty('ndk.dir', null) |
|||
if (ndkdir == null) |
|||
throw new GradleException("NDK location not found. Define location with ndk.dir in the local.properties file or with an ANDROID_NDK_ROOT environment variable.") |
|||
|
|||
return ndkdir |
|||
} |
|||
|
|||
def getNdkBuildCmd() { |
|||
def ndkbuild = getNdkDir() + "/ndk-build" |
|||
if (Os.isFamily(Os.FAMILY_WINDOWS)) |
|||
ndkbuild += ".cmd" |
|||
|
|||
return ndkbuild |
|||
} |
|||
|
|||
|
@ -0,0 +1,86 @@ |
|||
LOCAL_PATH:= $(call my-dir) |
|||
|
|||
GPGEXT := ../../../gnupg-for-android/external |
|||
GPGROOT := data/data/info.guardianproject.gpg/app_opt |
|||
GPGBUILD := $(GPGEXT)/$(GPGROOT) |
|||
|
|||
|
|||
include $(CLEAR_VARS) |
|||
LOCAL_MODULE := libassuan |
|||
LOCAL_SRC_FILES := $(GPGBUILD)/lib/libassuan.so |
|||
include $(PREBUILT_SHARED_LIBRARY) |
|||
|
|||
include $(CLEAR_VARS) |
|||
LOCAL_MODULE := libcurl |
|||
LOCAL_SRC_FILES := $(GPGBUILD)/lib/libcurl.so |
|||
include $(PREBUILT_SHARED_LIBRARY) |
|||
|
|||
include $(CLEAR_VARS) |
|||
LOCAL_MODULE := libgcrypt |
|||
LOCAL_SRC_FILES := $(GPGBUILD)/lib/libgcrypt.so |
|||
include $(PREBUILT_SHARED_LIBRARY) |
|||
|
|||
include $(CLEAR_VARS) |
|||
LOCAL_MODULE := libgpg-error |
|||
LOCAL_SRC_FILES := $(GPGBUILD)/lib/libgpg-error.so |
|||
include $(PREBUILT_SHARED_LIBRARY) |
|||
|
|||
include $(CLEAR_VARS) |
|||
LOCAL_MODULE := libgpgme |
|||
LOCAL_SRC_FILES := $(GPGBUILD)/lib/libgpgme.so |
|||
LOCAL_EXPORT_C_INCLUDES := $(GPGEXT)/$(GPGROOT)/include $(GPGEXT)/gpgme/src |
|||
include $(PREBUILT_SHARED_LIBRARY) |
|||
|
|||
include $(CLEAR_VARS) |
|||
LOCAL_MODULE := libksba |
|||
LOCAL_SRC_FILES := $(GPGBUILD)/lib/libksba.so |
|||
include $(PREBUILT_SHARED_LIBRARY) |
|||
|
|||
include $(CLEAR_VARS) |
|||
LOCAL_MODULE := libnpth |
|||
LOCAL_SRC_FILES := $(GPGBUILD)/lib/libnpth.so |
|||
include $(PREBUILT_SHARED_LIBRARY) |
|||
|
|||
include $(CLEAR_VARS) |
|||
LOCAL_MODULE := openssl |
|||
LOCAL_SRC_FILES := ../build/openssl-android-1/libs/$(TARGET_ARCH_ABI)/libcrypto.a |
|||
#\
|
|||
# ../build/openssl-android-1/libs/$(TARGET_ARCH_ABI)/libssl.a
|
|||
LOCAL_EXPORT_C_INCLUDES := build/openssl-android-1/include |
|||
include $(PREBUILT_STATIC_LIBRARY) |
|||
|
|||
include $(CLEAR_VARS) |
|||
LOCAL_MODULE := cyrus-sasl |
|||
LOCAL_SRC_FILES := ../build/cyrus-sasl-android-1/libs/$(TARGET_ARCH_ABI)/libsasl2.a |
|||
LOCAL_EXPORT_C_INCLUDES := build/cyrus-sasl-android-1/include |
|||
include $(PREBUILT_STATIC_LIBRARY) |
|||
|
|||
include $(CLEAR_VARS) |
|||
LOCAL_MODULE := libetpan |
|||
LOCAL_SRC_FILES := ../build/libetpan-android-1/libs/$(TARGET_ARCH_ABI)/libetpan.a |
|||
LOCAL_EXPORT_C_INCLUDES := build/libetpan-android-1/include |
|||
include $(PREBUILT_STATIC_LIBRARY) |
|||
|
|||
include $(CLEAR_VARS) |
|||
LOCAL_MODULE := pEpEngine |
|||
LOCAL_SRC_FILES := ../build/pEpEngine-android-1/libs/$(TARGET_ARCH_ABI)/libpEpEngine.a |
|||
LOCAL_EXPORT_C_INCLUDES := build/pEpEngine-android-1/include |
|||
include $(PREBUILT_STATIC_LIBRARY) |
|||
|
|||
include $(CLEAR_VARS) |
|||
LOCAL_MODULE := pEpJNIAdapter |
|||
LOCAL_SHARED_LIBRARIES := libgpgme |
|||
LOCAL_STATIC_LIBRARIES := openssl cyrus-sasl libetpan pEpEngine |
|||
LOCAL_CPP_FEATURES += exceptions |
|||
LOCAL_SRC_FILES := \
|
|||
../../src/org_pEp_jniadapter_Engine.cc \
|
|||
../../src/org_pEp_jniadapter_Message.cc \
|
|||
../../src/throw_pEp_exception.cc \
|
|||
../../src/jniutils.cc |
|||
|
|||
LOCAL_C_INCLUDES := ../src |
|||
|
|||
|
|||
include $(BUILD_SHARED_LIBRARY) |
|||
|
|||
|
@ -0,0 +1 @@ |
|||
APP_STL := stlport_static |
@ -0,0 +1,8 @@ |
|||
## This file must *NOT* be checked into Version Control Systems, |
|||
# as it contains information specific to your local configuration. |
|||
# |
|||
# Location of the SDK. This is only used by Gradle. |
|||
# |
|||
#Wed Apr 15 10:58:28 EDT 2015 |
|||
sdk.dir=/home/pepdev/Android/Sdk |
|||
ndk.dir=/home/pepdev/Android/android-ndk-r10d |
@ -1,3 +1,3 @@ |
|||
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home |
|||
CXXFLAGS=-I$(JAVA_HOME)/include -I/opt/local/include -I$(JAVA_HOME)/include/darwin -I$(HOME)/include |
|||
CLASSPATH=.:$(HOME)/k-9/src |
|||
JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::") |
|||
CXXFLAGS=-I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -I$(HOME)/include |
|||
CLASSPATH=.:$(HOME)/src/k-9/k9mail/src |
|||
|
Loading…
Reference in new issue