Skip to content

Commit 7058f39

Browse files
committed
Merge pull request #25 from Shao-Feng/PIE
Update travis script for building both PIE and non_PIE binary
2 parents 4161663 + 3c61973 commit 7058f39

File tree

5 files changed

+30
-1
lines changed

5 files changed

+30
-1
lines changed

.travis.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,31 @@ before_script:
4343
# build for android
4444
- cd ../tools
4545
- ./install_android_ndk.sh
46+
47+
## build PIE binary
4648
- cd ../android/jni/
49+
- cp ./Android_PIE.mk ./Android.mk
50+
- ../../android-ndk/ndk-build clean
51+
- rm -rf ../libs/*
4752
- ../../android-ndk/ndk-build
4853
- cd ../
4954
# build apk
5055
- gradlew build --stacktrace
51-
- cp -r build/outputs/apk ../dest/android/
56+
- cp -r build/outputs/apk ../dest/android_PIE/
5257
- cd ..
58+
59+
## build non-PIE binary
60+
- cd ./android/jni/
61+
- cp ./Android_non_PIE.mk ./Android.mk
62+
- ../../android-ndk/ndk-build clean
63+
- rm -rf ../libs/*
64+
- ../../android-ndk/ndk-build
65+
- cd ../
66+
# build apk
67+
- gradlew build --stacktrace
68+
- cp -r build/outputs/apk ../dest/android_non_PIE/
69+
- cd ..
70+
5371
script:
5472
- tree dest/
5573
- tar -cvzf testkit-stub.tar.gz ./dest/

android/jni/Android_non_PIE.mk

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
LOCAL_PATH := $(call my-dir)
2+
3+
include $(CLEAR_VARS)
4+
LOCAL_CFLAGS += -fexceptions -frtti
5+
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../include
6+
LOCAL_LDLIBS := -llog
7+
LOCAL_MODULE := testkit-stub
8+
LOCAL_STATIC_LIBRARIES += $(NDK_PATH)/sources/cxx-stl/gnu-libstdc++/4.8/libs/$(TARGET_ARCH_ABI)/libsupc++.a
9+
LOCAL_STATIC_LIBRARIES += $(NDK_PATH)/sources/cxx-stl/gnu-libstdc++/4.8/libs/$(TARGET_ARCH_ABI)/libgnustl_static.a
10+
LOCAL_SRC_FILES := ../../source/comfun.cpp ../../source/httpserver.cpp ../../source/testcase.cpp ../../source/main/main.cpp ../../source/json/json_reader.cpp ../../source/json/json_value.cpp ../../source/json/json_writer.cpp
11+
include $(BUILD_EXECUTABLE)

dest/android_non_PIE/android_dest

Whitespace-only changes.

0 commit comments

Comments
 (0)