Compare commits

...

29 Commits

Author SHA1 Message Date
Andrea Cavalli
1eeea32717 Update tdlight-java 2020-10-09 21:01:16 +02:00
Andrea Cavalli
c7ba1bbf5d Static compilation 2020-10-09 21:01:06 +02:00
Andrea Cavalli
f1e710929f Update cross_compile.sh 2020-10-09 03:29:01 +02:00
Andrea Cavalli
c4c608c511 Update dockerfile and cross_compile.sh 2020-10-09 02:29:53 +02:00
Andrea Cavalli
03a5108d61 Update cross_compile.sh 2020-10-08 20:24:56 +02:00
Andrea Cavalli
972e80d5f5 Add missing libraries 2020-10-08 19:43:09 +02:00
Andrea Cavalli
5b1aa1d2b6 Update pom.xml 2020-10-08 12:32:09 +02:00
Andrea Cavalli
4cbf6c2568 Update cross_compile.sh 2020-10-08 04:34:21 +02:00
Andrea Cavalli
25fe68f999 Update dockerfile and cross_compile.sh 2020-10-08 03:44:19 +02:00
Andrea Cavalli
9940a8e49d Update dockerfile 2020-10-08 02:46:45 +02:00
Andrea Cavalli
bcdfb14502 Fix permissions 2020-10-08 02:25:33 +02:00
Andrea Cavalli
5c02945088 Reduce load 2020-10-08 01:49:46 +02:00
Andrea Cavalli
2f08718bff Update cross_compile.sh 2020-10-08 01:34:54 +02:00
Andrea Cavalli
52d4e3f742 Update dockerfile 2020-10-08 01:29:28 +02:00
Andrea Cavalli
41e5137fa9 Update dockerfile 2020-10-08 01:28:08 +02:00
Andrea Cavalli
85bfa22c1c Update .gitmodules 2020-10-08 01:18:30 +02:00
Andrea Cavalli
0e9bea6c60 Update dockerfile, dockerfile, and 6 more files... 2020-10-08 01:11:46 +02:00
Andrea Cavalli
909ccc1b11 Update Jenkinsfile 2020-10-08 01:06:36 +02:00
Andrea Cavalli
83ad66dea5 Update tdlight-java 2020-10-08 01:05:55 +02:00
Andrea Cavalli
27779e19b2 Update pom.xml 2020-10-03 13:49:50 +02:00
Andrea Cavalli
149cd00bf1 Update .gitmodules, Jenkinsfile, and 4 more files... 2020-10-03 12:03:12 +02:00
Andrea Cavalli
20b64da5d0 Update pom.xml 2020-08-23 13:34:07 +02:00
Andrea Cavalli
4f37097d6b Updated native library 2020-08-20 23:25:40 +02:00
Andrea Cavalli
76c0e29e0d Updated native library 2020-08-20 23:17:21 +02:00
Andrea Cavalli
912d7428b6 Updated native library 2020-08-20 23:16:58 +02:00
Andrea Cavalli
84c65c40e0 Updated native library 2020-08-20 20:25:53 +00:00
Andrea Cavalli
fc07248096 Update pom.xml 2020-08-20 22:22:26 +02:00
Andrea Cavalli
99de50cd92 Updated native library 2020-08-20 19:44:01 +00:00
Andrea Cavalli
5b5cbaac5e Update pom.xml 2020-08-20 16:06:12 +02:00
13 changed files with 557 additions and 51 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "tdlight-java"]
path = tdlight-java
url = https://git.ignuranza.net/tdlight-team/tdlight-java.git

