1
0

Update dockerfile, compile.sh, and 2 more files...

This commit is contained in:
Andrea Cavalli 2020-10-06 22:25:44 +02:00
parent 3a4fa75213
commit 734681b96a
4 changed files with 24 additions and 19 deletions

View File

@ -55,7 +55,7 @@ ENV TRAVIS_CPU_ARCH=amd64
ENV TRAVIS_OS_NAME=linux
ENV TRAVIS_BUILD_DIR=/home/$UNAME/work/tdlight-java
ENV TRAVIS_BUILD_DIR=/home/$UNAME/work
ENV TRAVIS_OUTPUT_DIR=/home/$UNAME/output

View File

@ -8,25 +8,25 @@ bash ./jenkins/scripts/setup_workspace.sh
# ====== Build Td
# Prepare build
cd $TD_BUILD_DIR
nice -n 5 cmake -DCMAKE_BUILD_TYPE=Release -DTD_ENABLE_JNI=ON -DCMAKE_INSTALL_PREFIX:PATH=${TD_BIN_DIR} -DTD_SKIP_BENCHMARK=ON -DTD_SKIP_TEST=OFF -DTD_SKIP_TG_CLI=ON ${TD_SRC_DIR}
nice -n 5 chrt -b 0 cmake -DCMAKE_BUILD_TYPE=Release -DTD_ENABLE_JNI=ON -DCMAKE_INSTALL_PREFIX:PATH=${TD_BIN_DIR} -DTD_SKIP_BENCHMARK=ON -DTD_SKIP_TEST=OFF -DTD_SKIP_TG_CLI=ON ${TD_SRC_DIR}
# Split sources
nice -n 5 cmake --build $TD_BUILD_DIR --target prepare_cross_compiling -- -j${TRAVIS_CPU_CORES}
nice -n 5 chrt -b 0 cmake --build $TD_BUILD_DIR --target prepare_cross_compiling -- -j${TRAVIS_CPU_CORES}
cd $TD_SRC_DIR
nice -n 5 php SplitSource.php
nice -n 5 chrt -b 0 php SplitSource.php
# Build
cd $TD_BUILD_DIR
nice -n 5 cmake --build $TD_BUILD_DIR --target install --config Release -- -j${TRAVIS_CPU_CORES}
nice -n 5 chrt -b 0 cmake --build $TD_BUILD_DIR --target install --config Release -- -j${TRAVIS_CPU_CORES}
# Undo split-sources
cd $TD_SRC_DIR
nice -n 5 php SplitSource.php --undo
nice -n 5 chrt -b 0 php SplitSource.php --undo
# ====== Build TdNatives
cd $TDNATIVES_CPP_BUILD_DIR
nice -n 5 cmake -DCMAKE_BUILD_TYPE=Release -DTD_BIN_DIR=${TD_BIN_DIR} -DTDNATIVES_BIN_DIR=${TDNATIVES_BIN_DIR} -DTDNATIVES_DOCS_BIN_DIR=${TDNATIVES_DOCS_BIN_DIR} -DTd_DIR=${TD_BIN_DIR}/lib/cmake/Td -DJAVA_SRC_DIR=${JAVA_SRC_DIR} -DTDNATIVES_CPP_SRC_DIR:PATH=$TDNATIVES_CPP_SRC_DIR $TDNATIVES_CPP_SRC_DIR
nice -n 5 cmake --build $TDNATIVES_CPP_BUILD_DIR --target install --config Release -- -j${TRAVIS_CPU_CORES}
nice -n 5 chrt -b 0 cmake -DCMAKE_BUILD_TYPE=Release -DTD_SRC_DIR=${TD_SRC_DIR} -DTD_GENERATED_BINARIES_DIR=${TD_BIN_DIR}/bin -DTDNATIVES_BIN_DIR=${TDNATIVES_BIN_DIR} -DTDNATIVES_DOCS_BIN_DIR=${TDNATIVES_DOCS_BIN_DIR} -DTd_DIR=${TD_BIN_DIR}/lib/cmake/Td -DJAVA_SRC_DIR=${JAVA_SRC_DIR} -DTDNATIVES_CPP_SRC_DIR:PATH=$TDNATIVES_CPP_SRC_DIR $TDNATIVES_CPP_SRC_DIR
nice -n 5 chrt -b 0 cmake --build $TDNATIVES_CPP_BUILD_DIR --target install --config Release -- -j${TRAVIS_CPU_CORES}
# ====== Print results stats
echo "CCACHE statistics:"

