android: move all sources to android folder, remove ant build system

This commit is contained in:
Alibek Omarov 2019-04-15 23:52:47 +03:00
parent 6d2d7a9d6d
commit 24632c0e69
88 changed files with 0 additions and 501 deletions

View file

@ -1,39 +0,0 @@
Xash3D FWGS Android
====
[![Build Status](https://travis-ci.org/FWGS/xash3d-android-project.svg)](https://travis-ci.org/FWGS/xash3d-android-project)
### Пользователям
#### Инструкция по установке
0. Скачайте APK последней версии со страницы релизов репозитория Xash3D FWGS: https://github.com/FWGS/xash3d/releases/latest
1. Откройте и установите APK.
2. Создайте папку /sdcard/xash.
3. Скопируйте папку "valve" от Steam версии Half-Life в /sdcard/xash/. Пример: /sdcard/xash/valve -- игровые данные
4. Запустите игру
#### Запуск модификаций
**Это приложение позволяет запустить только Half-Life и модификации без собственных игровых библиотек.**
**Любая модификация со своими игровыми библиотеками требует отдельно установленное приложение с портированными на Android игровыми библиотеками.**
Например, если вы захотите запустить Half-Life: C.A.G.E.D.
1. Скопируйте папку caged от Steam-версии Half-Life: C.A.G.E.D. в /sdcard/xash.
2. Откройте Xash3D FWGS и добавьте в аргументы командной строки:
> -game caged
Пример для Half-Life: Blue Shift.
1. Скопируйте папку bshift от Steam-версии Half-Life: Blue Shift в /sdcard/xash/.
2. Установите отдельное приложение [отсюда](https://github.com/nekonomicon/BS-android/releases/latest) и запустите.
Портированные на Android модификации cо своими игровыми библиотеками(точнее приложения для их запуска на Android) вы всегда можете найти в [Play Market](https://play.google.com/store/apps/dev?id=7039367093104802597) и на [ModDB](https://www.moddb.com/games/xash3d-android/downloads)
Для большей информации о работающих модификациях, ознакомьтесь с этим [артиклем](https://github.com/FWGS/xash3d/wiki/List-of-mods-which-work-on-Android-and-other-non-Windows-platforms-without-troubles).
#### Баги
Обо всех багах пишите в "Issues" с логом и системной информацией.
### Разработчикам
+ Для компиляции, запустите `git submodule init && git submodule update --init --recursive`. Иначе у вас будет пустой APK, без библиотек.
+ ~~Мы используем наш SDL2 форк. Посетите https://github.com/mittorn/SDL-mirror~~. Забудьте. Мы больше не используем SDL2.

View file

@ -1,39 +0,0 @@
Xash3D FWGS Android
====
[![Build Status](https://travis-ci.org/FWGS/xash3d-android-project.svg)](https://travis-ci.org/FWGS/xash3d-android-project)
### Users
#### Installation guide
0. Download the APK from Xash3D FWGS repo releases page: https://github.com/FWGS/xash3d/releases/latest
1. Install the APK.
2. Create /sdcard/xash folder.
3. Copy "valve" folder from your Half-Life Steam version to /sdcard/xash/. Example: /sdcard/xash/valve -- game data
4. Run the game.
#### Launching other mods
**This app can run only Half-Life and mods that doesn't have own game libraries.**
**Any mod with own custom game libraries required separate launcher with mod game libraries which was ported on Android.**
For example, if you want to play Half-Life: C.A.G.E.D.
1. Copy caged folder from your steam version of Half-Life: C.A.G.E.D. to /sdcard/xash.
2. Open Xash3D FWGS launcher and write to the command-line args:
> -game caged
Example for Half-Life: Blue Shift.
1. Copy bshift folder from your steam version of Half-Life: Blue Shift to /sdcard/xash.
2. Install separate launcher for Half-Life: Blue Shift from [here](https://github.com/nekonomicon/BS-android/releases/latest) and run.
You can always find mods with own game libraries which was ported on Android( Actually separate launchers with game libraries which was ported on Android ) in [Play Market](https://play.google.com/store/apps/dev?id=7039367093104802597) and [ModDB](https://www.moddb.com/games/xash3d-android/downloads).
For more information about supported mods, see this [article](https://github.com/FWGS/xash3d/wiki/List-of-mods-which-work-on-Android-and-other-non-Windows-platforms-without-troubles).
#### Bugs
About all bugs please write to issues with your device and OS info.
### Developers
+ For compiling, run `git submodule init && git submodule update --init --recursive`. Otherwise you will get an empty APK, without any libraries.
+ ~~We use our SDL2 fork. See https://github.com/mittorn/SDL-mirror~~. Nevermind. We don't use SDL2 anymore.

View file

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View file

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

View file

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View file

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View file

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View file

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

View file

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View file

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View file

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View file

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View file

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View file

@ -1,17 +0,0 @@
# This file is used to override default values used by the Ant build system.
#
# This file must be checked into Version Control Systems, as it is
# integral to the build system of your project.
# This file is only used by the Ant script.
# You can use this to override default values such as
# 'source.dir' for the location of your java source folder and
# 'out.dir' for the location of your output folder.
# You can also use it define how the release builds are signed by declaring
# the following properties:
# 'key.store' for the location of your keystore and
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.

61
build
View file

@ -1,61 +0,0 @@
#!/bin/bash
PROJECT="xashdroid"
KEYSTORE="../myks.keystore"
KEYSTORE_ALIAS="xashdroid"
ANDROID_SDK_PATH="$HOME/.android"
BUILD_TOOLS_VER="28.0.3"
if [[ "$1" = "--help" ]]; then
echo "Usage: ./build.sh <release|debug>"
exit 0
fi
if [[ "$#" -ne "1" ]]; then
echo "Illegal number of parameters, see ./build.sh --help"
exit 0
fi
if [[ "$1" = "release" ]]; then
NDK_BUILD_FLAGS="V=0 NDK_DEBUG=0"
CONFIG="release"
SIGN="sign"
else
NDK_BUILD_FLAGS="V=1 APP_CFLAGS=\"-gdwarf-3\" NDK_DEBUG=1"
CONFIG="debug"
SIGN=""
fi
echo "*****************************************"
echo "* RELEASETYPE: $RELEASE "
echo "*****************************************"
set -x
# Generate config
./gen-config.sh $CONFIG $SIGN
./gen-version.sh default-$CONFIG
# Regenerate PAK file
rm assets/extras.pak 2>/dev/null
python2 makepak.py xash-extras/ assets/extras.pak
# Regenerate resources(otherwise it may glitch)
rm -rf gen/ bin/
# Build
ndk-build NDK_TOOLCHAIN_VERSION=4.8 $NDK_BUILD_FLAGS -j8
ant $1
if [[ "$1" = "release" ]]; then
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore $KEYSTORE bin/$PROJECT-$1-unsigned.apk $KEYSTORE_ALIAS # -tsa https://timestamp.geotrust.com/tsa
$ANDROID_SDK_PATH/build-tools/$BUILD_TOOLS_VER/zipalign 4 bin/$PROJECT-$1-unsigned.apk bin/$PROJECT-$1.apk
fi
mv bin/$PROJECT-$1.apk $PROJECT-$1.apk
# Auto deploy to test device
if [[ "$1" = "debug" ]]; then
adb install -f -r $PROJECT-$1.apk
fi

View file

@ -1,27 +0,0 @@
ANDROID_JAR=../android-24.jar
AAPT=./../aapt
DX=./../dx
APKBUILDER=./../apkbuilder
mkdir gen
mkdir -p bin/classes
JAVAC=$JAVA_HOME/bin/javac
if [ -z "$JAVA_HOME" ]; then
export JAVAC=$(which javac)
fi
: ${OUTPUT:=$1}
: ${OUTPUT:=bin/xash3d-signed.apk}
sh gen-version.sh test build
sh gen-config.sh test
rm assets/extras.pak
python2.7 makepak.py xash-extras assets/extras.pak
$AAPT package -m -J gen/ --rename-manifest-package in.celest.xash3d.hl -M AndroidManifest.xml -S test/res -I $ANDROID_JAR
echo "package in.celest.xash3d.hl;public final class BuildConfig {public final static boolean DEBUG = true;}" > gen/in/celest/xash3d/hl/BuildConfig.java
$JAVAC -d bin/classes -s bin/classes -cp $ANDROID_JAR gen/in/celest/xash3d/hl/* src/in/celest/xash3d/*.java src/su/xash/fwgslib/*.java
$DX --dex --output=bin/classes.dex bin/classes/
$AAPT package -f -M test/AndroidManifest.xml -S test/res -I $ANDROID_JAR -F bin/xash3d.apk.unaligned
zip bin/xash3d.apk.unaligned assets/*
$APKBUILDER bin/xash3d.apk -u -nf libs/ -rj libs -f bin/classes.dex -z bin/xash3d.apk.unaligned
java -jar /mnt/app/apktool/signapk.jar /mnt/app/apktool/testkey.x509.pem /mnt/app/apktool/testkey.pk8 bin/xash3d.apk $OUTPUT

View file

@ -1,17 +0,0 @@
# This file is used to override default values used by the Ant build system.
#
# This file must be checked in Version Control Systems, as it is
# integral to the build system of your project.
# This file is only used by the Ant script.
# You can use this to override default values such as
# 'source.dir' for the location of your java source folder and
# 'out.dir' for the location of your output folder.
# You can also use it define how the release builds are signed by declaring
# the following properties:
# 'key.store' for the location of your keystore and
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.

135
build.xml
View file

@ -1,135 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="xashdroid" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<property file="local.properties" />
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
-->
<property file="ant.properties" />
<!-- if sdk.dir was not set from one of the property file, then
get it from the ANDROID_HOME env var.
This must be done before we load project.properties since
the proguard config can use sdk.dir -->
<property environment="env" />
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
<isset property="env.ANDROID_HOME" />
</condition>
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
unless="sdk.dir"
/>
<!--
Import per project custom build rules if present at the root of the project.
This is the place to put custom intermediary targets such as:
-pre-build
-pre-compile
-post-compile (This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir})
-post-package
-post-build
-pre-clean
-->
<import file="custom_rules.xml" optional="true" />
<!-- allow the package name to be overridden when building -->
<!-- Puts the project's resources into the output package file
This actually can create multiple resource package in case
Some custom apk with specific configuration have been
declared in default.properties.
-->
<!-- Replaces the target in tools\ant\build.xml -->
<import file="${sdk.dir}/tools/ant/build.xml" />
<if>
<condition>
<isset property="test.version"/>
</condition>
<then>
<property file="test.properties" />
</then>
<else>
<property name="test.dir" value="" />
<property name="test.pkg.postfix" value="" />
</else>
</if>
<target name="-package-resources" depends="-crunch">
<!-- this exec replicates the output of the aapt task in build.xml
-package-resources with the addition of a rename-manifest-package option. -->
<exec executable="${aapt}" failonerror="true">
<arg value="package" />
<arg value="-f" />
<arg value="--auto-add-overlay" />
<arg value="-M" />
<arg path="${basedir}/${test.dir}AndroidManifest.xml" />
<arg value="-S" />
<arg path="${basedir}/${test.dir}res" />
<arg value="-A" />
<arg path="${basedir}/assets" />
<arg value="-I" />
<arg path="${project.target.android.jar}" />
<arg value="-F" />
<arg path="${out.absolute.dir}/${resource.package.file.name}" />
<arg value="--rename-manifest-package" />
<arg value="in.celest.xash3d.hl${test.pkg.postfix}" />
</exec>
</target>
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
</project>

View file

@ -1,11 +0,0 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-8

View file

@ -1,45 +0,0 @@
import sys
import struct
import os
#dummy class for stuffing the file headers into
class FileEntry:
pass
#arguments are source directory, then target filename e.g. "pak1.pak"
rootdir = sys.argv[1]
pakfilename = sys.argv[2]
pakfile = open(pakfilename,"wb")
#write a dummy header to start with
pakfile.write(struct.Struct("<4s2l").pack(b"PACK",0,0))
#walk the directory recursively, add the files and record the file entries
offset = 12
fileentries = []
for root, subFolders, files in os.walk(rootdir):
for file in files:
entry = FileEntry()
impfilename = os.path.join(root,file)
entry.filename = os.path.relpath(impfilename,rootdir).replace("\\","/")
if(entry.filename.startswith(".git")):continue
print "pak: "+entry.filename
with open(impfilename, "rb") as importfile:
pakfile.write(importfile.read())
entry.offset = offset
entry.length = importfile.tell()
offset = offset + entry.length
fileentries.append(entry)
tablesize = 0
#after all the file data, write the list of entries
for entry in fileentries:
pakfile.write(struct.Struct("<56s").pack(entry.filename.encode("ascii")))
pakfile.write(struct.Struct("<l").pack(entry.offset))
pakfile.write(struct.Struct("<l").pack(entry.length))
tablesize = tablesize + 64
#return to the header and write the values correctly
pakfile.seek(0)
pakfile.write(struct.Struct("<4s2l").pack(b"PACK",offset,tablesize))

View file

@ -1,20 +0,0 @@
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

View file

@ -1,14 +0,0 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-19

View file

@ -1,2 +0,0 @@
test.dir=test/
test.pkg.postfix=.test

View file

@ -1,39 +0,0 @@
#!/bin/bash
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo "Travis should not deploy from pull requests"
exit 0
else
SOURCE_NAME=$1
shift
mkdir xash3d-travis
cp -a $* xash3d-travis/
cd xash3d-travis
git init
git config user.name FWGS-deployer
git config user.email FWGS-deployer@users.noreply.github.com
git remote add travis-deploy-public https://FWGS-deployer:${GH_TOKEN}@github.com/FWGS/xash3d-deploy.git
echo \# $TRAVIS_BRANCH branch autobuilds from $SOURCE_NAME >> README.md
echo >> README.md
echo Short changelog: >> README.md
echo \`\`\` >> README.md
(cd $TRAVIS_BUILD_DIR;git log --pretty=format:'%h %ad %s' --date iso -n 10 HEAD `curl https://raw.githubusercontent.com/FWGS/xash3d-deploy/$SOURCE_NAME-$TRAVIS_BRANCH/commit.txt`
.. )| cut -d ' ' -f 1-3,5-100 >> README.md
echo \`\`\` >> README.md
echo >> README.md
echo [Code on GitHub]\(https://github.com/FWGS/xash3d/tree/$TRAVIS_COMMIT\) >> README.md
echo >> README.md
echo [Full changelog for this build]\(https://github.com/FWGS/xash3d/commits/$TRAVIS_COMMIT\) >> README.md
echo >> README.md
for arg in $*; do
echo \* [$arg]\(https://github.com/FWGS/xash3d-deploy/blob/$SOURCE_NAME-$TRAVIS_BRANCH/$arg\?raw\=true\) >> README.md
echo >> README.md
done
echo $TRAVIS_COMMIT > commit.txt
git add .
git commit -m "Latest travis deploy $TRAVIS_COMMIT"
git checkout -b $SOURCE_NAME-$TRAVIS_BRANCH
git push -q --force travis-deploy-public $SOURCE_NAME-$TRAVIS_BRANCH >/dev/null 2>/dev/null
git checkout -b $SOURCE_NAME-latest
git push -q --force travis-deploy-public $SOURCE_NAME-latest >/dev/null 2>/dev/null
fi
exit 0

View file

@ -1,35 +0,0 @@
#!/bin/sh
# Upload travis generated APKs to the Transfer.sh and Yandex.Disk
getDaysSinceRelease()
{
printf %04d $(( ( $(date +'%s') - $(date -ud '2015-04-01' +'%s') )/60/60/24 ))
}
DAYSSINCERELEASE=`getDaysSinceRelease`
COMMITHASH=$(git rev-parse --short HEAD)
#CURRENTBRANCH=$(git rev-parse --abbrev-ref HEAD)
PREFIX=$DAYSSINCERELEASE-$(date +"%H-%M")
POSTFIX=$COMMITHASH
YADISKPATH=`date +%Y/%m/%d`
curl -u $YADISK_USERNAME:$YADISK_PASSWORD -X MKCOL https://webdav.yandex.ru/XashTestVersions/`date +%Y`
curl -u $YADISK_USERNAME:$YADISK_PASSWORD -X MKCOL https://webdav.yandex.ru/XashTestVersions/`date +%Y/%m`/
curl -u $YADISK_USERNAME:$YADISK_PASSWORD -X MKCOL https://webdav.yandex.ru/XashTestVersions/`date +%Y/%m/%d`/
while [ "$1" != "" ]; do
FNAME=$1
FILE_BASE=${FNAME%.*}
FILE_EXT="${FNAME##*.}"
OUTNAME=$PREFIX-$FILE_BASE-$POSTFIX.$FILE_EXT
echo $FNAME: `curl -s --upload-file $FNAME https://transfer.sh/$OUTNAME 2>/dev/null`
curl -T $FNAME -s -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/$YADISKPATH/$OUTNAME > /dev/null
curl -T $FNAME -s -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/current-$FILE_BASE-$TRAVIS_BRANCH.$FILE_EXT > /dev/null
shift
done
exit 0