Merge pull request #17 from SDLash3D/improve_build

Improve build
This commit is contained in:
Alibek Omarov 2015-08-24 00:55:00 +06:00
commit b0140727cc
10 changed files with 96 additions and 6 deletions

1
.gitignore vendored
View file

@ -12,3 +12,4 @@ jni/src/MobileTouchControls/MobileTouchControls
local.properties
res/values/git-rev.xml

View file

@ -24,7 +24,21 @@ before_install:
- git clone -q --depth=1 https://github.com/mittorn/SDL-mirror jni/src/SDL2/SDL-mirror
- sed -i -- s/android-8/android-15/g project.properties
script:
- ndk-build NDK_TOOLCHAIN_VERSION=4.8 XASH_SDL=1 SUPPORT_WEBP=false -j2 APP_CFLAGS="-w"
- sh gen-version.sh travis build
- ndk-build NDK_TOOLCHAIN_VERSION=4.8 XASH_SDL=1 SUPPORT_WEBP=false -j2 APP_CFLAGS="-w" APP_ABI="armeabi-v7a-hard"
- ant debug
- cp bin/xashdroid-debug.apk xashdroid-armv7.apk
- ndk-build NDK_TOOLCHAIN_VERSION=4.8 XASH_SDL=1 SUPPORT_WEBP=false -j2 APP_CFLAGS="-w" APP_ABI="armeabi"
- ant debug
- cp bin/xashdroid-debug.apk xashdroid-armv6.apk
- ndk-build NDK_TOOLCHAIN_VERSION=4.8 XASH_SDL=1 SUPPORT_WEBP=false -j2 APP_CFLAGS="-w" APP_ABI="x86"
- ant debug
- cp bin/xashdroid-debug.apk xashdroid-x86.apk
after_script:
- curl -T bin/xashdroid-debug.apk -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/xashdroid-`date +%d-%m-%y`-`git rev-parse --short HEAD`.apk
- curl --upload-file xashdroid-armv7.apk https://transfer.sh/xash3d-armv7-`date -u +%y-%m-%d_%H-%M`.apk
- curl --upload-file xashdroid-armv6.apk https://transfer.sh/xash3d-armv6-`date -u +%y-%m-%d_%H-%M`.apk
- curl --upload-file xashdroid-x86.apk https://transfer.sh/xash3d-x86-`date -u +%y-%m-%d_%H-%M`.apk
- curl -T xashdroid-armv7.apk -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/xashdroid-armv7-`date -u +%y-%m-%d_%H-%M`-`git rev-parse --short HEAD`.apk
- curl -T xashdroid-armv6.apk -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/xashdroid-armv6-`date -u +%y-%m-%d_%H-%M`-`git rev-parse --short HEAD`.apk
- curl -T xashdroid-x86.apk -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/xashdroid-x86-`date -u +%y-%m-%d_%H-%M`-`git rev-parse --short HEAD`.apk

View file