113
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,113 @@
#!/usr/bin/env groovy
// see https://jenkins.io/doc/book/pipeline/syntax/
pipeline {
environment {
MVN_SET = credentials('maven_settings')
JAVA_TOOL_OPTIONS = '-Duser.home=/var/maven'
}
agent any
options {
timestamps()
ansiColor("xterm")
}
parameters {
booleanParam(name: "RELEASE",
description: "Build a release from current commit.",
defaultValue: false)
}
stages {
stage("Setup workspace") {
agent none
steps {
sh "mkdir -p \"/var/jenkins_cache/.m2\""
sh "chown 1000:1000 -R \"/var/jenkins_cache/.m2\""
sh "mkdir -p \"/var/jenkins_cache/.ccache\""
sh "chown 1000:1000 -R \"/var/jenkins_cache/.ccache\""
sh "mkdir -p \"/var/jenkins_cache/.ccache_arm64\""
sh "chown 1000:1000 -R \"/var/jenkins_cache/.ccache_arm64\""
//sh "mkdir -p \"${workspace}/tdlight-java/src/main\""
//sh "chown 1000:1000 -R \"${workspace}\""
//sh "chmod 771 -R \"${workspace}\""
}
}
stage("Prepare native C++") {
agent {
dockerfile {
dir 'jenkins/docker/native'
filename 'dockerfile'
additionalBuildArgs '--build-arg version=1.0.0 --build-arg UID=1000 --build-arg GID=1000 --build-arg UNAME=jenkins'
args "-v \"${workspace}/src/main:/home/jenkins/output:rw\" -v \"/var/jenkins_cache/.m2:/home/jenkins/.m2:rw\" -v \"/var/jenkins_cache/.ccache:/home/jenkins/.ccache:rw\" -v \"${workspace}:/home/jenkins/work:rw\""
reuseNode true
}
}
steps {
sh "./jenkins/scripts/prepare_cross.sh"
}
}
stage("Cross compile C++") {
agent {
dockerfile {
dir 'jenkins/docker/win64'
filename 'dockerfile'
additionalBuildArgs '--build-arg version=1.0.0 --build-arg UID=1000 --build-arg GID=1000 --build-arg UNAME=jenkins'
args "-v \"${workspace}/src/main:/home/jenkins/output:rw\" -v \"/var/jenkins_cache/.m2:/home/jenkins/.m2:rw\" -v \"/var/jenkins_cache/.ccache_arm64:/home/jenkins/.ccache:rw\" -v \"${workspace}:/home/jenkins/work:rw\""
reuseNode true
}
}
steps {
sh "./jenkins/scripts/cross_compile.sh"
}
}
stage("Build & Deploy SNAPSHOT") {
agent {
docker {
image 'maven:3.6.3-openjdk-11'
args '-v $HOME:/var/maven'
reuseNode true
}
}
steps {
sh "mvn -s $MVN_SET -B deploy"
}
}
stage("Release") {
agent {
docker {
image 'maven:3.6.3-openjdk-11'
args '-v $HOME:/var/maven'
reuseNode true
}
}
when {
expression { params.RELEASE }
}
steps {
sh "git config user.email \"jenkins@mchv.eu\""
sh "git config user.name \"Jenkins\""
sh "git add --all; git commit -m \"Add generated files\""
sh "mvn -s $MVN_SET -DpushChanges=false -DlocalCheckout=true -DpreparationGoals=initialize release:prepare release:perform -B"
}
}
stage('Deliver') {
agent {
docker {
image 'maven:3.6.3-openjdk-11'
args '-v $HOME:/var/maven'
reuseNode true
}
}
steps {
sh './jenkins/scripts/deliver.sh'
}
}
}
post {
always {
deleteDir()
}
}
}

View File

@ -0,0 +1,58 @@
FROM debian:stable-slim
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get upgrade -y
RUN apt-get install wget -y
RUN wget https://cdn.azul.com/zulu/bin/zulu11.41.23-ca-jdk11.0.8-linux_amd64.deb -O /tmp/install.deb 2>/dev/null
RUN mkdir -p /usr/share/man/man1
RUN apt-get install /tmp/install.deb -y
RUN apt-get install sudo -y
RUN apt-get install maven -y
RUN apt-get install gcc gperf make cmake ccache -y
#RUN apt-get install clang libc++-dev libc++abi-dev -y
RUN apt-get install libssl-dev:amd64 zlib1g-dev:amd64 -y
RUN apt-get install build-essential -y
RUN apt-get install php-fpm php-cli -y
RUN apt-get install libreadline-dev git -y
ARG UNAME=debian
ARG UID=1000
ARG GID=1000
RUN groupadd -g $GID -o $UNAME
RUN useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME
RUN usermod -a -G sudo $UNAME
RUN echo "$UNAME ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
USER $UNAME
RUN mkdir /home/$UNAME/work
RUN mkdir /home/$UNAME/output
WORKDIR /home/$UNAME/work
ENV CCACHE_DIR=/home/$UNAME/.ccache
ENV JAVA_HOME=/usr/lib/jvm/zulu-11-amd64
ENV JAVA_INCLUDE_PATH=/usr/lib/jvm/zulu-11-amd64/include
ENV JAVA_INCLUDE_PATH2=/usr/lib/jvm/zulu-11-amd64/include/linux
ENV JAVA_AWT_INCLUDE_PATH=/usr/lib/jvm/zulu-11-amd64/include
ENV JAVA_AWT_LIBRARY=/usr/lib/jvm/zulu-11-amd64/lib
ENV JAVA_JVM_LIBRARY=/usr/lib/jvm/zulu-11-amd64/lib
ENV TRAVIS_CPU_ARCH=amd64
ENV TRAVIS_OS_NAME=linux
ENV TRAVIS_BUILD_DIR=/home/$UNAME/work
ENV TRAVIS_OUTPUT_DIR=/home/$UNAME/output
CMD ["bash"]

