From 2c6465d85dd414e85221b1bb51131cc7c76e3202 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Mon, 28 Dec 2020 19:52:17 +0100 Subject: [PATCH] Repository cleanup. Add README and reorganize directories --- .github/workflows/build.yaml | 10 +- .gitmodules | 6 +- .travis.settings.xml | 105 ------------------ .travis.yml | 70 ------------ README.md | 10 +- .../github-workflows}/build.sh | 0 .../github-workflows}/deploy-release.sh | 0 .../github-workflows}/deploy-snapshot.sh | 0 .../github-workflows}/install-dependencies.sh | 0 .../github-workflows}/setup-variables.sh | 0 .../build_generated_maven_project.sh | 2 +- scripts/{ => core}/clean-all.sh | 2 +- scripts/{ => core}/compile_td.sh | 15 +-- scripts/{ => core}/compile_tdjni.sh | 15 +-- scripts/{ => core}/deploy_release.sh | 6 +- scripts/{ => core}/deploy_snapshot.sh | 2 +- scripts/{ => core}/generate_maven_project.sh | 13 +-- scripts/{ => core}/generate_td_tools.sh | 15 +-- .../{ => core}/generate_tdapi_java_file.sh | 17 +-- .../core/tdlib-serializer | 0 scripts/run-all.sh | 15 --- scripts/utils/compile-all.sh | 19 ++++ .../main/jni-project-src/pom.template.xml | 0 travis/build.sh | 17 --- travis/build_success.sh | 11 -- travis/deploy.sh | 14 --- travis/install_dependencies.sh | 64 ----------- travis/setup_variables.sh | 85 -------------- 28 files changed, 81 insertions(+), 432 deletions(-) delete mode 100644 .travis.settings.xml delete mode 100644 .travis.yml rename {github-workflows => scripts/continuous-integration/github-workflows}/build.sh (100%) rename {github-workflows => scripts/continuous-integration/github-workflows}/deploy-release.sh (100%) rename {github-workflows => scripts/continuous-integration/github-workflows}/deploy-snapshot.sh (100%) rename {github-workflows => scripts/continuous-integration/github-workflows}/install-dependencies.sh (100%) rename {github-workflows => scripts/continuous-integration/github-workflows}/setup-variables.sh (100%) rename scripts/{ => core}/build_generated_maven_project.sh (88%) rename scripts/{ => core}/clean-all.sh (84%) rename scripts/{ => core}/compile_td.sh (82%) rename scripts/{ => core}/compile_tdjni.sh (90%) rename scripts/{ => core}/deploy_release.sh (68%) rename scripts/{ => core}/deploy_snapshot.sh (72%) rename scripts/{ => core}/generate_maven_project.sh (79%) rename scripts/{ => core}/generate_td_tools.sh (88%) rename scripts/{ => core}/generate_tdapi_java_file.sh (87%) rename tdlib-serializer => scripts/core/tdlib-serializer (100%) delete mode 100755 scripts/run-all.sh create mode 100755 scripts/utils/compile-all.sh rename pom.template.xml => src/main/jni-project-src/pom.template.xml (100%) delete mode 100755 travis/build.sh delete mode 100755 travis/build_success.sh delete mode 100755 travis/deploy.sh delete mode 100755 travis/install_dependencies.sh delete mode 100755 travis/setup_variables.sh diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 26dff40..cac04f3 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -78,7 +78,7 @@ jobs: export GH_MATRIX_ARCH=${{ matrix.arch }} export IMPLEMENTATION_NAME=${{ matrix.implementation }} - source ./github-workflows/setup-variables.sh + source ./scripts/continuous-integration/github-workflows/setup-variables.sh echo "REVISION=$REVISION" >> $GITHUB_ENV echo "IMPLEMENTATION_NAME=$IMPLEMENTATION_NAME" >> $GITHUB_ENV @@ -111,13 +111,13 @@ jobs: run: | echo "REVISION: $REVISION" - source ./github-workflows/install-dependencies.sh + source ./scripts/continuous-integration/github-workflows/install-dependencies.sh - name: Build shell: bash run: | echo "REVISION: $REVISION" - source ./github-workflows/build.sh + source ./scripts/continuous-integration/github-workflows/build.sh - id: getfilename shell: bash run: echo "::set-output name=file::$(cd generated/target; ls tdli*-natives-*.jar)" @@ -134,7 +134,7 @@ jobs: run: | echo "REVISION: $REVISION" - source ./github-workflows/deploy-snapshot.sh + source ./scripts/continuous-integration/github-workflows/deploy-snapshot.sh env: MAVEN_USERNAME: ${{ secrets.MCHV_USERNAME }} MAVEN_PASSWORD: ${{ secrets.MCHV_TOKEN }} @@ -144,7 +144,7 @@ jobs: run: | echo "REVISION: $REVISION" - source ./github-workflows/deploy-release.sh + source ./scripts/continuous-integration/github-workflows/deploy-release.sh env: MAVEN_USERNAME: ${{ secrets.MCHV_USERNAME }} MAVEN_PASSWORD: ${{ secrets.MCHV_TOKEN }} diff --git a/.gitmodules b/.gitmodules index 17b2fcf..68e52a5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ -[submodule "tdlib-serializer"] - path = tdlib-serializer - url = https://git.ignuranza.net/windoz/tdlib-serializer.git [submodule "implementations/tdlib"] path = implementations/tdlib url = https://github.com/tdlib/td.git [submodule "implementations/tdlight"] path = implementations/tdlight url = https://git.ignuranza.net/tdlight-team/tdlight.git +[submodule "scripts/core/tdlib-serializer"] + path = scripts/core/tdlib-serializer + url = https://git.ignuranza.net/windoz/tdlib-serializer.git diff --git a/.travis.settings.xml b/.travis.settings.xml deleted file mode 100644 index c681be3..0000000 --- a/.travis.settings.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - github - mchv-release - mchv-snapshot - mchv-release-distribution - mchv-snapshot-distribution - - - - - github - - - central - https://repo1.maven.org/maven2 - true - true - - - github - GitHub OWNER Apache Maven Packages - https://maven.pkg.github.com/tdlight-team/tdlight-java - - - - - mchv-release - - - mchv-release - MCHV Release Apache Maven Packages - https://mvn.mchv.eu/repository/mchv - - - - - mchv-snapshot - - - mchv-snapshot - MCHV Snapshot Apache Maven Packages - https://mvn.mchv.eu/repository/mchv-snapshot - - - - - mchv-release-distribution - - - mchv-release-distribution - MCHV Release Apache Maven Packages Distribution - https://mvn.mchv.eu/repository/mchv - - - - - mchv-snapshot-distribution - - - mchv-snapshot-distribution - MCHV Snapshot Apache Maven Packages Distribution - https://mvn.mchv.eu/repository/mchv-snapshot - - - - - - - - github - Cavallium - ${env.PACKAGECLOUD_TOKEN} - - - mchv - cavallium - ${env.MCHVCLOUD_TOKEN} - - - mchv-release - cavallium - ${env.MCHVCLOUD_TOKEN} - - - mchv-snapshot - cavallium - ${env.MCHVCLOUD_TOKEN} - - - mchv-release-distribution - cavallium - ${env.MCHVCLOUD_TOKEN} - - - mchv-snapshot-distribution - cavallium - ${env.MCHVCLOUD_TOKEN} - - - diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ee7e71a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,70 +0,0 @@ -language: shell - -os: - - linux - - windows - - osx -arch: - - amd64 - - arm64 -env: - - IMPLEMENTATION_NAME=tdlib CACHE_NAME=tdlib - - IMPLEMENTATION_NAME=tdlight CACHE_NAME=tdlight -osx_image: xcode11.3 -dist: bionic -before_install: - - cp .travis.settings.xml $HOME/.m2/settings.xml - - chmod +x travis/build.sh - - chmod +x travis/build_success.sh - - chmod +x travis/deploy.sh - - chmod +x travis/install_dependencies.sh - - chmod +x travis/setup_variables.sh -addons: - apt: - update: true - packages: - - make - - git - - zlib1g-dev - - libssl-dev - - gperf - - cmake - - clang-10 - - libc++-10-dev - - libc++abi-10-dev - - ccache - - maven - - python3 - - python3-pip - - php7.2-cli - - openjdk-11-jdk -cache: - bundler: true - cocoapods: true - ccache: true - directories: - - ".autoconf" - - "$HOME/.m2" - - "$HOME/.ccache" - - "$HOME/pip" - -#deploy: -# - provider: pages -# skip-cleanup: true -# github-token: $GITHUB_TOKEN -# keep-history: false -# local-dir: out/docs -# repo: tdlight-team/tdlight-docs -# target_branch: master -# email: andrea@cavallium.it -# name: "Andrea Cavalli" -# verbose: true -# on: -# branch: dev -# condition: $TRAVIS_OS_NAME = linux && $TRAVIS_CPU_ARCH = amd64 - -install: ./travis/install_dependencies.sh -script: ./travis/build.sh -after_success: - - if [ "$TRAVIS_BRANCH" = "develop" ]; then ./travis/build_success.sh; fi - - if [ "$TRAVIS_BRANCH" = "master" ]; then ./travis/deploy.sh; fi diff --git a/README.md b/README.md index 3760ce7..d45cba3 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,10 @@ -Native libraries used by TDLight Java +# Native libraries used by TDLight Java +This repository generates JNI packages for each architecture and OS used by [TDLight Java](https://github.com/tdlight-team/tdlight-java). +## Building +Go to `scripts/utils` and run `./compile-all.sh` + +## Download +Download the latest release of [TDLight Java](https://github.com/tdlight-team/tdlight-java/releases) + +If you want to download directly the native packages for each architecture and os, go to Actions tab and click on the latest build. diff --git a/github-workflows/build.sh b/scripts/continuous-integration/github-workflows/build.sh similarity index 100% rename from github-workflows/build.sh rename to scripts/continuous-integration/github-workflows/build.sh diff --git a/github-workflows/deploy-release.sh b/scripts/continuous-integration/github-workflows/deploy-release.sh similarity index 100% rename from github-workflows/deploy-release.sh rename to scripts/continuous-integration/github-workflows/deploy-release.sh diff --git a/github-workflows/deploy-snapshot.sh b/scripts/continuous-integration/github-workflows/deploy-snapshot.sh similarity index 100% rename from github-workflows/deploy-snapshot.sh rename to scripts/continuous-integration/github-workflows/deploy-snapshot.sh diff --git a/github-workflows/install-dependencies.sh b/scripts/continuous-integration/github-workflows/install-dependencies.sh similarity index 100% rename from github-workflows/install-dependencies.sh rename to scripts/continuous-integration/github-workflows/install-dependencies.sh diff --git a/github-workflows/setup-variables.sh b/scripts/continuous-integration/github-workflows/setup-variables.sh similarity index 100% rename from github-workflows/setup-variables.sh rename to scripts/continuous-integration/github-workflows/setup-variables.sh diff --git a/scripts/build_generated_maven_project.sh b/scripts/core/build_generated_maven_project.sh similarity index 88% rename from scripts/build_generated_maven_project.sh rename to scripts/core/build_generated_maven_project.sh index cfecc84..50e4831 100755 --- a/scripts/build_generated_maven_project.sh +++ b/scripts/core/build_generated_maven_project.sh @@ -1,5 +1,5 @@ #!/bin/bash -e -cd ../generated +cd ../../generated [ -f ./src/main/java/it/tdlight/jni/TdApi.java ] && rm ./src/main/java/it/tdlight/jni/TdApi.java mvn clean package diff --git a/scripts/clean-all.sh b/scripts/core/clean-all.sh similarity index 84% rename from scripts/clean-all.sh rename to scripts/core/clean-all.sh index 30e05d2..bb43fbd 100755 --- a/scripts/clean-all.sh +++ b/scripts/core/clean-all.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -cd ../ +cd ../../ rm -r generated diff --git a/scripts/compile_td.sh b/scripts/core/compile_td.sh similarity index 82% rename from scripts/compile_td.sh rename to scripts/core/compile_td.sh index 1d5cfeb..b761bad 100755 --- a/scripts/compile_td.sh +++ b/scripts/core/compile_td.sh @@ -1,10 +1,11 @@ #!/bin/bash -e -# REQUIRED PARAMETERS: -# OPERATING_SYSTEM_NAME = -# CPU_ARCHITECTURE_NAME = -# IMPLEMENTATION_NAME = -# CPU_CORES = -# CMAKE_EXTRA_ARGUMENTS = +# MAIN REQUIRED ENVIRONMENT VARIABLES: +# OPERATING_SYSTEM_NAME = +# CPU_ARCHITECTURE_NAME = +# IMPLEMENTATION_NAME = +# CPU_CORES = "-- -j" or "-m" on Windows +# OTHER REQUIRED ENVIRONMENT VARIABLES: +# CMAKE_EXTRA_ARGUMENTS = # Check variables correctness if [ -z "${OPERATING_SYSTEM_NAME}" ]; then @@ -24,7 +25,7 @@ if [ -z "${CPU_CORES}" ]; then exit 1 fi -cd ../ +cd ../../ # Print details echo "Compiling td..." diff --git a/scripts/compile_tdjni.sh b/scripts/core/compile_tdjni.sh similarity index 90% rename from scripts/compile_tdjni.sh rename to scripts/core/compile_tdjni.sh index 801a08e..8c0c37d 100755 --- a/scripts/compile_tdjni.sh +++ b/scripts/core/compile_tdjni.sh @@ -1,10 +1,11 @@ #!/bin/bash -e -# REQUIRED PARAMETERS: -# OPERATING_SYSTEM_NAME = -# CPU_ARCHITECTURE_NAME = -# IMPLEMENTATION_NAME = -# CPU_CORES = -# CMAKE_EXTRA_ARGUMENTS = +# MAIN REQUIRED ENVIRONMENT VARIABLES: +# OPERATING_SYSTEM_NAME = +# CPU_ARCHITECTURE_NAME = +# IMPLEMENTATION_NAME = +# CPU_CORES = "-- -j" or "-m" on Windows +# OTHER REQUIRED ENVIRONMENT VARIABLES: +# CMAKE_EXTRA_ARGUMENTS = # Check variables correctness if [ -z "${OPERATING_SYSTEM_NAME}" ]; then @@ -24,7 +25,7 @@ if [ -z "${CPU_CORES}" ]; then exit 1 fi -cd ../ +cd ../../ # Print details echo "Compiling tdjni..." diff --git a/scripts/deploy_release.sh b/scripts/core/deploy_release.sh similarity index 68% rename from scripts/deploy_release.sh rename to scripts/core/deploy_release.sh index 5ad5d9f..ef19ae4 100755 --- a/scripts/deploy_release.sh +++ b/scripts/core/deploy_release.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -# REQUIRED PARAMETERS: -# REVISION = +# OTHER REQUIRED ENVIRONMENT VARIABLES: +# REVISION = # Check variables correctness if [ -z "${REVISION}" ]; then @@ -8,7 +8,7 @@ if [ -z "${REVISION}" ]; then exit 1 fi -cd ../generated +cd ../../generated mvn -B -Drevision=${REVISION} clean deploy diff --git a/scripts/deploy_snapshot.sh b/scripts/core/deploy_snapshot.sh similarity index 72% rename from scripts/deploy_snapshot.sh rename to scripts/core/deploy_snapshot.sh index 327f2fe..c405693 100755 --- a/scripts/deploy_snapshot.sh +++ b/scripts/core/deploy_snapshot.sh @@ -1,5 +1,5 @@ #!/bin/bash -e -cd ../generated +cd ../../generated mvn -B deploy diff --git a/scripts/generate_maven_project.sh b/scripts/core/generate_maven_project.sh similarity index 79% rename from scripts/generate_maven_project.sh rename to scripts/core/generate_maven_project.sh index 374206e..cc6e4c9 100755 --- a/scripts/generate_maven_project.sh +++ b/scripts/core/generate_maven_project.sh @@ -1,8 +1,8 @@ #!/bin/bash -e -# REQUIRED PARAMETERS: -# OPERATING_SYSTEM_NAME = -# CPU_ARCHITECTURE_NAME = -# IMPLEMENTATION_NAME = +# MAIN REQUIRED ENVIRONMENT VARIABLES: +# OPERATING_SYSTEM_NAME = +# CPU_ARCHITECTURE_NAME = +# IMPLEMENTATION_NAME = # Check variables correctness if [ -z "${OPERATING_SYSTEM_NAME}" ]; then @@ -18,7 +18,7 @@ if [ -z "${IMPLEMENTATION_NAME}" ]; then exit 1 fi -cd ../ +cd ../../ # Print details echo "Generating maven project..." @@ -26,7 +26,6 @@ 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..." @@ -42,7 +41,7 @@ echo "Creating missing folders..." # Generate pom.xml echo "Generating pom.xml..." -sed -f "src/main/replacements/replace-${OPERATING_SYSTEM_NAME}-${CPU_ARCHITECTURE_NAME}-${IMPLEMENTATION_NAME}.sed" pom.template.xml > generated/pom.xml +sed -f "src/main/replacements/replace-${OPERATING_SYSTEM_NAME}-${CPU_ARCHITECTURE_NAME}-${IMPLEMENTATION_NAME}.sed" src/main/jni-project-src/pom.template.xml > generated/pom.xml # Copy source files echo "Copying source files..." diff --git a/scripts/generate_td_tools.sh b/scripts/core/generate_td_tools.sh similarity index 88% rename from scripts/generate_td_tools.sh rename to scripts/core/generate_td_tools.sh index e5182f5..b7489c9 100755 --- a/scripts/generate_td_tools.sh +++ b/scripts/core/generate_td_tools.sh @@ -1,10 +1,11 @@ #!/bin/bash -e -# REQUIRED PARAMETERS: -# OPERATING_SYSTEM_NAME = -# CPU_ARCHITECTURE_NAME = -# IMPLEMENTATION_NAME = -# CPU_CORES = -# CMAKE_EXTRA_ARGUMENTS = +# MAIN REQUIRED ENVIRONMENT VARIABLES: +# OPERATING_SYSTEM_NAME = +# CPU_ARCHITECTURE_NAME = +# IMPLEMENTATION_NAME = +# CPU_CORES = "-- -j" or "-m" on Windows +# OTHER REQUIRED ENVIRONMENT VARIABLES: +# CMAKE_EXTRA_ARGUMENTS = # Check variables correctness if [ -z "${OPERATING_SYSTEM_NAME}" ]; then @@ -24,7 +25,7 @@ if [ -z "${CPU_CORES}" ]; then exit 1 fi -cd ../ +cd ../../ # Print details echo "Generating td tools..." diff --git a/scripts/generate_tdapi_java_file.sh b/scripts/core/generate_tdapi_java_file.sh similarity index 87% rename from scripts/generate_tdapi_java_file.sh rename to scripts/core/generate_tdapi_java_file.sh index 2b20325..a441122 100755 --- a/scripts/generate_tdapi_java_file.sh +++ b/scripts/core/generate_tdapi_java_file.sh @@ -1,10 +1,11 @@ #!/bin/bash -e -# REQUIRED PARAMETERS: -# OPERATING_SYSTEM_NAME = -# CPU_ARCHITECTURE_NAME = -# IMPLEMENTATION_NAME = -# CPU_CORES = -# CMAKE_EXTRA_ARGUMENTS = +# MAIN REQUIRED ENVIRONMENT VARIABLES: +# OPERATING_SYSTEM_NAME = +# CPU_ARCHITECTURE_NAME = +# IMPLEMENTATION_NAME = +# CPU_CORES = "-- -j" or "-m" on Windows +# OTHER REQUIRED ENVIRONMENT VARIABLES: +# CMAKE_EXTRA_ARGUMENTS = # Check variables correctness if [ -z "${OPERATING_SYSTEM_NAME}" ]; then @@ -24,7 +25,7 @@ if [ -z "${CPU_CORES}" ]; then exit 1 fi -cd ../ +cd ../../ # Print details echo "Generating TdApi.java..." @@ -103,7 +104,7 @@ cmake --build . --target td_generate_java_api --config Release ${CPU_CORES} cd .. echo "Patching TdApi.java..." -${PYTHON_EXECUTABLE} ../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) +${PYTHON_EXECUTABLE} ../scripts/core/tdlib-serializer/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 ../scripts/core/tdlib-serializer/tdlib-serializer/headers.txt) rm ./src/main/jni-java-src/it/tdlight/jni/TdApi.java if [[ "$OPERATING_SYSTEM_NAME" == "osx" ]]; then unexpand --tabs=2 ./src/main/jni-java-src/it/tdlight/jni/new_TdApi.java > ./src/main/jni-java-src/it/tdlight/jni/TdApi.java diff --git a/tdlib-serializer b/scripts/core/tdlib-serializer similarity index 100% rename from tdlib-serializer rename to scripts/core/tdlib-serializer diff --git a/scripts/run-all.sh b/scripts/run-all.sh deleted file mode 100755 index c2269b6..0000000 --- a/scripts/run-all.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -e -# REQUIRED PARAMETERS: -# OPERATING_SYSTEM_NAME = -# CPU_ARCHITECTURE_NAME = -# IMPLEMENTATION_NAME = -# CPU_CORES = - -./generate_maven_project.sh -./generate_td_tools.sh -./compile_td.sh -./compile_tdjni.sh -./build_generated_maven_project.sh - -echo "Done." -exit 0 diff --git a/scripts/utils/compile-all.sh b/scripts/utils/compile-all.sh new file mode 100755 index 0000000..b608877 --- /dev/null +++ b/scripts/utils/compile-all.sh @@ -0,0 +1,19 @@ +#!/bin/bash -e +# MAIN REQUIRED ENVIRONMENT VARIABLES: +# OPERATING_SYSTEM_NAME = +# CPU_ARCHITECTURE_NAME = +# IMPLEMENTATION_NAME = +# CPU_CORES = "-- -j" or "-m" on Windows +# CMAKE_EXTRA_ARGUMENTS = +# REVISION = + +cd ../core + +./generate_maven_project.sh +./generate_td_tools.sh +./compile_td.sh +./compile_tdjni.sh +./build_generated_maven_project.sh + +echo "Done." +exit 0 diff --git a/pom.template.xml b/src/main/jni-project-src/pom.template.xml similarity index 100% rename from pom.template.xml rename to src/main/jni-project-src/pom.template.xml diff --git a/travis/build.sh b/travis/build.sh deleted file mode 100755 index e90099e..0000000 --- a/travis/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/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/ -./generate_maven_project.sh -./generate_td_tools.sh -./compile_td.sh -./compile_tdjni.sh -./build_generated_maven_project.sh - -echo "Done." -exit 0 diff --git a/travis/build_success.sh b/travis/build_success.sh deleted file mode 100755 index 56d89b1..0000000 --- a/travis/build_success.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -e -set -e - -source ./travis/setup_variables.sh - -cd ./scripts/ - -./deploy_snapshot.sh - -echo "Build success" -exit 0 diff --git a/travis/deploy.sh b/travis/deploy.sh deleted file mode 100755 index 01655a2..0000000 --- a/travis/deploy.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/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 diff --git a/travis/install_dependencies.sh b/travis/install_dependencies.sh deleted file mode 100755 index 684225c..0000000 --- a/travis/install_dependencies.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -e -set -e - -# ====== Setup environment variables -source ./travis/setup_variables.sh - -if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - echo "==Linux====" -elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - echo "==OSX======" - export PYTHON=36 - brew install swig; - curl -LO https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci; - source ./macports-ci install; - yes | sudo port install python$PYTHON; - yes | sudo port install py$PYTHON-pip; - sudo port select --set python3 python$PYTHON; - sudo port select --set pip pip$PYTHON; - pip install pyinstaller --user; - export PATH=$PATH:$(python3 -c "import site; print(site.USER_BASE)")/bin; - brew install gperf openssl coreutils - - # Precompile .tlo files because of a bug in travis/macOs - cd ./implementations/tdlight/td/generate/tl-parser/ - echo "Configuring tl-parser" - ./configure - echo "Compiling tl-parser" - make - cd .. - echo "Running tl-parser on mtproto_api" - ./tl-parser/bin/tl-parser -v -e scheme/mtproto_api.tlo scheme/mtproto_api.tl - echo "Running tl-parser on secret_api" - ./tl-parser/bin/tl-parser -v -e scheme/secret_api.tlo scheme/secret_api.tl - echo "Running tl-parser on telegram_api" - ./tl-parser/bin/tl-parser -v -e scheme/telegram_api.tlo scheme/telegram_api.tl - echo "Running tl-parser on td_api" - ./tl-parser/bin/tl-parser -v -e scheme/td_api.tlo scheme/td_api.tl - echo "Done .tlo" -elif [[ "$TRAVIS_OS_NAME" == "windows" ]]; then - echo "==Windows==" - choco install ccache - choco install make - choco install windows-sdk-10.1 - choco install visualstudio2019buildtools --version=16.7.0.0 --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64" - choco install openjdk11 --version=11.0.8.10 - choco install maven --version=3.6.3 - choco install base64 - choco install gperf - choco install strawberryperl - choco install nasm - choco install php --version=7.4.9 --package-parameters='"/ThreadSafe ""/InstallDir:C:\PHP"""' - choco install python3 --params "/InstallDir:C:\Python3" - - [ -d ./windowsenv/ ] && $(yes | rm -rf ./windowsenv/) - [ -d $VCPKG_DIR ] && $(yes | rm -rf $VCPKG_DIR) - git clone --depth=1 https://github.com/tdlight-team/windows-amd64-prebuilt-libraries.git windowsenv - mv windowsenv/vcpkg $VCPKG_DIR - cd $VCPKG_DIR - ./vcpkg integrate install -else - echo "Unrecognized os: $TRAVIS_OS_NAME" - exit 1 -fi - diff --git a/travis/setup_variables.sh b/travis/setup_variables.sh deleted file mode 100755 index e289210..0000000 --- a/travis/setup_variables.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/bash -e -set -e - -# ====== Variables -export REVISION=$TRAVIS_BUILD_NUMBER -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" -if [ "$TRAVIS_CPU_ARCH" = "arm64" ]; then - export CPU_ARCHITECTURE_NAME="aarch64" - export CPU_CORES_NUM="2" -else - CPU_ARCHITECTURE_NAME="$(tr '[:upper:]' '[:lower:]'<<<"${TRAVIS_CPU_ARCH}")" - export CPU_ARCHITECTURE_NAME; - export CPU_CORES_NUM="2" -fi -OPERATING_SYSTEM_NAME="$(tr '[:upper:]' '[:lower:]'<<<"${TRAVIS_OS_NAME}")" -export OPERATING_SYSTEM_NAME -if [ "$OPERATING_SYSTEM_NAME" = "windows" ]; then - export OPERATING_SYSTEM_NAME_SHORT="win" -else - export OPERATING_SYSTEM_NAME_SHORT=$OPERATING_SYSTEM_NAME -fi - -echo "====== Setup variables ======" -echo "Current root directory:" -echo "$(realpath .)" -echo "=============================" - -# ====== OS Variables -if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then - export VCPKG_DIR="$(realpath .)/vcpkg" - export CMAKE_EXTRA_ARGUMENTS="-A x64 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$VCPKG_DIR/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DOPENSSL_USE_STATIC_LIBS=ON" - export PATH="/c/Python3:$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 CPU_CORES=" -- -m" - export CMAKE_BUILD_TYPE=Release -elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - export CMAKE_EXTRA_ARGUMENTS="-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/" - 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" - export CPU_CORES=" -- -j${CPU_CORES_NUM}" -elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - if [[ "$CPU_ARCHITECTURE_NAME" = "aarch64" ]]; then - export CMAKE_EXTRA_ARGUMENTS="" - export CXXFLAGS="-static-libgcc -static-libstdc++" - else - export CMAKE_EXTRA_ARGUMENTS="-DOPENSSL_USE_STATIC_LIBS=ON -DCMAKE_FIND_LIBRARY_SUFFIXES=\".a\"" - export CXXFLAGS="-static-libgcc -static-libstdc++" - fi - 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" - export CPU_CORES=" -- -j${CPU_CORES_NUM}" - export CC="/usr/bin/clang-10" - export CXX="/usr/bin/clang++-10" -fi - -# ====== Print variables -echo "REVISION=${REVISION}" -echo "TD_SRC_DIR=${TD_SRC_DIR}" -echo "TD_BIN_DIR=${TD_BIN_DIR}" -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 "TDNATIVES_CPP_BUILD_DIR=${TDNATIVES_CPP_BUILD_DIR}" -echo "JAVA_SRC_DIR=${JAVA_SRC_DIR}" -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 "CPU_ARCHITECTURE_NAME=${CPU_ARCHITECTURE_NAME}" -echo "CPU_CORES_NUM=${CPU_CORES_NUM}" -echo "CPU_CORES=${CPU_CORES}" -echo "TRAVIS_OS_NAME=${TRAVIS_OS_NAME}" -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}"