Revert "Update .gitignore, .travis.settings.xml, and 2 more files..."

This reverts commit e86f3cf020.
This commit is contained in:
Andrea 2020-08-19 12:44:38 +02:00
parent e86f3cf020
commit 7e394de3a5
4 changed files with 145 additions and 0 deletions

1
.gitignore vendored
View File

@ -62,3 +62,4 @@ tdlib.iml
/build-td
/build-tdnatives
__pycache__
/src/tdnatives-java/it/tdlight/tdnatives/TdApi.java

41
.travis.settings.xml Normal file
View File

@ -0,0 +1,41 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>github</id>
<name>GitHub OWNER Apache Maven Packages</name>
<url>https://maven.pkg.github.com/tdlight-team/tdlight-java</url>
</repository>
</repositories>
</profile>
</profiles>
<servers>
<server>
<id>github</id>
<username>Cavallium</username>
<password>${env.PACKAGECLOUD_TOKEN}</password>
</server>
</servers>
</settings>

62
.travis.yml Normal file
View File

@ -0,0 +1,62 @@
language: shell
os:
- linux
- windows
arch:
- amd64
- arm64
osx_image: xcode10.1
dist: bionic
before_install:
- cp .travis.settings.xml $HOME/.m2/settings.xml
addons:
apt:
update: true
packages:
- make
- git
- zlib1g-dev
- libssl-dev
- gperf
- php
- cmake
- g++
- ccache
- maven
- openjdk-11-jdk
- python3
cache:
bundler: true
cocoapods: true
ccache: true
directories:
- ".autoconf"
- "$HOME/.m2"
- "$HOME/.ccache"
deploy:
- provider: pages
skip-cleanup: true
github-token: $GITHUB_TOKEN
keep-history: true
local-dir: out/docs
repo: tdlight-team/tdlib-docs
target_branch: master
email: andrea@cavallium.it
name: "Andrea Cavalli"
verbose: true
# - provider: script
# skip-cleanup: true
# script: "mvn -B -V deploy"
script: |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
bash -e travis/linux.sh && bash -e travis/deploy_master.sh
fi
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
bash travis/win.sh;
bash travis/deploy_master.sh
fi

41
build.sh Executable file
View File

@ -0,0 +1,41 @@
#!/bin/bash -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_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 TDLIB_SERIALIZER_DIR=${PWD}/dependencies/tdlib-serializer
# ====== Print variables
echo "TD_SRC_DIR=${TD_SRC_DIR}"
echo "TD_BIN_DIR=${TD_BIN_DIR}"
echo "JAVA_SRC_DIR=${JAVA_SRC_DIR}"
# ====== Cleanup
# ====== Environment setup
mkdir $TD_BUILD_DIR || true
mkdir $TDNATIVES_CPP_BUILD_DIR || true
# ====== Build Td
cd $TD_BUILD_DIR
cmake -DCMAKE_BUILD_TYPE=Release -DTD_ENABLE_JNI=ON -DCMAKE_INSTALL_PREFIX:PATH=${TD_BIN_DIR} ${TD_SRC_DIR}
cmake --build $TD_BUILD_DIR --target install -- -j4
# ====== Build TdNatives
cd $TDNATIVES_CPP_BUILD_DIR
cmake -DCMAKE_BUILD_TYPE=Release -DTD_BIN_DIR=${TD_BIN_DIR} -DTDNATIVES_BIN_DIR=${TDNATIVES_BIN_DIR} -DTDNATIVES_DOCS_BIN_DIR=${TDNATIVES_DOCS_BIN_DIR} -DTd_DIR=${TD_BIN_DIR}/lib/cmake/Td -DJAVA_SRC_DIR=${JAVA_SRC_DIR} -DTDNATIVES_CPP_SRC_DIR:PATH=$TDNATIVES_CPP_SRC_DIR $TDNATIVES_CPP_SRC_DIR
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