Fix APK build Part2 (#35)
* Fix asset collection * Split assets into three seperate .zip files
This commit is contained in:
parent
7cb75e7299
commit
5e24e2bd73
@ -49,7 +49,7 @@ CROSS_PREFIX = arm-linux-androideabi-
|
|||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
ASSETS_TIMESTAMP = deps/assets_timestamp
|
ASSETS_TIMESTAMP = $(ANDR_ROOT)/deps/assets_timestamp
|
||||||
|
|
||||||
LEVELDB_URL = https://github.com/google/leveldb/archive/v$(LEVELDB_VER).zip
|
LEVELDB_URL = https://github.com/google/leveldb/archive/v$(LEVELDB_VER).zip
|
||||||
LEVELDB_VER = 1.19
|
LEVELDB_VER = 1.19
|
||||||
@ -752,12 +752,12 @@ clean_sqlite3:
|
|||||||
|
|
||||||
$(ASSETS_TIMESTAMP) : $(IRRLICHT_LIB)
|
$(ASSETS_TIMESTAMP) : $(IRRLICHT_LIB)
|
||||||
@mkdir -p ${ANDR_ROOT}/deps; \
|
@mkdir -p ${ANDR_ROOT}/deps; \
|
||||||
for DIRNAME in {builtin,client,doc,fonts,games,mods,po,textures}; do \
|
for DIRNAME in {builtin,client,doc,fonts,games,po,textures}; do \
|
||||||
LAST_MODIF=$$(find ${PROJ_ROOT}/${DIRNAME} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
|
LAST_MODIF=$$(find ${PROJ_ROOT}/$$DIRNAME -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
|
||||||
if [ $$(basename $$LAST_MODIF) != "timestamp" ]; then \
|
if [ $$(basename $$LAST_MODIF) != "timestamp" ]; then \
|
||||||
touch ${PROJ_ROOT}/${DIRNAME}/timestamp; \
|
touch ${PROJ_ROOT}/$$DIRNAME/timestamp; \
|
||||||
touch ${ASSETS_TIMESTAMP}; \
|
touch ${ASSETS_TIMESTAMP}; \
|
||||||
echo ${DIRNAME} changed $$LAST_MODIF; \
|
echo $$DIRNAME changed $$LAST_MODIF; \
|
||||||
fi; \
|
fi; \
|
||||||
done; \
|
done; \
|
||||||
LAST_MODIF=$$(find ${IRRLICHT_DIR}/media -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
|
LAST_MODIF=$$(find ${IRRLICHT_DIR}/media -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
|
||||||
@ -826,11 +826,16 @@ clean_luajit:
|
|||||||
|
|
||||||
assets : $(ASSETS_TIMESTAMP)
|
assets : $(ASSETS_TIMESTAMP)
|
||||||
@REFRESH=0; \
|
@REFRESH=0; \
|
||||||
if [ ! -e ${ASSETS_TIMESTAMP} ] ; then \
|
if [ ! -e ${ASSETS_TIMESTAMP}.old ] ; then \
|
||||||
REFRESH=1; \
|
REFRESH=1; \
|
||||||
fi; \
|
fi; \
|
||||||
if [ ${ASSETS_TIMESTAMP} -nt ${ASSETS_TIMESTAMP} ] ; then \
|
if [ ${ASSETS_TIMESTAMP} -nt ${ASSETS_TIMESTAMP}.old ] ; then \
|
||||||
REFRESH=1; \
|
REFRESH=1; \
|
||||||
|
fi; \
|
||||||
|
if [ ! -e ${APP_ROOT}/assets ] ; then \
|
||||||
|
REFRESH=1; \
|
||||||
|
fi; \
|
||||||
|
if [ $$REFRESH -ne 0 ] ; then \
|
||||||
echo "assets changed, refreshing..."; \
|
echo "assets changed, refreshing..."; \
|
||||||
$(MAKE) clean_assets; \
|
$(MAKE) clean_assets; \
|
||||||
mkdir -p ${APP_ROOT}/assets/MultiCraft; \
|
mkdir -p ${APP_ROOT}/assets/MultiCraft; \
|
||||||
@ -838,7 +843,7 @@ assets : $(ASSETS_TIMESTAMP)
|
|||||||
mkdir ${APP_ROOT}/assets/MultiCraft/fonts; \
|
mkdir ${APP_ROOT}/assets/MultiCraft/fonts; \
|
||||||
cp -r ${PROJ_ROOT}/fonts/retrovillenc.ttf ${APP_ROOT}/assets/MultiCraft/fonts/; \
|
cp -r ${PROJ_ROOT}/fonts/retrovillenc.ttf ${APP_ROOT}/assets/MultiCraft/fonts/; \
|
||||||
cp -r ${PROJ_ROOT}/games ${APP_ROOT}/assets/MultiCraft; \
|
cp -r ${PROJ_ROOT}/games ${APP_ROOT}/assets/MultiCraft; \
|
||||||
mkdir -p ${APP_ROOT}/assets/MultiCraft/locale; \
|
mkdir -p ${APP_ROOT}/assets/MultiCraft/locale; \
|
||||||
pushd ${PROJ_ROOT}/po; \
|
pushd ${PROJ_ROOT}/po; \
|
||||||
for lang in *; do \
|
for lang in *; do \
|
||||||
[ $${#lang} -ne 2 ] && continue; \
|
[ $${#lang} -ne 2 ] && continue; \
|
||||||
@ -861,18 +866,23 @@ assets : $(ASSETS_TIMESTAMP)
|
|||||||
find . -type d -path "*.git" -exec rm -rf {} \; ; \
|
find . -type d -path "*.git" -exec rm -rf {} \; ; \
|
||||||
find . -type d -path "*.svn" -exec rm -rf {} \; ; \
|
find . -type d -path "*.svn" -exec rm -rf {} \; ; \
|
||||||
find . -type f -path "*.gitignore" -exec rm -rf {} \; ; \
|
find . -type f -path "*.gitignore" -exec rm -rf {} \; ; \
|
||||||
ls -R | grep ":$$" | sed -e 's/:$$//' -e 's/\.//' -e 's/^\///' > "index.txt"; \
|
cd MultiCraft; \
|
||||||
find -L MultiCraft > filelist.txt; \
|
ls -R | grep ":$$" | sed -e 's/:$$//' -e 's/\.//' -e 's/^\///' > ../index.txt; \
|
||||||
|
find -L . | cut -c 3- > ../filelist.txt; \
|
||||||
|
echo "Creating worlds.zip"; \
|
||||||
|
zip -r ../worlds.zip worlds; \
|
||||||
|
echo "Creating games.zip"; \
|
||||||
|
zip -r ../games.zip games; \
|
||||||
|
rm -r worlds games; \
|
||||||
echo "Creating Files.zip"; \
|
echo "Creating Files.zip"; \
|
||||||
zip -r Files.zip MultiCraft; \
|
zip -r ../Files.zip *; \
|
||||||
touch ${ASSETS_TIMESTAMP}; \
|
cp ${ASSETS_TIMESTAMP} ${ASSETS_TIMESTAMP}.old; \
|
||||||
touch ${ASSETS_TIMESTAMP_INT}; \
|
|
||||||
else \
|
else \
|
||||||
echo "nothing to be done for assets"; \
|
echo "nothing to be done for assets"; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
clean_assets :
|
clean_assets :
|
||||||
@$(RM) -r assets
|
@$(RM) -r ${APP_ROOT}/assets
|
||||||
|
|
||||||
# $(MPIR_LIB)
|
# $(MPIR_LIB)
|
||||||
apk: local.properties $(ICONV_LIB) $(IRRLICHT_LIB) $(CURL_LIB) $(LEVELDB_LIB) $(LUAJIT_LIB) \
|
apk: local.properties $(ICONV_LIB) $(IRRLICHT_LIB) $(CURL_LIB) $(LEVELDB_LIB) $(LUAJIT_LIB) \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user