Skip to content

Commit c48976f

Browse files
author
Patrick Boos
committed
Move native code into library
1 parent 233d3b8 commit c48976f

File tree

9 files changed

+33
-68
lines changed

9 files changed

+33
-68
lines changed

native/jni/Android.mk renamed to library/jni/Android.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ LOCAL_PATH := $(call my-dir)
1616

1717
include $(CLEAR_VARS)
1818

19-
LOCAL_MODULE := gpuimage-native
19+
LOCAL_MODULE := gpuimage-library
2020
LOCAL_SRC_FILES := yuv-decoder.c
2121
LOCAL_LDLIBS := -llog
2222

File renamed without changes.

library/pom.xml

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,39 @@
2222
<version>${android.version}</version>
2323
<scope>provided</scope>
2424
</dependency>
25-
26-
<!-- Pull in the dependency on the native library already compiled in the native-code module -->
27-
<dependency>
28-
<groupId>${project.groupId}</groupId>
29-
<artifactId>gpuimage-native</artifactId>
30-
<version>${project.version}</version>
31-
<classifier>armeabi</classifier>
32-
<type>so</type>
33-
</dependency>
3425
</dependencies>
3526

3627
<build>
3728
<plugins>
3829
<plugin>
39-
<artifactId>maven-clean-plugin</artifactId>
40-
<version>2.5</version>
41-
<configuration>
42-
<filesets>
43-
<fileset>
44-
<directory>libs/armeabi</directory>
45-
<followSymlinks>false</followSymlinks>
46-
</fileset>
47-
</filesets>
48-
</configuration>
30+
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
31+
<artifactId>android-maven-plugin</artifactId>
32+
<executions>
33+
<!--
34+
Add the execution of the ndk-build goal - this will compile the native code in addition
35+
to building the Java & APK
36+
-->
37+
<execution>
38+
<goals>
39+
<goal>ndk-build</goal>
40+
</goals>
41+
<configuration>
42+
<!--
43+
Configure the plugin to remove all built artifacts from the libs/armeabi folder
44+
when the native build is complete
45+
-->
46+
<clearNativeArtifacts>false</clearNativeArtifacts>
47+
<!--
48+
Configure the plugin to also attach the built, native, artifact from the libs/armeabi folder
49+
when the native build is complete. This puts the artifact into the Maven repository
50+
-->
51+
<attachNativeArtifacts>true</attachNativeArtifacts>
52+
<target>gpuimage-library</target>
53+
</configuration>
54+
</execution>
55+
</executions>
56+
<extensions>true</extensions>
57+
4958
</plugin>
5059
<plugin>
5160
<groupId>com.jayway.maven.plugins.android.generation2</groupId>

library/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
</resources>

library/src/jp/co/cyberagent/android/gpuimage/OpenGlUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class OpenGlUtils {
2929
public static final int NO_TEXTURE = -1;
3030

3131
static {
32-
System.loadLibrary("gpuimage-native");
32+
System.loadLibrary("gpuimage-library");
3333
}
3434

3535
public static int loadTexture(final Bitmap img, final int usedTexId) {

native/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

native/pom.xml

Lines changed: 0 additions & 43 deletions
This file was deleted.

pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
<url>https://github.com/cyberagent-jp/android-gpuimage/</url>
2121

2222
<modules>
23-
<module>native</module>
2423
<module>library</module>
2524
<module>sample</module>
2625
</modules>

0 commit comments

Comments
 (0)