View File

@ -0,0 +1,89 @@
FROM debian:stable-slim
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get upgrade -y
RUN apt-get install wget -y
RUN wget https://cdn.azul.com/zulu/bin/zulu11.41.23-ca-jdk11.0.8-linux_amd64.deb -O /tmp/install.deb 2>/dev/null
RUN mkdir -p /usr/share/man/man1
RUN apt-get install /tmp/install.deb -y
RUN apt-get install sudo -y
RUN apt-get install maven -y
RUN apt-get install gcc gperf make cmake ccache -y
RUN sudo apt-get install mingw-w64 -y
RUN apt-get install libssl-dev:amd64 zlib1g-dev:amd64 -y
RUN apt-get install python3 -y
RUN apt-get install php-fpm php-cli -y
RUN apt-get install libreadline-dev git -y
RUN apt install unzip -y
ARG UNAME=debian
ARG UID=1000
ARG GID=1000
RUN groupadd -g $GID -o $UNAME
RUN useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME
RUN usermod -a -G sudo $UNAME
RUN echo "$UNAME ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
USER $UNAME
RUN mkdir /home/$UNAME/work
RUN mkdir /home/$UNAME/output
WORKDIR /home/$UNAME/work
ENV CCACHE_DIR=/home/$UNAME/.ccache
ENV JAVA_HOME=/usr/lib/jvm/zulu-11-amd64
ENV JAVA_INCLUDE_PATH=/usr/lib/jvm/zulu-11-amd64/include
ENV JAVA_INCLUDE_PATH2=/usr/lib/jvm/zulu-11-amd64/include/linux
ENV JAVA_AWT_INCLUDE_PATH=/usr/lib/jvm/zulu-11-amd64/include
ENV JAVA_AWT_LIBRARY=/usr/lib/jvm/zulu-11-amd64/lib
ENV JAVA_JVM_LIBRARY=/usr/lib/jvm/zulu-11-amd64/lib
ENV TRAVIS_CPU_ARCH=amd64
ENV TRAVIS_OS_NAME=windows
ENV TRAVIS_BUILD_DIR=/home/$UNAME/work
ENV TRAVIS_OUTPUT_DIR=/home/$UNAME/output
RUN sudo rm -r /home/$UNAME/openssl_cross || true
RUN sudo git clone --depth 1 --branch OpenSSL_1_1_1-stable --single-branch https://github.com/openssl/openssl.git /home/$UNAME/openssl_cross
RUN sudo chown -R $UNAME:$UNAME /home/$UNAME/openssl_cross
RUN sudo rm -r /home/$UNAME/zlib_cross || true
RUN sudo git clone --depth 1 --branch v1.2.11 --single-branch https://github.com/madler/zlib.git /home/$UNAME/zlib_cross
RUN sudo chown -R $UNAME:$UNAME /home/$UNAME/zlib_cross
RUN sudo rm -r /home/$UNAME/java11_cross || true
RUN sudo mkdir /home/$UNAME/java11_cross
RUN sudo chown -R $UNAME:$UNAME /home/$UNAME/java11_cross
RUN cd /home/$UNAME/java11_cross && \
wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.8%2B10/OpenJDK11U-jdk_x64_windows_hotspot_11.0.8_10.zip -O /home/$UNAME/java11_cross/jdk.zip 2>/dev/null && \
unzip /home/$UNAME/java11_cross/jdk.zip -d /home/$UNAME/java11_cross/ && \
mv /home/$UNAME/java11_cross/jdk-11.0.8+10/ /home/$UNAME/java11_cross/jdk
RUN cd /home/$UNAME/zlib_cross && \
export CC=x86_64-w64-mingw32-gcc-posix && \
nice -n 5 chrt -b 0 ./configure --prefix=/home/$UNAME/zlib_cross && \
nice -n 5 chrt -b 0 make -f win32/Makefile.gcc BINARY_PATH=/home/$UNAME/zlib_cross/bin INCLUDE_PATH=/home/$UNAME/zlib_cross/include LIBRARY_PATH=/home/$UNAME/zlib_cross/lib PREFIX=x86_64-w64-mingw32- install
RUN cd /home/$UNAME/openssl_cross && \
export CC="" && \
nice -n 5 chrt -b 0 ./Configure --cross-compile-prefix=x86_64-w64-mingw32- --prefix=/home/$UNAME/openssl_cross_dir --openssldir=/home/$UNAME/openssl_cross_dir mingw64 shared no-zlib no-comp && \
nice -n 5 chrt -b 0 make 2>&1 | tee make.log && \
nice -n 5 chrt -b 0 sudo make install
RUN cd /home/$UNAME/work
CMD ["bash"]

