Compare commits
29 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
1eeea32717 | ||
|
c7ba1bbf5d | ||
|
f1e710929f | ||
|
c4c608c511 | ||
|
03a5108d61 | ||
|
972e80d5f5 | ||
|
5b1aa1d2b6 | ||
|
4cbf6c2568 | ||
|
25fe68f999 | ||
|
9940a8e49d | ||
|
bcdfb14502 | ||
|
5c02945088 | ||
|
2f08718bff | ||
|
52d4e3f742 | ||
|
41e5137fa9 | ||
|
85bfa22c1c | ||
|
0e9bea6c60 | ||
|
909ccc1b11 | ||
|
83ad66dea5 | ||
|
27779e19b2 | ||
|
149cd00bf1 | ||
|
20b64da5d0 | ||
|
4f37097d6b | ||
|
76c0e29e0d | ||
|
912d7428b6 | ||
|
84c65c40e0 | ||
|
fc07248096 | ||
|
99de50cd92 | ||
|
5b5cbaac5e |
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal 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
113
Jenkinsfile
vendored
Normal 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()
|
||||
}
|
||||
}
|
||||
}
|
58
jenkins/docker/native/dockerfile
Normal file
58
jenkins/docker/native/dockerfile
Normal 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"]
|
89
jenkins/docker/win64/dockerfile
Normal file
89
jenkins/docker/win64/dockerfile
Normal 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"]
|
98
jenkins/scripts/cross_compile.sh
Executable file
98
jenkins/scripts/cross_compile.sh
Executable 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
3
jenkins/scripts/deliver.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash -e
|
||||
echo "Delivered."
|
||||
|
14
jenkins/scripts/prepare_cross.sh
Executable file
14
jenkins/scripts/prepare_cross.sh
Executable 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}
|
58
jenkins/scripts/setup_variables.sh
Executable file
58
jenkins/scripts/setup_variables.sh
Executable 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"
|
28
jenkins/scripts/setup_workspace.sh
Executable file
28
jenkins/scripts/setup_workspace.sh
Executable 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
|
126
pom.xml
126
pom.xml
@ -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>
|
||||
<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>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>
|
||||
<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>
|
||||
|
@ -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
1
tdlight-java
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 20423357ac5c2487998ca1634c97def0bda80a75
|
6
toolchain-win64.cmake
Normal file
6
toolchain-win64.cmake
Normal 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)
|
Loading…
Reference in New Issue
Block a user