@ -4,6 +4,7 @@ DX=./../dx
APKBUILDER=./../apkbuilder
mkdir gen
mkdir bin
sh gen-version.sh test build
$AAPT package -m -J gen/ --rename-manifest-package in.celest.xash3d.hl -M AndroidManifest.xml -S test/res -I $ANDROID_JAR
$JAVA_HOME/bin/javac -d bin/classes -s bin/classes -cp $ANDROID_JAR:libs/com.bda.controller.jar src/org/libsdl/app/SDLActivity.java src/com/beloko/games/hl/NativeLib.java src/com/beloko/touchcontrols/* gen/in/celest/xash3d/hl/R.java src/in/celest/xash3d/*
$DX --dex --output=bin/classes.dex bin/classes/ libs/com.bda.controller.jar

View file

@ -1,6 +1,7 @@
#!/bin/sh
ndk-build NDK_TOOLCHAIN_VERSION=4.8 NDK_DEBUG=0 SUPPORT_WEBP=false V=1
sh gen-version.sh default-release
ant release
#jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../myks.keystore bin/xashdroid-release-unsigned.apk xashdroid
#adb install -r -f bin/xashdroid-debug.apk

View file

@ -1,6 +1,7 @@
#!/bin/sh
ndk-build NDK_TOOLCHAIN_VERSION=4.8 NDK_DEBUG=1 SUPPORT_WEBP=false V=1 -j3 APP_CFLAGS="-gdwarf-3"
sh gen-version.sh default-debug
ant debug
#jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../myks.keystore bin/xashdroid-release-unsigned.apk xashdroid -storepass 529459
adb install -r -f bin/xashdroid-debug.apk

17
gen-version.sh Executable file
View file

@ -0,0 +1,17 @@
git update-index --assume-unchanged res/values/git-rev.xml
echo '<?xml version="1.0" encoding="utf-8"?>' > res/values/git-rev.xml
echo '<resources>' >> res/values/git-rev.xml
echo -n '<string name="git_revisions">' >> res/values/git-rev.xml
echo -n '<b>Version information:</b> ' $*_endl| sed -e s/_endl/'\\n'/ >> res/values/git-rev.xml
echo -n '<b>android:</b>' $(git log --abbrev-commit --pretty=oneline -1) _endl\
'<b>engine:</b>' $(cd jni/src/Xash3D/*/;git log --abbrev-commit --pretty=oneline -1) _endl\
'<b>client:</b>' $(cd jni/src/XashXT/*/;git log --abbrev-commit --pretty=oneline -1) _endl\
'<b>halflife:</b>' $(cd jni/src/HLSDK/*/;git log --abbrev-commit --pretty=oneline -1) _endl\
'<b>SDL2:</b>' $(cd jni/src/SDL2/*/;git log --abbrev-commit --pretty=oneline -1) _endl\
'<b>TouchControls:</b>' $(cd jni/src/MobileTouchControls/*/;git log --abbrev-commit --pretty=oneline -1) _endl\
'<b>nanogl:</b>' $(cd jni/src/NanoGL/*/;git log --abbrev-commit --pretty=oneline -1)_endl\
| sed -e s/\'//g -e s/_endl/'\\n'/g >> res/values/git-rev.xml
echo -n $USER@$(hostname) $(date +%H:%M:%S-%d-%m-%y) >> res/values/git-rev.xml
echo '</string>' >> res/values/git-rev.xml
echo '</resources>' >> res/values/git-rev.xml
cat res/values/git-rev.xml

View file

@ -1 +1,37 @@
# override some setup.mk defines
override TARGET_arm_release_CFLAGS :=
override TARGET_thumb_release_CFLAGS :=
override TARGET_arm_debug_CFLAGS :=
override TARGET_thumb_debug_CFLAGS :=
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a-hard)
override TARGET_CFLAGS := $(CFLAGS_OPT) $(CFLAGS_OPT_ARM) $(CFLAGS_HARDFP)
endif
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
override TARGET_CFLAGS := $(CFLAGS_OPT) $(CFLAGS_OPT_ARM)
endif
ifeq ($(TARGET_ARCH_ABI),armeabi)
override TARGET_CFLAGS := $(CFLAGS_OPT) $(CFLAGS_OPT_ARMv5)
endif
ifeq ($(TARGET_ARCH_ABI),x86)
override TARGET_CFLAGS := $(CFLAGS_OPT) $(CFLAGS_OPT_X86)
endif
# Compatibility trick, don't need all projects to be updated
CFLAGS_OPT :=
CFLAGS_OPT_ARM :=
CFLAGS_OPT_ARMv5 :=
CFLAGS_OPT_X86 :=
CFLAGS_HARDFP :=
include $(call all-subdir-makefiles)

View file

@ -14,9 +14,9 @@ endif
CFLAGS_OPT := -O3 -fomit-frame-pointer -ggdb -funsafe-math-optimizations -ftree-vectorize -fgraphite-identity -floop-interchange -funsafe-loop-optimizations -finline-limit=1024
CFLAGS_OPT_ARM := -mthumb -mfpu=neon -mcpu=cortex-a9 -pipe -mvectorize-with-neon-quad -DVECTORIZE_SINCOS
CFLAGS_OPT_ARMv5 := -msoft-float -marm -pipe
CFLAGS_OPT_ARMv5 :=-mcpu=arm1136j-s -mfpu=vfp -marm -pipe
CFLAGS_OPT_X86 := -mtune=atom -march=atom -mssse3 -mfpmath=sse -funroll-loops -pipe -DVECTORIZE_SINCOS
CFLAGS_HARDFP := -D_NDK_MATH_NO_SOFTFP=1 -mhard-float -mfloat-abi=hard -DLOAD_HARDFP -DSOFTFP_LINK
APPLICATIONMK_PATH = $(call my-dir)
ifeq ($(EMILE),1)

View file

@ -34,17 +34,31 @@
<TextView
android:layout_width="match_parent"
android:layout_height="225dp"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/about_authors"
android:id="@+id/textView4"
android:layout_weight="3.46"
android:layout_weight="1"
android:clickable="false"
android:enabled="true"
android:singleLine="false"
android:password="false"
android:longClickable="false"
android:autoText="false" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/git_revisions"
android:id="@+id/textView5"
android:autoText="false"
android:longClickable="false"
android:password="false"
android:enabled="true"
android:clickable="false"
android:singleLine="false"
/>
<TextView
android:layout_width="wrap_content"
@ -68,6 +82,7 @@
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/about_copyright"
android:singleLine="false"
android:id="@+id/textView2"
android:layout_weight="0.58" />

4
res/values/git-rev.xml Normal file
View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="git_revisions">No git version information</string>
</resources>