Skip to content

Commit

Permalink
splitted modules for #173 begin
Browse files Browse the repository at this point in the history
  • Loading branch information
koral-- committed Jun 9, 2015
1 parent 9a75db3 commit 5edbb89
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 14 deletions.
53 changes: 39 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,26 @@ android {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
sourceSets.main {
jniLibs.srcDir 'src/main/libs' //set .so files location to libs
jni.srcDirs = [] //disable automatic ndk-build call
}

task buildNative(type: Exec) {
def ndkDir = android.ndkDirectory
commandLine "$ndkDir/ndk-build",
'-C', file('src/main/jni').absolutePath,
'-j', Runtime.runtime.availableProcessors(),
'all',
'NDK_DEBUG=1'
}

task cleanNative(type: Exec) {
def ndkDir = android.ndkDirectory
commandLine "$ndkDir/ndk-build",
'-C', file('src/main/jni').absolutePath,
'clean'
}
defaultConfig {
minSdkVersion 8
targetSdkVersion 22
Expand All @@ -36,21 +56,26 @@ android {
}
}
}
buildTypes.debug.jniDebuggable isDebugBuild()
// buildTypes.debug.jniDebuggable isDebugBuild()
//
// if (shouldApplyFlavors()) {
// productFlavors {
// flavors.each() {
// String flavor = it
// "${it}" {
// ndk {
// abiFilter flavor
// }
// }
// }
// fat
// }
// }
}
clean.dependsOn cleanNative

if (shouldApplyFlavors()) {
productFlavors {
flavors.each() {
String flavor = it
"${it}" {
ndk {
abiFilter flavor
}
}
}
fat
}
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn buildNative
}

allprojects {
Expand Down
39 changes: 39 additions & 0 deletions src/main/jni/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE := pl_droidsonroids_gif
LOCAL_CFLAGS := -Ofast -DDEBUG
LOCAL_LDLIBS := \
-ljnigraphics \
-llog \

LOCAL_SRC_FILES := \
drawing.c \
gif.c \
metadata.c \
memset32_neon.S \
bitmap.c \
open_close.c \
decoding.c \
exception.c \
time.c \
control.c \
memset.arm.S \
giflib/dgif_lib.c \
giflib/gifalloc.c \


include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)

LOCAL_MODULE := pl_droidsonroids_gif_surface
LOCAL_CFLAGS := -Ofast -DDEBUG
LOCAL_LDLIBS := \
-landroid \
-llog \

LOCAL_SRC_FILES := \
surface.c \

include $(BUILD_SHARED_LIBRARY)
5 changes: 5 additions & 0 deletions src/main/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
APP_ABI := all
APP_PLATFORM := android-21
APP_OPTIM := debug

#NDK_TOOLCHAIN_VERSION := clang

0 comments on commit 5edbb89

Please sign in to comment.