View File

@ -1,15 +1,16 @@
#!/bin/bash -e
# ====== Variables
export TD_SRC_DIR=$TRAVIS_BUILD_DIR/dependencies/tdlight
export TD_BIN_DIR=$TRAVIS_BUILD_DIR/bin-td
export TDNATIVES_BIN_DIR=$TRAVIS_BUILD_DIR/bin-tdlib
export TDNATIVES_CPP_SRC_DIR=$TRAVIS_BUILD_DIR/src/tdlib-cpp
export TDNATIVES_DOCS_BIN_DIR=$TRAVIS_BUILD_DIR/bin-docs
export TD_BUILD_DIR=$TRAVIS_BUILD_DIR/build-td
export TDNATIVES_CPP_BUILD_DIR=$TRAVIS_BUILD_DIR/build-tdlib
export JAVA_SRC_DIR=$TRAVIS_BUILD_DIR/src/tdlib-java
export TDLIB_SERIALIZER_DIR=$TRAVIS_BUILD_DIR/dependencies/tdlib-serializer
export TD_SRC_DIR=$TRAVIS_BUILD_DIR/tdlight-java/dependencies/tdlight
export TD_BIN_DIR=$TRAVIS_BUILD_DIR/tdlight-java/bin-td
export TDNATIVES_BIN_DIR=$TRAVIS_BUILD_DIR/tdlight-java/bin-tdlight
export TDNATIVES_CPP_SRC_DIR=$TRAVIS_BUILD_DIR/tdlight-java/src/tdlight-cpp
export TDNATIVES_DOCS_BIN_DIR=$TRAVIS_BUILD_DIR/tdlight-java/bin-docs
export TD_BUILD_DIR=$TRAVIS_BUILD_DIR/tdlight-java/build-td
export TD_CROSS_BIN_DIR=$TD_SRC_DIR/bin-td-cross
export TDNATIVES_CPP_BUILD_DIR=$TRAVIS_BUILD_DIR/tdlight-java/build-tdlight
export JAVA_SRC_DIR=$TRAVIS_BUILD_DIR/tdlight-java/src/tdlib-java
export TDLIB_SERIALIZER_DIR=$TRAVIS_BUILD_DIR/tdlight-java/dependencies/tdlib-serializer
export MAVEN_OPTS="--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/javax.crypto=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED"
TRAVIS_CPU_ARCH_STANDARD="$(tr '[:upper:]' '[:lower:]'<<<"${TRAVIS_CPU_ARCH}")"
export TRAVIS_CPU_ARCH_STANDARD;
@ -32,6 +33,7 @@ echo "TDNATIVES_BIN_DIR=${TDNATIVES_BIN_DIR}"
echo "TDNATIVES_CPP_SRC_DIR=${TDNATIVES_CPP_SRC_DIR}"
echo "TDNATIVES_DOCS_BIN_DIR=${TDNATIVES_DOCS_BIN_DIR}"
echo "TD_BUILD_DIR=${TD_BUILD_DIR}"
echo "TD_CROSS_BIN_DIR=${TD_CROSS_BIN_DIR}"
echo "TDNATIVES_CPP_BUILD_DIR=${TDNATIVES_CPP_BUILD_DIR}"
echo "JAVA_SRC_DIR=${JAVA_SRC_DIR}"
echo "TDLIB_SERIALIZER_DIR=${TDLIB_SERIALIZER_DIR}"

View File

@ -3,8 +3,11 @@
source ./jenkins/scripts/setup_variables.sh
# ====== Environment setup
[ -d $TD_BUILD_DIR ] || mkdir $TD_BUILD_DIR
[ -d $TDNATIVES_CPP_BUILD_DIR ] || mkdir $TDNATIVES_CPP_BUILD_DIR
[ -d $TD_BUILD_DIR ] || mkdir -p $TD_BUILD_DIR
[ -d $TD_BIN_DIR ] || mkdir -p $TD_BIN_DIR
[ -d $TD_NATIVE_BIN_DIR ] || mkdir -p $TD_NATIVE_BIN_DIR
[ -d $TD_CROSS_BIN_DIR ] || mkdir -p $TD_CROSS_BIN_DIR
[ -d $TDNATIVES_CPP_BUILD_DIR ] || mkdir -p $TDNATIVES_CPP_BUILD_DIR
echo "CCACHE statistics:"
ccache -s