View File

@ -0,0 +1,98 @@
#!/bin/bash -e
# ====== Setup workspace
cd $TRAVIS_BUILD_DIR
source ./jenkins/scripts/setup_workspace.sh
export JAVA_HOME=/usr/lib/jvm/zulu-11-amd64
export JAVA_AWT_LIBRARY=/home/jenkins/java11_cross/jdk/lib/jawt.lib
export JAVA_JVM_LIBRARY=/home/jenkins/java11_cross/jdk/lib/jvm.lib
export JAVA_INCLUDE_PATH=/home/jenkins/java11_cross/jdk/include
export JAVA_INCLUDE_PATH2=/home/jenkins/java11_cross/jdk/include/win32
export JAVA_AWT_INCLUDE_PATH=/home/jenkins/java11_cross/jdk/include
export LIBRARY_PATH=$LIBRARY_PATH:/home/jenkins/zlib_cross/:/home/jenkins/openssl_cross_dir/
TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/toolchain-win64.cmake
# ====== Prepare TdLib
# Cross compilation preparation (also needed for split sources)
cd $TD_BUILD_DIR
nice -n 5 chrt -b 0 \
cmake \
-DCMAKE_CROSSCOMPILING=ON \
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} \
-DJNI_FOUND=True \
-DJNI_LIBRARIES="${JAVA_AWT_LIBRARY} ${JAVA_JVM_LIBRARY}" \
-DJNI_INCLUDE_DIRS="${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2} ${JAVA_AWT_INCLUDE_PATH}" \
-DJAVA_JVM_LIBRARY=${JAVA_JVM_LIBRARY} \
-DJAVA_INCLUDE_PATH=${JAVA_INCLUDE_PATH} \
-DJAVA_INCLUDE_PATH2=${JAVA_INCLUDE_PATH2} \
-DOPENSSL_USE_STATIC_LIBS=True \
-DOPENSSL_ROOT_DIR=/home/jenkins/openssl_cross_dir \
-DZLIB_LIBRARY=/home/jenkins/zlib_cross/lib/libz.a \
-DZLIB_INCLUDE_DIR=/home/jenkins/zlib_cross/include \
\
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX:PATH=${TD_BIN_DIR} \
-DTD_ENABLE_JNI=ON \
${TD_SRC_DIR}
# Split sources
cd $TD_SRC_DIR
nice -n 5 chrt -b 0 php SplitSource.php
# Build
cd $TD_BUILD_DIR
nice -n 5 chrt -b 0 cmake --build $TD_BUILD_DIR --target install --parallel ${TRAVIS_CPU_CORES}
# Undo split-sources
cd $TD_SRC_DIR
nice -n 5 chrt -b 0 php SplitSource.php --undo
# -DOPENSSL_FOUND=True \
# -DOPENSSL_INCLUDE_DIR=/home/jenkins/openssl_cross_dir/include \
# -DOPENSSL_CRYPTO_LIBRARY=/home/jenkins/openssl_cross_dir/lib/libcrypto.dll.a \
# -DOPENSSL_SSL_LIBRARY=/home/jenkins/openssl_cross_dir/lib/libssl.dll.a \
# -DZLIB_FOUND=True \
# ====== Build TdNatives
cd $TDNATIVES_CPP_BUILD_DIR
nice -n 5 chrt -b 0 \
cmake \
-DCMAKE_CROSSCOMPILING=ON \
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} \
-DJNI_FOUND=True \
-DJNI_LIBRARIES="${JAVA_AWT_LIBRARY} ${JAVA_JVM_LIBRARY}" \
-DJNI_INCLUDE_DIRS="${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2} ${JAVA_AWT_INCLUDE_PATH}" \
-DJAVA_JVM_LIBRARY=${JAVA_JVM_LIBRARY} \
-DJAVA_INCLUDE_PATH=${JAVA_INCLUDE_PATH} \
-DJAVA_INCLUDE_PATH2=${JAVA_INCLUDE_PATH2} \
-DOPENSSL_USE_STATIC_LIBS=True \
-DOPENSSL_ROOT_DIR=/home/jenkins/openssl_cross_dir \
-DZLIB_LIBRARY=/home/jenkins/zlib_cross/lib/libz.a \
-DZLIB_INCLUDE_DIR=/home/jenkins/zlib_cross/include \
\
-DCMAKE_BUILD_TYPE=$BUILDPROFILE \
-DCMAKE_INSTALL_PREFIX:PATH=${TD_BIN_DIR} \
-DTD_GENERATED_BINARIES_DIR=${TD_CROSS_BIN_DIR}/td/generate \
-DTD_SRC_DIR=${TD_SRC_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
nice -n 5 chrt -b 0 cmake --build $TDNATIVES_CPP_BUILD_DIR --target install --parallel ${TRAVIS_CPU_CORES}
# ====== Print results stats
echo "CCACHE statistics:"
ccache -s
# ====== Copy output
cd $TDNATIVES_CPP_BUILD_DIR
mkdir -p $TDLIB_RESOURCES_OUTPUT_DIR
cp $TDNATIVES_BIN_DIR/$SRC_TDJNI_LIBNAME $TDLIB_RESOURCES_OUTPUT_DIR/$DEST_TDJNI_LIBNAME
cp /home/jenkins/zlib_cross/zlib1.dll $TDLIB_RESOURCES_OUTPUT_DIR/zlib1.dll
cp /home/jenkins/openssl_cross_dir/bin/libcrypto-3-x64.dll $TDLIB_RESOURCES_OUTPUT_DIR/libcrypto-3-x64.dll
cp /home/jenkins/openssl_cross_dir/bin/libssl-3-x64.dll $TDLIB_RESOURCES_OUTPUT_DIR/libssl-3-x64.dll
cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll $TDLIB_RESOURCES_OUTPUT_DIR/libwinpthread-1.dll
cp /usr/lib/gcc/x86_64-w64-mingw32/8.3-posix/libstdc++-6.dll $TDLIB_RESOURCES_OUTPUT_DIR/libstdc++-6.dll
cp /usr/lib/gcc/x86_64-w64-mingw32/8.3-posix/libgcc_s_seh-1.dll $TDLIB_RESOURCES_OUTPUT_DIR/libgcc_s_seh-1.dll

3
jenkins/scripts/deliver.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash -e
echo "Delivered."

View File

@ -0,0 +1,14 @@
#!/bin/bash -e
# ====== Setup workspace
cd $TRAVIS_BUILD_DIR
source ./jenkins/scripts/setup_workspace.sh
cd $TD_CROSS_BIN_DIR
nice -n 5 chrt -b 0 cmake \
-DTD_ENABLE_JNI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX:PATH=${TD_BIN_DIR} \
-DCMAKE_INSTALL_BINDIR:PATH=${TD_BIN_DIR}/bin \
$TD_SRC_DIR
nice -n 5 chrt -b 0 cmake --build . --target prepare_cross_compiling --parallel ${TRAVIS_CPU_CORES}
nice -n 5 chrt -b 0 cmake --build . --target td_generate_java_api --parallel ${TRAVIS_CPU_CORES}

View File

@ -0,0 +1,58 @@
#!/bin/bash -e
# ====== Variables
export TD_SRC_DIR=$TRAVIS_BUILD_DIR/tdlight-java/dependencies/tdlib
export TD_BIN_DIR=$TRAVIS_BUILD_DIR/tdlight-java/bin-td
export TDNATIVES_BIN_DIR=$TRAVIS_BUILD_DIR/tdlight-java/bin-tdlib
export TDNATIVES_CPP_SRC_DIR=$TRAVIS_BUILD_DIR/tdlight-java/src/tdlib-cpp
export TDNATIVES_DOCS_BIN_DIR=$TRAVIS_BUILD_DIR/tdlight-java/bin-docs
export TD_BUILD_DIR=$TRAVIS_BUILD_DIR/tdlight-java/build-td
export TD_CROSS_BIN_DIR=$TD_SRC_DIR/bin-td-cross
export TDNATIVES_CPP_BUILD_DIR=$TRAVIS_BUILD_DIR/tdlight-java/build-tdlib
export JAVA_SRC_DIR=$TRAVIS_BUILD_DIR/tdlight-java/src/tdlib-java
export TDLIB_SERIALIZER_DIR=$TRAVIS_BUILD_DIR/tdlight-java/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_STANDARD="$(tr '[:upper:]' '[:lower:]'<<<"${TRAVIS_CPU_ARCH}")"
export TRAVIS_CPU_CORES="2"
TRAVIS_OS_NAME_STANDARD="$(tr '[:upper:]' '[:lower:]'<<<"${TRAVIS_OS_NAME}")"
export TRAVIS_OS_NAME_STANDARD
export TRAVIS_OS_NAME_SHORT="win"
export SRC_TDJNI_LIBNAME="libtdjni.dll"
export DEST_TDJNI_LIBNAME="tdjni.dll"
# ====== OS Variables
TRAVIS_CPU_ARCH_JAVA="$(tr '[:upper:]' '[:lower:]'<<<"${TRAVIS_CPU_ARCH}")"
export TRAVIS_CPU_ARCH_JAVA
export TDLIB_RESOURCES_OUTPUT_DIR="$TRAVIS_OUTPUT_DIR/resources/libs/$TRAVIS_OS_NAME_SHORT/$TRAVIS_CPU_ARCH_STANDARD"
# ====== Print variables
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 "TD_CROSS_BIN_DIR=${TD_CROSS_BIN_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 "JAVA_INCLUDE_PATH2=${JAVA_INCLUDE_PATH2}"
echo "JAVA_AWT_INCLUDE_PATH=${JAVA_AWT_INCLUDE_PATH}"
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 "TRAVIS_CPU_ARCH_STANDARD=${TRAVIS_CPU_ARCH_STANDARD}"
echo "TRAVIS_OS_NAME=${TRAVIS_OS_NAME}"
echo "TRAVIS_OS_NAME_STANDARD=${TRAVIS_OS_NAME_STANDARD}"
echo "TRAVIS_OS_NAME_SHORT=${TRAVIS_OS_NAME_SHORT}"
echo "SRC_TDJNI_LIBNAME=${SRC_TDJNI_LIBNAME}"
echo "DEST_TDJNI_LIBNAME=${DEST_TDJNI_LIBNAME}"
echo "TDLIB_RESOURCES_OUTPUT_DIR=${TDLIB_RESOURCES_OUTPUT_DIR}"
echo "CURRENT DIRECTORY* ($(pwd)):"
ls -alch "$(pwd)"
echo "WORK DIRECTORY CONTENT* (${TRAVIS_BUILD_DIR}):"
ls -alch "$TRAVIS_BUILD_DIR"

View File

@ -0,0 +1,28 @@
#!/bin/bash -e
# ====== Setup environment variables
source ./jenkins/scripts/setup_variables.sh
# ====== Environment setup
[ -d $TD_BUILD_DIR ] || mkdir -p $TD_BUILD_DIR
[ -d $TD_BIN_DIR ] || mkdir -p $TD_BIN_DIR
[ -d $TD_NATIVE_BIN_DIR ] || mkdir -p $TD_NATIVE_BIN_DIR
[ -d $TD_CROSS_BIN_DIR ] || mkdir -p $TD_CROSS_BIN_DIR
[ -d $TDNATIVES_CPP_BUILD_DIR ] || mkdir -p $TDNATIVES_CPP_BUILD_DIR
echo "CCACHE statistics:"
ccache -s
## Fix openssl path
cd $TD_SRC_DIR
#sed -i -e '2i\cmake_policy(SET CMP0074 NEW)\' tdutils/CMakeLists.txt
#sed -i -e '2i\cmake_policy(SET CMP0074 NEW)\' CMakeLists.txt
#sed -i -e '3i\set(OPENSSL_ROOT_DIR /usr/lib/openssl_cross/usr/lib)\' CMakeLists.txt
#sed -i -e '4i\set(OPENSSL_LIBRARIES_DIR /usr/lib/openssl_cross/usr/lib)\' CMakeLists.txt
#sed -i -e '5i\set(OPENSSL_INCLUDE_DIR /usr/lib/openssl_cross/usr/include/openssl)\' CMakeLists.txt
#sed -i -e '6i\set(OPENSSL_CRYPTO_LIBRARY /usr/lib/openssl_cross/usr/lib/libcrypto.so)\' CMakeLists.txt
#sed -i -e '7i\set(OPENSSL_SSL_LIBRARY /usr/lib/openssl_cross/usr/lib/libssl.so)\' CMakeLists.txt
#sed -i -e '8i\set(ZLIB_ROOT /usr/lib/zlib_cross/usr/lib)\' CMakeLists.txt
#sed -i -e '9i\set(ZLIB_LIBRARIES_DIR /usr/lib/zlib_cross/usr/lib)\' CMakeLists.txt
#sed -i -e '10i\set(ZLIB_LIBRARY /usr/lib/zlib_cross/usr/lib/libz.so)\' CMakeLists.txt
#sed -i -e '11i\set(ZLIB_INCLUDE_DIR /usr/lib/zlib_cross/usr/include)\' CMakeLists.txt
#sed -i -e '12i\link_libraries(atomic)\' CMakeLists.txt

128
pom.xml
View File

@ -1,53 +1,79 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>it.tdlight</groupId>
<artifactId>tdlight-natives-windows-amd64</artifactId>
<version>1.1.4</version>
<name>TDLight Natives for Windows (amd64)</name>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>10</maven.compiler.source>
<maven.compiler.target>10</maven.compiler.target>
</properties>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub TDLight Team Apache Maven Packages</name>
<url>https://maven.pkg.github.com/tdlight-team/tdlight-java</url>
</repository>
</distributionManagement>
<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<modelVersion>4.0.0</modelVersion>
<groupId>it.tdlight</groupId>
<artifactId>tdlib-natives-windows-amd64</artifactId>
<version>2.0.2-SNAPSHOT</version>
<name>TDLib Natives for Windows (amd64)</name>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<distributionManagement>
<repository>
<id>mchv</id>
<name>MCHV Apache Maven Packages</name>
<url>https://mvn.mchv.eu/repository/mchv/</url>
</repository>
<snapshotRepository>
<id>mchv</id>
<name>MCHV Apache Maven Packages</name>
<url>https://mvn.mchv.eu/repository/mchv-snapshot/</url>
</snapshotRepository>
</distributionManagement>
<scm>
<connection>scm:git:git@ssh.git.ignuranza.net:tdlight-team/tdlight-java-natives-windows-amd64.git</connection>
<url>scm:git:git@github.com:user/project.git</url>
<developerConnection>scm:git:git@ssh.git.ignuranza.net:tdlight-team/tdlight-java-natives-windows-amd64.git</developerConnection>
<tag>td-master</tag>
</scm>
<build>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M1</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>perform</goal>
</goals>
<configuration>
<pomFileName>${project.name}/pom.xml</pomFileName>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,9 @@
package it.tdlight.tdlight.win.amd64;
import java.lang.ClassLoader;
public class LoadLibrary {
public static ClassLoader getClassLoader() {
return LoadLibrary.class.getClassLoader();
}
}

1
tdlight-java Submodule

@ -0,0 +1 @@
Subproject commit 20423357ac5c2487998ca1634c97def0bda80a75

6
toolchain-win64.cmake Normal file
View File

@ -0,0 +1,6 @@
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_CROSSCOMPILING 1)
SET(CMAKE_C_COMPILER /usr/bin/x86_64-w64-mingw32-gcc-posix)
SET(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32-g++-posix)
SET(CMAKE_LINKER /usr/bin/x86_64-w64-mingw32-ld-posix)
set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES /usr/lib/gcc/x86_64-w64-mingw32/8.3-posix)