Complete scripts

This commit is contained in:
Andrea Cavalli 2020-10-10 15:08:26 +02:00
parent 70fbdea77c
commit a1744fbb5b
12 changed files with 66 additions and 87 deletions

View File

@ -1,75 +0,0 @@
#!/bin/bash -e
# REQUIRED PARAMETERS:
# OPERATING_SYSTEM_NAME = <windows | linux | osx>
# CPU_ARCHITECTURE_NAME = <amd64 | aarch64>
# IMPLEMENTATION_NAME = <tdlib | tdlight>
# CPU_CORES = <cores>
# Check variables correctness
if [ -z "${OPERATING_SYSTEM_NAME}" ]; then
echo "Missing parameter: OPERATING_SYSTEM_NAME"
exit 1
fi
if [ -z "${CPU_ARCHITECTURE_NAME}" ]; then
echo "Missing parameter: CPU_ARCHITECTURE_NAME"
exit 1
fi
if [ -z "${IMPLEMENTATION_NAME}" ]; then
echo "Missing parameter: IMPLEMENTATION_NAME"
exit 1
fi
if [ -z "${CPU_CORES}" ]; then
echo "Missing parameter: CPU_CORES"
exit 1
fi
cd ../
# Print details
echo "Compiling tdjni..."
echo "Current directory: $(pwd)"
echo "Operating system: ${OPERATING_SYSTEM_NAME}"
echo "Architecture: ${CPU_ARCHITECTURE_NAME}"
echo "Td implementation: ${IMPLEMENTATION_NAME}"
# Delete old data
echo "Deleting old data..."
[ -d ./generated/tdjni_build/ ] && rm -r ./generated/tdjni_build/
[ -d ./generated/tdjni_bin/ ] && rm -r ./generated/tdjni_bin/
[ -d ./generated/tdjni_docs/ ] && rm -r ./generated/tdjni_docs/
[ -d ./generated/src/jni-cpp-src/ ] && rm -r ./generated/src/jni-cpp-src/
[ -d ./generated/src/jni-java-src/ ] && rm -r ./generated/src/jni-java-src/
# Create missing folders
echo "Creating missing folders..."
[ -d ./generated/tdjni_build/ ] || mkdir ./generated/tdjni_build/
[ -d ./generated/tdjni_bin/ ] || mkdir ./generated/tdjni_bin/
[ -d ./generated/tdjni_docs/ ] || mkdir ./generated/tdjni_docs/
# Copy source files
echo "Copying source files..."
cp -r ./src/main/jni-cpp-src ./generated/src/main/jni-cpp-src
cp -r ./src/main/jni-java-src ./generated/src/main/jni-java-src
# Configure cmake
echo "Configuring CMake..."
cd ./generated/tdjni_build/
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DTD_GENERATED_BINARIES_DIR=$(realpath ../td_tools/td/generate) \
-DTD_SRC_DIR=$(realpath ../implementation/) \
-DTDNATIVES_BIN_DIR=$(realpath ../tdjni_bin/) \
-DTDNATIVES_DOCS_BIN_DIR=$(realpath ../tdjni_docs/) \
-DTd_DIR=$(realpath ../td_bin/lib/cmake/Td/) \
-DJAVA_SRC_DIR=$(realpath ../src/main/jni-java-src/) \
-DTDNATIVES_CPP_SRC_DIR:PATH=$(realpath ../src/main/jni-cpp-src/) \
-DOPENSSL_USE_STATIC_LIBS=True \
$(realpath ../src/main/jni-cpp-src/)
# Build
echo "Compiling ${IMPLEMENTATION_NAME} jni..."
cmake --build . --target install --parallel ${CPU_CORES}
echo "Done."
exit 0

View File

@ -4,6 +4,7 @@
# CPU_ARCHITECTURE_NAME = <amd64 | aarch64>
# IMPLEMENTATION_NAME = <tdlib | tdlight>
# CPU_CORES = <cores>
# CMAKE_EXTRA_ARGUMENTS = <args>
# Check variables correctness
if [ -z "${OPERATING_SYSTEM_NAME}" ]; then
@ -31,6 +32,8 @@ echo "Current directory: $(pwd)"
echo "Operating system: ${OPERATING_SYSTEM_NAME}"
echo "Architecture: ${CPU_ARCHITECTURE_NAME}"
echo "Td implementation: ${IMPLEMENTATION_NAME}"
echo "CPU cores count: ${CPU_CORES}"
echo "CMake extra arguments: '${CMAKE_EXTRA_ARGUMENTS}'"
# Delete old data
echo "Deleting old data..."

