diff --git a/.gitignore b/.gitignore index fcbf5ed..ac24c9e 100644 --- a/.gitignore +++ b/.gitignore @@ -58,8 +58,8 @@ tdlib.iml /bin-docs /bin-td -/bin-tdnatives +/bin-tdlib /build-td -/build-tdnatives +/build-tdlib __pycache__ -/src/tdnatives-java/it/tdlight/tdnatives/TdApi.java +/src/tdlib-java/it/tdlight/tdlib/TdApi.java diff --git a/build.sh b/build.sh index 802826b..7f71e95 100755 --- a/build.sh +++ b/build.sh @@ -3,12 +3,12 @@ # ====== Variables export TD_SRC_DIR=${PWD}/dependencies/tdlight export TD_BIN_DIR=${PWD}/bin-td -export TDNATIVES_BIN_DIR=${PWD}/bin-tdnatives -export TDNATIVES_CPP_SRC_DIR=${PWD}/src/tdnatives-cpp +export TDNATIVES_BIN_DIR=${PWD}/bin-tdlib +export TDNATIVES_CPP_SRC_DIR=${PWD}/src/tdlib-cpp export TDNATIVES_DOCS_BIN_DIR=${PWD}/bin-docs export TD_BUILD_DIR=${PWD}/build-td -export TDNATIVES_CPP_BUILD_DIR=${PWD}/build-tdnatives -export JAVA_SRC_DIR=${PWD}/src/tdnatives-java +export TDNATIVES_CPP_BUILD_DIR=${PWD}/build-tdlib +export JAVA_SRC_DIR=${PWD}/src/tdlib-java export TDLIB_SERIALIZER_DIR=${PWD}/dependencies/tdlib-serializer # ====== Print variables @@ -34,8 +34,8 @@ cmake --build $TDNATIVES_CPP_BUILD_DIR --target install -- -j4 # ====== Patch generated java code 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 -rm $JAVA_SRC_DIR/it/tdlight/tdnatives/TdApi.java -unexpand --tabs=2 $JAVA_SRC_DIR/it/tdlight/tdnatives/new_TdApi.java > $JAVA_SRC_DIR/it/tdlight/tdnatives/TdApi.java -rm $JAVA_SRC_DIR/it/tdlight/tdnatives/new_TdApi.java +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/tdlib/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/tdlib/new_TdApi.java diff --git a/src/tdnatives-cpp/CMakeLists.txt b/src/tdnatives-cpp/CMakeLists.txt index 4bc02a6..af207ac 100644 --- a/src/tdnatives-cpp/CMakeLists.txt +++ b/src/tdnatives-cpp/CMakeLists.txt @@ -26,7 +26,7 @@ message(STATUS "Java Source Directory: ${JAVA_SRC_DIR}") # Generating TdApi.java 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_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) @@ -51,7 +51,7 @@ add_custom_target(build_java ) 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} COMMENT "Generating Javadoc documentation" DEPENDS td_generate_java_api diff --git a/src/tdnatives-cpp/sources.txt b/src/tdnatives-cpp/sources.txt index bc8948c..d9d266f 100644 --- a/src/tdnatives-cpp/sources.txt +++ b/src/tdnatives-cpp/sources.txt @@ -1,3 +1,3 @@ -../src/tdnatives-java/it/tdlight/tdnatives/NativeClient.java -../src/tdnatives-java/it/tdlight/tdnatives/NativeLog.java -../src/tdnatives-java/it/tdlight/tdnatives/TdApi.java +../src/tdlib-java/it/tdlight/tdlib/NativeClient.java +../src/tdlib-java/it/tdlight/tdlib/NativeLog.java +../src/tdlib-java/it/tdlight/tdlib/TdApi.java diff --git a/src/tdnatives-java/it/tdlight/tdnatives/NativeClient.java b/src/tdnatives-java/it/tdlight/tdnatives/NativeClient.java index 23796d8..021de62 100644 --- a/src/tdnatives-java/it/tdlight/tdnatives/NativeClient.java +++ b/src/tdnatives-java/it/tdlight/tdnatives/NativeClient.java @@ -18,8 +18,8 @@ package it.tdlight.tdlight.natives; -import it.tdlight.tdnatives.TdApi.Function; -import it.tdlight.tdnatives.TdApi.Object; +import it.tdlight.tdlib.TdApi.Function; +import it.tdlight.tdlib.TdApi.Object; public class NativeClient { protected static native long createNativeClient(); diff --git a/travis/build_success.sh b/travis/build_success.sh index faa0deb..b8ef12e 100755 --- a/travis/build_success.sh +++ b/travis/build_success.sh @@ -68,10 +68,10 @@ if [ "$TRAVIS_OS_NAME_STANDARD" = "linux" ]; then # Patch 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 - rm $JAVA_SRC_DIR/it/tdlight/tdnatives/TdApi.java - unexpand --tabs=2 $JAVA_SRC_DIR/it/tdlight/tdnatives/new_TdApi.java > $JAVA_SRC_DIR/it/tdlight/tdnatives/TdApi.java - rm $JAVA_SRC_DIR/it/tdlight/tdnatives/new_TdApi.java + 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/tdlib/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/tdlib/new_TdApi.java # Upgrade the file of tdlight-java 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 cd $TRAVIS_BUILD_DIR/tdlight-java 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 [[ ! -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 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 push else diff --git a/travis/install_dependencies.sh b/travis/install_dependencies.sh index c5e2b31..fe16278 100755 --- a/travis/install_dependencies.sh +++ b/travis/install_dependencies.sh @@ -5,8 +5,8 @@ set -e source ./travis/setup_variables.sh # ====== 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/tdnatives/new_TdApi.java ] && rm $JAVA_SRC_DIR/it/tdlight/tdnatives/new_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/tdlib/new_TdApi.java ] && rm $JAVA_SRC_DIR/it/tdlight/tdlib/new_TdApi.java # ====== Environment setup [ -d $TRAVIS_BUILD_DIR/out ] || mkdir -p $TRAVIS_BUILD_DIR/out diff --git a/travis/setup_variables.sh b/travis/setup_variables.sh index 53802b5..c51fd18 100755 --- a/travis/setup_variables.sh +++ b/travis/setup_variables.sh @@ -4,12 +4,12 @@ set -e # ====== Variables export TD_SRC_DIR=${PWD}/dependencies/tdlight export TD_BIN_DIR=${PWD}/bin-td -export TDNATIVES_BIN_DIR=${PWD}/bin-tdnatives -export TDNATIVES_CPP_SRC_DIR=${PWD}/src/tdnatives-cpp +export TDNATIVES_BIN_DIR=${PWD}/bin-tdlib +export TDNATIVES_CPP_SRC_DIR=${PWD}/src/tdlib-cpp export TDNATIVES_DOCS_BIN_DIR=${PWD}/bin-docs export TD_BUILD_DIR=${PWD}/build-td -export TDNATIVES_CPP_BUILD_DIR=${PWD}/build-tdnatives -export JAVA_SRC_DIR=${PWD}/src/tdnatives-java +export TDNATIVES_CPP_BUILD_DIR=${PWD}/build-tdlib +export JAVA_SRC_DIR=${PWD}/src/tdlib-java 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 TRAVIS_CPU_ARCH_JAVA="${TRAVIS_CPU_ARCH,,}"