Update compile_td.sh, compile_tdjni.sh, and 4 more files...

This commit is contained in:
Andrea Cavalli 2020-10-10 16:50:46 +02:00
parent ce7133bba2
commit d7331326ac
6 changed files with 34 additions and 26 deletions

View File

@ -49,7 +49,7 @@ echo "Creating missing folders..."
echo "Configuring CMake..."
cd ./generated/td_build/
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX:PATH=$(realpath ../td_bin/) \
-DCMAKE_INSTALL_PREFIX:PATH=$(realpath -m ../td_bin/) \
-DTD_ENABLE_JNI=ON \
${CMAKE_EXTRA_ARGUMENTS} \
../implementation

View File

@ -61,16 +61,16 @@ 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/) \
-DTD_GENERATED_BINARIES_DIR=$(realpath -m ../td_tools/td/generate/) \
-DTD_SRC_DIR=$(realpath -m ../implementation/) \
-DTDNATIVES_BIN_DIR=$(realpath -m ../tdjni_bin/) \
-DTDNATIVES_DOCS_BIN_DIR=$(realpath -m ../tdjni_docs/) \
-DTd_DIR=$(realpath -m ../td_bin/lib/cmake/Td/) \
-DJAVA_SRC_DIR=$(realpath -m ../src/main/jni-java-src/) \
-DTDNATIVES_CPP_SRC_DIR:PATH=$(realpath -m ../src/main/jni-cpp-src/) \
-DOPENSSL_USE_STATIC_LIBS=True \
${CMAKE_EXTRA_ARGUMENTS} \
$(realpath ../src/main/jni-cpp-src/)
$(realpath -m ../src/main/jni-cpp-src/)
# Build
echo "Compiling ${IMPLEMENTATION_NAME} jni..."

View File

@ -62,13 +62,13 @@ cmake --build . --target prepare_cross_compiling ${CPU_CORES}
echo "Generating java tools..."
cmake --build . --target td_generate_java_api ${CPU_CORES}
echo "Generated executable '$(realpath ./td/generate/generate_common)'"
echo "Generated executable '$(realpath ./td/generate/td_generate_java_api)'"
echo "Generated executable '$(realpath ./td/generate/td_generate_json)'"
echo "Generated executable '$(realpath ../implementation/td/generate/JavadocTlDocumentationGenerator.php)'"
echo "Generated executable '$(realpath ../implementation/td/generate/TlDocumentationGenerator.php)'"
echo "Generated executable '$(realpath ../implementation/td/generate/scheme/td_api.tl)'"
echo "Generated executable '$(realpath ../implementation/td/generate/scheme/td_api.tlo)'"
echo "Generated executable '$(realpath -m ./td/generate/generate_common)'"
echo "Generated executable '$(realpath -m ./td/generate/td_generate_java_api)'"
echo "Generated executable '$(realpath -m ./td/generate/td_generate_json)'"
echo "Generated executable '$(realpath -m ../implementation/td/generate/JavadocTlDocumentationGenerator.php)'"
echo "Generated executable '$(realpath -m ../implementation/td/generate/TlDocumentationGenerator.php)'"
echo "Generated executable '$(realpath -m ../implementation/td/generate/scheme/td_api.tl)'"
echo "Generated executable '$(realpath -m ../implementation/td/generate/scheme/td_api.tlo)'"
echo "Done."
exit 0

View File

@ -61,16 +61,16 @@ cp -r ./src/main/jni-java-src ./generated/src/main/jni-java-src
# Configure cmake
echo "Configuring CMake..."
cd ./generated/tdapi_java_build/
echo "Telegram source path: '$(realpath ../implementation/)'"
echo "Telegram source path: '$(realpath -m ../implementation/)'"
cmake -DCMAKE_BUILD_TYPE=Release \
-DTD_SRC_DIR=$(realpath ../implementation/) \
-DTD_GENERATED_BINARIES_DIR=$(realpath ../td_tools/td/generate) \
-DTd_DIR=$(realpath ../td_bin/lib/cmake/Td/) \
-DTDNATIVES_BIN_DIR=$(realpath ../tdjni_bin/) \
-DTDNATIVES_DOCS_BIN_DIR=$(realpath ../tdjni_docs/) \
-DJAVA_SRC_DIR=$(realpath ../src/main/jni-java-src/) \
-DTD_SRC_DIR=$(realpath -m ../implementation/) \
-DTD_GENERATED_BINARIES_DIR=$(realpath -m ../td_tools/td/generate) \
-DTd_DIR=$(realpath -m ../td_bin/lib/cmake/Td/) \
-DTDNATIVES_BIN_DIR=$(realpath -m ../tdjni_bin/) \
-DTDNATIVES_DOCS_BIN_DIR=$(realpath -m ../tdjni_docs/) \
-DJAVA_SRC_DIR=$(realpath -m ../src/main/jni-java-src/) \
${CMAKE_EXTRA_ARGUMENTS} \
$(realpath ../src/main/jni-cpp-src/)
$(realpath -m ../src/main/jni-cpp-src/)
# Run cmake to generate TdApi.java
echo "Generating TdApi.java..."
@ -81,13 +81,13 @@ echo "Patching TdApi.java..."
cd ./tdlib-serializer/
python3 -m pip install -r requirements.txt
cd ../
python3 ../tdlib-serializer/ $(realpath ./src/main/jni-java-src/it/tdlight/jni/TdApi.java) $(realpath ./src/main/jni-java-src/it/tdlight/jni/new_TdApi.java) $(realpath ../tdlib-serializer/headers.txt)
python3 ../tdlib-serializer/ $(realpath -m ./src/main/jni-java-src/it/tdlight/jni/TdApi.java) $(realpath -m ./src/main/jni-java-src/it/tdlight/jni/new_TdApi.java) $(realpath -m ../tdlib-serializer/headers.txt)
rm ./src/main/jni-java-src/it/tdlight/jni/TdApi.java
unexpand --tabs=2 ./src/main/jni-java-src/it/tdlight/jni/new_TdApi.java > ./src/main/jni-java-src/it/tdlight/jni/TdApi.java
rm ./src/main/jni-java-src/it/tdlight/jni/new_TdApi.java
cp ./src/main/jni-java-src/it/tdlight/jni/TdApi.java ./src/main/java/it/tdlight/jni/TdApi.java
echo "Generated '$(realpath ./src/main/java/it/tdlight/jni/TdApi.java)'"
echo "Generated '$(realpath -m ./src/main/java/it/tdlight/jni/TdApi.java)'"
echo "Done."
exit 0

View File

@ -0,0 +1,4 @@
s/${OPERATING_SYSTEM_NAME}/osx/
s/${OPERATING_SYSTEM_NAME_SHORT}/osx/
s/${CPU_ARCHITECTURE_NAME}/amd64/
s/${IMPLEMENTATION_NAME}/tdlib/

View File

@ -0,0 +1,4 @@
s/${OPERATING_SYSTEM_NAME}/osx/
s/${OPERATING_SYSTEM_NAME_SHORT}/osx/
s/${CPU_ARCHITECTURE_NAME}/amd64/
s/${IMPLEMENTATION_NAME}/tdlight/