View File

@ -4,6 +4,7 @@
# CPU_ARCHITECTURE_NAME = <amd64 | aarch64>
# IMPLEMENTATION_NAME = <tdlib | tdlight>
# CPU_CORES = <cores>
# CMAKE_EXTRA_ARGUMENTS = <args>
# Check variables correctness
if [ -z "${OPERATING_SYSTEM_NAME}" ]; then
@ -31,6 +32,8 @@ echo "Current directory: $(pwd)"
echo "Operating system: ${OPERATING_SYSTEM_NAME}"
echo "Architecture: ${CPU_ARCHITECTURE_NAME}"
echo "Td implementation: ${IMPLEMENTATION_NAME}"
echo "CPU cores count: ${CPU_CORES}"
echo "CMake extra arguments: '${CMAKE_EXTRA_ARGUMENTS}'"
# Delete old data
echo "Deleting old data..."

View File

@ -0,0 +1,7 @@
#!/bin/bash -e
cd ../generated
mvn -DpushChanges=false -DlocalCheckout=true -DpreparationGoals=initialize release:prepare release:perform -B
echo "Done."
exit 0

View File

@ -0,0 +1,7 @@
#!/bin/bash -e
cd ../generated
mvn -B deploy
echo "Done."
exit 0

View File

@ -26,6 +26,7 @@ echo "Current directory: $(pwd)"
echo "Operating system: ${OPERATING_SYSTEM_NAME}"
echo "Architecture: ${CPU_ARCHITECTURE_NAME}"
echo "Td implementation: ${IMPLEMENTATION_NAME}"
echo "CPU cores count: ${CPU_CORES}"
# Delete old data
echo "Deleting old data..."

View File

@ -4,6 +4,7 @@
# CPU_ARCHITECTURE_NAME = <amd64 | aarch64>
# IMPLEMENTATION_NAME = <tdlib | tdlight>
# CPU_CORES = <cores>
# CMAKE_EXTRA_ARGUMENTS = <args>
# Check variables correctness
if [ -z "${OPERATING_SYSTEM_NAME}" ]; then
@ -31,6 +32,8 @@ echo "Current directory: $(pwd)"
echo "Operating system: ${OPERATING_SYSTEM_NAME}"
echo "Architecture: ${CPU_ARCHITECTURE_NAME}"
echo "Td implementation: ${IMPLEMENTATION_NAME}"
echo "CPU cores count: ${CPU_CORES}"
echo "CMake extra arguments: '${CMAKE_EXTRA_ARGUMENTS}'"
# Delete old data
echo "Deleting old data..."

View File

@ -4,6 +4,7 @@
# CPU_ARCHITECTURE_NAME = <amd64 | aarch64>
# IMPLEMENTATION_NAME = <tdlib | tdlight>
# CPU_CORES = <cores>
# CMAKE_EXTRA_ARGUMENTS = <args>
# Check variables correctness
if [ -z "${OPERATING_SYSTEM_NAME}" ]; then
@ -31,6 +32,8 @@ echo "Current directory: $(pwd)"
echo "Operating system: ${OPERATING_SYSTEM_NAME}"
echo "Architecture: ${CPU_ARCHITECTURE_NAME}"
echo "Td implementation: ${IMPLEMENTATION_NAME}"
echo "CPU cores count: ${CPU_CORES}"
echo "CMake extra arguments: '${CMAKE_EXTRA_ARGUMENTS}'"
# Delete old data
echo "Deleting old data..."

View File

@ -1,4 +1,9 @@
#!/bin/bash -e
set -e
if [ "$TRAVIS_CPU_ARCH" = "arm64" ]; then
while true; do free -h ; sleep 2; done &
fi
source ./travis/setup_variables.sh
cd ./scripts/

View File

@ -1,4 +1,11 @@
#!/bin/bash -e
set -e
source ./travis/setup_variables.sh
cd ./scripts/
./deploy_snapshot.sh
echo "Build success"
exit 0

14
travis/deploy.sh Normal file
View File

@ -0,0 +1,14 @@
#!/bin/bash -e
set -e
source ./travis/setup_variables.sh
cd ./scripts/
git config user.email \"jenkins@mchv.eu\"
git config user.name \"Jenkins\"
./deploy_release.sh
echo "Build success"
exit 0

