Renamed tdnatives to tdlib

This commit is contained in:
Andrea Cavalli 2020-08-20 02:01:54 +02:00
parent 4fcc752f24
commit f02164b148
8 changed files with 31 additions and 31 deletions

6
.gitignore vendored
View File

@ -58,8 +58,8 @@ tdlib.iml
/bin-docs /bin-docs
/bin-td /bin-td
/bin-tdnatives /bin-tdlib
/build-td /build-td
/build-tdnatives /build-tdlib
__pycache__ __pycache__
/src/tdnatives-java/it/tdlight/tdnatives/TdApi.java /src/tdlib-java/it/tdlight/tdlib/TdApi.java

View File

@ -3,12 +3,12 @@
# ====== Variables # ====== Variables
export TD_SRC_DIR=${PWD}/dependencies/tdlight export TD_SRC_DIR=${PWD}/dependencies/tdlight
export TD_BIN_DIR=${PWD}/bin-td export TD_BIN_DIR=${PWD}/bin-td
export TDNATIVES_BIN_DIR=${PWD}/bin-tdnatives export TDNATIVES_BIN_DIR=${PWD}/bin-tdlib
export TDNATIVES_CPP_SRC_DIR=${PWD}/src/tdnatives-cpp export TDNATIVES_CPP_SRC_DIR=${PWD}/src/tdlib-cpp
export TDNATIVES_DOCS_BIN_DIR=${PWD}/bin-docs export TDNATIVES_DOCS_BIN_DIR=${PWD}/bin-docs
export TD_BUILD_DIR=${PWD}/build-td export TD_BUILD_DIR=${PWD}/build-td
export TDNATIVES_CPP_BUILD_DIR=${PWD}/build-tdnatives export TDNATIVES_CPP_BUILD_DIR=${PWD}/build-tdlib
export JAVA_SRC_DIR=${PWD}/src/tdnatives-java export JAVA_SRC_DIR=${PWD}/src/tdlib-java
export TDLIB_SERIALIZER_DIR=${PWD}/dependencies/tdlib-serializer export TDLIB_SERIALIZER_DIR=${PWD}/dependencies/tdlib-serializer
# ====== Print variables # ====== Print variables
@ -34,8 +34,8 @@ cmake --build $TDNATIVES_CPP_BUILD_DIR --target install -- -j4
# ====== Patch generated java code # ====== Patch generated java code
echo "Compilation done. Patching TdApi.java" echo "Compilation done. Patching TdApi.java"
python3 $TDLIB_SERIALIZER_DIR $JAVA_SRC_DIR/it/tdlight/tdnatives/TdApi.java $JAVA_SRC_DIR/it/tdlight/tdnatives/new_TdApi.java $TDLIB_SERIALIZER_DIR/headers.txt python3 $TDLIB_SERIALIZER_DIR $JAVA_SRC_DIR/it/tdlight/tdlib/TdApi.java $JAVA_SRC_DIR/it/tdlight/tdlib/new_TdApi.java $TDLIB_SERIALIZER_DIR/headers.txt
rm $JAVA_SRC_DIR/it/tdlight/tdnatives/TdApi.java rm $JAVA_SRC_DIR/it/tdlight/tdlib/TdApi.java
unexpand --tabs=2 $JAVA_SRC_DIR/it/tdlight/tdnatives/new_TdApi.java > $JAVA_SRC_DIR/it/tdlight/tdnatives/TdApi.java unexpand --tabs=2 $JAVA_SRC_DIR/it/tdlight/tdlib/new_TdApi.java > $JAVA_SRC_DIR/it/tdlight/tdlib/TdApi.java
rm $JAVA_SRC_DIR/it/tdlight/tdnatives/new_TdApi.java rm $JAVA_SRC_DIR/it/tdlight/tdlib/new_TdApi.java

View File