View File

@ -21,19 +21,18 @@ fi
# ====== OS Variables
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
export VCPKG_DIR=$TRAVIS_BUILD_DIR/vcpkg
export CMAKE_EXTRA_ARGUMENTS="-A x64 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$VCPKG_DIR/scripts/buildsystems/vcpkg.cmake"
export PATH="$PATH:/c/tools/php74:/c/PHP:/c/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64:/c/Program Files/OpenJDK/openjdk-11.0.8_10/bin:/c/Program Files/CMake/bin:/c/ProgramData/chocolatey/bin:/c/Program Files/apache-maven-3.6.3/bin:/c/ProgramData/chocolatey/lib/maven/apache-maven-3.6.3/bin:/c/ProgramData/chocolatey/lib/base64/tools:/c/Program Files/NASM"
export JAVA_HOME="/c/Program Files/OpenJDK/openjdk-11.0.8_10"
export VCPKG_DIR=$TRAVIS_BUILD_DIR/vcpkg
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
PATH="$PATH:$(/usr/libexec/java_home -v 14)"
export PATH
JAVA_HOME="$(/usr/libexec/java_home -v 14)"
export JAVA_HOME
JAVA_INCLUDE_PATH="$(/usr/libexec/java_home -v 14)/include"
export JAVA_INCLUDE_PATH
export CMAKE_EXTRA_ARGUMENTS=""
export PATH="$PATH:$(/usr/libexec/java_home -v 14)"
export JAVA_HOME="$(/usr/libexec/java_home -v 14)"
export JAVA_INCLUDE_PATH="$(/usr/libexec/java_home -v 14)/include"
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
TRAVIS_CPU_ARCH_JAVA="$(tr '[:upper:]' '[:lower:]'<<<"${TRAVIS_CPU_ARCH}")"
export TRAVIS_CPU_ARCH_JAVA
export CMAKE_EXTRA_ARGUMENTS=""
export TRAVIS_CPU_ARCH_JAVA="$(tr '[:upper:]' '[:lower:]'<<<"${TRAVIS_CPU_ARCH}")"
export PATH="$PATH:/usr/lib/jvm/java-11-openjdk-$TRAVIS_CPU_ARCH_JAVA/bin"
export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-$TRAVIS_CPU_ARCH_JAVA"
export JAVA_INCLUDE_PATH="/usr/lib/jvm/java-11-openjdk-$TRAVIS_CPU_ARCH_JAVA/include"
@ -52,13 +51,15 @@ echo "TDLIB_SERIALIZER_DIR=${TDLIB_SERIALIZER_DIR}"
echo "PATH=${PATH}"
echo "JAVA_HOME=${JAVA_HOME}"
echo "JAVA_INCLUDE_PATH=${JAVA_INCLUDE_PATH}"
echo "CMAKE_EXTRA_ARGUMENTS=${CMAKE_EXTRA_ARGUMENTS}"
echo "VCPKG_DIR=${VCPKG_DIR}"
echo "MAVEN_OPTS=${MAVEN_OPTS}"
echo "TRAVIS_CPU_ARCH=${TRAVIS_CPU_ARCH}"
echo "TRAVIS_CPU_ARCH_JAVA=${TRAVIS_CPU_ARCH_JAVA}"
echo "TRAVIS_CPU_ARCH_STANDARD=${TRAVIS_CPU_ARCH_STANDARD}"
echo "CPU_ARCHITECTURE_NAME=${CPU_ARCHITECTURE_NAME}"
echo "CPU_CORES=${CPU_CORES}"
echo "TRAVIS_OS_NAME=${TRAVIS_OS_NAME}"
echo "TRAVIS_OS_NAME_STANDARD=${TRAVIS_OS_NAME_STANDARD}"
echo "TRAVIS_OS_NAME_SHORT=${TRAVIS_OS_NAME_SHORT}"
echo "OPERATING_SYSTEM_NAME=${OPERATING_SYSTEM_NAME}"
echo "OPERATING_SYSTEM_NAME_SHORT=${OPERATING_SYSTEM_NAME}"
echo "SRC_TDJNI_LIBNAME=${SRC_TDJNI_LIBNAME}"
echo "DEST_TDJNI_LIBNAME=${DEST_TDJNI_LIBNAME}"