@ -26,7 +26,7 @@ message(STATUS "Java Source Directory: ${JAVA_SRC_DIR}")
# Generating TdApi.java # Generating TdApi.java
find_program(PHP_EXECUTABLE php) find_program(PHP_EXECUTABLE php)
set(TD_API_JAVA_PACKAGE "it/tdlight/tdnatives") set(TD_API_JAVA_PACKAGE "it/tdlight/tdlib")
set(TD_API_JAVA_PATH ${JAVA_SRC_DIR}) set(TD_API_JAVA_PATH ${JAVA_SRC_DIR})
set(TD_API_TLO_PATH ${TD_BIN_DIR}/bin/td/generate/scheme/td_api.tlo) set(TD_API_TLO_PATH ${TD_BIN_DIR}/bin/td/generate/scheme/td_api.tlo)
set(TD_API_TL_PATH ${TD_BIN_DIR}/bin/td/generate/scheme/td_api.tl) set(TD_API_TL_PATH ${TD_BIN_DIR}/bin/td/generate/scheme/td_api.tl)
@ -51,7 +51,7 @@ add_custom_target(build_java
) )
add_custom_target(generate_javadoc add_custom_target(generate_javadoc
COMMAND ${Java_JAVADOC_EXECUTABLE} -d ${TDNATIVES_DOCS_BIN_DIR} it.tdlight.tdnatives COMMAND ${Java_JAVADOC_EXECUTABLE} -d ${TDNATIVES_DOCS_BIN_DIR} it.tdlight.tdlib
WORKING_DIRECTORY ${TD_API_JAVA_PATH} WORKING_DIRECTORY ${TD_API_JAVA_PATH}
COMMENT "Generating Javadoc documentation" COMMENT "Generating Javadoc documentation"
DEPENDS td_generate_java_api DEPENDS td_generate_java_api

View File

@ -1,3 +1,3 @@
../src/tdnatives-java/it/tdlight/tdnatives/NativeClient.java ../src/tdlib-java/it/tdlight/tdlib/NativeClient.java
../src/tdnatives-java/it/tdlight/tdnatives/NativeLog.java ../src/tdlib-java/it/tdlight/tdlib/NativeLog.java
../src/tdnatives-java/it/tdlight/tdnatives/TdApi.java ../src/tdlib-java/it/tdlight/tdlib/TdApi.java

View File

@ -18,8 +18,8 @@ package it.tdlight.tdlight.natives;
import it.tdlight.tdnatives.TdApi.Function; import it.tdlight.tdlib.TdApi.Function;
import it.tdlight.tdnatives.TdApi.Object; import it.tdlight.tdlib.TdApi.Object;
public class NativeClient { public class NativeClient {
protected static native long createNativeClient(); protected static native long createNativeClient();

View File

@ -68,10 +68,10 @@ if [ "$TRAVIS_OS_NAME_STANDARD" = "linux" ]; then
# Patch TdApi.java # Patch TdApi.java
echo "Patching TdApi.java" echo "Patching TdApi.java"
python3 $TDLIB_SERIALIZER_DIR $JAVA_SRC_DIR/it/tdlight/tdnatives/TdApi.java $JAVA_SRC_DIR/it/tdlight/tdnatives/new_TdApi.java $TDLIB_SERIALIZER_DIR/headers.txt python3 $TDLIB_SERIALIZER_DIR $JAVA_SRC_DIR/it/tdlight/tdlib/TdApi.java $JAVA_SRC_DIR/it/tdlight/tdlib/new_TdApi.java $TDLIB_SERIALIZER_DIR/headers.txt
rm $JAVA_SRC_DIR/it/tdlight/tdnatives/TdApi.java rm $JAVA_SRC_DIR/it/tdlight/tdlib/TdApi.java
unexpand --tabs=2 $JAVA_SRC_DIR/it/tdlight/tdnatives/new_TdApi.java > $JAVA_SRC_DIR/it/tdlight/tdnatives/TdApi.java unexpand --tabs=2 $JAVA_SRC_DIR/it/tdlight/tdlib/new_TdApi.java > $JAVA_SRC_DIR/it/tdlight/tdlib/TdApi.java
rm $JAVA_SRC_DIR/it/tdlight/tdnatives/new_TdApi.java rm $JAVA_SRC_DIR/it/tdlight/tdlib/new_TdApi.java
# Upgrade the file of tdlight-java # Upgrade the file of tdlight-java
cd $TRAVIS_BUILD_DIR cd $TRAVIS_BUILD_DIR
@ -79,13 +79,13 @@ if [ "$TRAVIS_OS_NAME_STANDARD" = "linux" ]; then
git clone --depth=1 -b master --single-branch git@ssh.git.ignuranza.net:tdlight-team/tdlight-java.git git clone --depth=1 -b master --single-branch git@ssh.git.ignuranza.net:tdlight-team/tdlight-java.git
cd $TRAVIS_BUILD_DIR/tdlight-java cd $TRAVIS_BUILD_DIR/tdlight-java
git checkout master git checkout master
cp $JAVA_SRC_DIR/it/tdlight/tdnatives/TdApi.java $TRAVIS_BUILD_DIR/tdlight-java/src/main/java/it/tdlight/tdnatives/TdApi.java cp $JAVA_SRC_DIR/it/tdlight/tdlib/TdApi.java $TRAVIS_BUILD_DIR/tdlight-java/src/main/java/it/tdlight/tdlib/TdApi.java
# IF TdApi.java IS CHANGED # IF TdApi.java IS CHANGED
if [[ ! -z "$(git status --porcelain | grep "$JAVA_SRC_DIR/it/tdlight/tdnatives/TdApi.java")" ]]; then if [[ ! -z "$(git status --porcelain | grep "$JAVA_SRC_DIR/it/tdlight/tdlib/TdApi.java")" ]]; then
# Upgrade TdApi.java in repository master # Upgrade TdApi.java in repository master
cd $TRAVIS_BUILD_DIR/tdlight-java cd $TRAVIS_BUILD_DIR/tdlight-java
git add src/main/java/it/tdlight/tdnatives/TdApi.java git add src/main/java/it/tdlight/tdlib/TdApi.java
git commit -m "Upgraded TdApi.java" git commit -m "Upgraded TdApi.java"
git push git push
else else

View File

@ -5,8 +5,8 @@ set -e
source ./travis/setup_variables.sh source ./travis/setup_variables.sh
# ====== Environment cleanup # ====== Environment cleanup
[ -f $JAVA_SRC_DIR/it/tdlight/tdnatives/TdApi.java ] && rm $JAVA_SRC_DIR/it/tdlight/tdnatives/TdApi.java [ -f $JAVA_SRC_DIR/it/tdlight/tdlib/TdApi.java ] && rm $JAVA_SRC_DIR/it/tdlight/tdlib/TdApi.java
[ -f $JAVA_SRC_DIR/it/tdlight/tdnatives/new_TdApi.java ] && rm $JAVA_SRC_DIR/it/tdlight/tdnatives/new_TdApi.java [ -f $JAVA_SRC_DIR/it/tdlight/tdlib/new_TdApi.java ] && rm $JAVA_SRC_DIR/it/tdlight/tdlib/new_TdApi.java
# ====== Environment setup # ====== Environment setup
[ -d $TRAVIS_BUILD_DIR/out ] || mkdir -p $TRAVIS_BUILD_DIR/out [ -d $TRAVIS_BUILD_DIR/out ] || mkdir -p $TRAVIS_BUILD_DIR/out

View File

@ -4,12 +4,12 @@ set -e
# ====== Variables # ====== Variables
export TD_SRC_DIR=${PWD}/dependencies/tdlight export TD_SRC_DIR=${PWD}/dependencies/tdlight
export TD_BIN_DIR=${PWD}/bin-td export TD_BIN_DIR=${PWD}/bin-td
export TDNATIVES_BIN_DIR=${PWD}/bin-tdnatives export TDNATIVES_BIN_DIR=${PWD}/bin-tdlib
export TDNATIVES_CPP_SRC_DIR=${PWD}/src/tdnatives-cpp export TDNATIVES_CPP_SRC_DIR=${PWD}/src/tdlib-cpp
export TDNATIVES_DOCS_BIN_DIR=${PWD}/bin-docs export TDNATIVES_DOCS_BIN_DIR=${PWD}/bin-docs
export TD_BUILD_DIR=${PWD}/build-td export TD_BUILD_DIR=${PWD}/build-td
export TDNATIVES_CPP_BUILD_DIR=${PWD}/build-tdnatives export TDNATIVES_CPP_BUILD_DIR=${PWD}/build-tdlib
export JAVA_SRC_DIR=${PWD}/src/tdnatives-java export JAVA_SRC_DIR=${PWD}/src/tdlib-java
export TDLIB_SERIALIZER_DIR=${PWD}/dependencies/tdlib-serializer export TDLIB_SERIALIZER_DIR=${PWD}/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" 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"
export TRAVIS_CPU_ARCH_JAVA="${TRAVIS_CPU_ARCH,,}" export TRAVIS_CPU_ARCH_JAVA="${TRAVIS_CPU_ARCH,,}"