Skip to content
Permalink
Browse files

Problem: zyre out of sync with zproject

Solution: Re-generate!
  • Loading branch information
sappo committed Mar 8, 2020
1 parent e4245e6 commit f05b361318bb47ad19226a3098700489e0158dd5
@@ -545,6 +545,13 @@ foreach(TEST_CLASS ${TEST_CLASSES})
NAME ${TEST_CLASS}
COMMAND zyre_selftest --continue --verbose --test ${TEST_CLASS}
)
IF (WIN32 AND CMAKE_PREFIX_PATH)
file(TO_NATIVE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH_WIN)
set_tests_properties(
${TEST_CLASS}
PROPERTIES ENVIRONMENT "PATH=%PATH%\;${CMAKE_PREFIX_PATH_WIN}\\bin"
)
ENDIF (WIN32 AND CMAKE_PREFIX_PATH)
set_tests_properties(
${TEST_CLASS}
PROPERTIES TIMEOUT ${CLASSTEST_TIMEOUT}
@@ -98,6 +98,8 @@ void
// Set network interface for UDP beacons. If you do not set this, CZMQ will
// choose an interface for you. On boxes with several interfaces you should
// specify which one you want to use, or strange things can happen.
// The interface may by specified by either the interface name e.g. "eth0" or
// an IP address associalted with the interface e.g. "192.168.0.1"
void
zyre_set_interface (zyre_t *self, const char *value);

@@ -80,6 +80,8 @@ interface
// Set network interface for UDP beacons. If you do not set this, CZMQ will
// choose an interface for you. On boxes with several interfaces you should
// specify which one you want to use, or strange things can happen.
// The interface may by specified by either the interface name e.g. "eth0" or
// an IP address associalted with the interface e.g. "192.168.0.1"
procedure SetInterface(const Value: string);

// By default, Zyre binds to an ephemeral TCP port and broadcasts the local
@@ -324,6 +326,8 @@ TZyre = class(TInterfacedObject, IZyre)
// Set network interface for UDP beacons. If you do not set this, CZMQ will
// choose an interface for you. On boxes with several interfaces you should
// specify which one you want to use, or strange things can happen.
// The interface may by specified by either the interface name e.g. "eth0" or
// an IP address associalted with the interface e.g. "192.168.0.1"
procedure SetInterface(const Value: string);

// By default, Zyre binds to an ephemeral TCP port and broadcasts the local
@@ -103,6 +103,8 @@ interface
// Set network interface for UDP beacons. If you do not set this, CZMQ will
// choose an interface for you. On boxes with several interfaces you should
// specify which one you want to use, or strange things can happen.
// The interface may by specified by either the interface name e.g. "eth0" or
// an IP address associalted with the interface e.g. "192.168.0.1"
procedure zyre_set_interface(self: PZyre; Value: PAnsiChar); cdecl; external lib_zyre {$IFDEF MSWINDOWS}delayed{$ENDIF};

// By default, Zyre binds to an ephemeral TCP port and broadcasts the local
@@ -52,22 +52,23 @@ Prerequisites:
* Java JDK 8 or later is installed
Environment Variables:
* Add MSBuild.exe to the PATH, e.g. C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin
* Set JAVA_HOME to the installation location, e.g. C:\Program Files\Java\jdk1.8.0_66.
* Add MSBuild.exe to the PATH (e.g. `C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin`)
* Set JAVA_HOME to the installation location (e.g. `C:\Program Files\Java\jdk1.8.0_66`).
1. Check out all dependent projects from github, at the same level as this project. E.g.: libzmq, czmq.
2. Follow the dependent projects instructions to build their '.dll' and '.lib' file.
3. Copy a dependent '.dll' and '.lib' files to a folder
4. Add this library folder to the path, e.g.:
1. Check out all dependent projects from github, at the same level as this project (e.g. libzmq, czmq).
2. Follow the dependent projects instructions to build their `.dll` and `.lib` file.
PATH %PATH%;C:\projects\libs
If you used cmake to install the dependencies you can skip the following steps.
Now run:
3. Create a folder where to place the dlls and libs (e.g. `C:\tmp\deps`).
4. Copy all dependent `.dll` files to the `bin` subfolder (e.g. `C:\tmp\deps\bin`)
5. Copy all dependent `.lib` files to the `lib` subfolder (e.g. `C:\tmp\deps\lib`)
6. Copy all dependent `.h` files to the `include` subfolder (e.g. `C:\tmpdeps\include`)
gradlew build jar "-PvsGenerator=Visual Studio 16 2019"
gradlew test "-PvsGenerator=Visual Studio 16 2019"
Now run:
Change the vsGenerator parameter to the version of MS Visual Studio you have installed.
gradlew build jar -PbuildPrefix=C:\tmp\deps
gradlew test -PbuildPrefix=C:\tmp\deps
## Installing the JNI Layer
@@ -137,18 +137,18 @@ if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BINDING_OPTS" == "android" ]; then
export NDK_VERSION=android-ndk-r20
export ANDROID_NDK_ROOT="/tmp/${NDK_VERSION}"

case $(uname | tr '[:upper:]' '[:lower:]') in
linux*)
HOST_PLATFORM=linux-x86_64
;;
darwin*)
HOST_PLATFORM=darwin-x86_64
;;
*)
echo "Unsupported platform"
exit 1
;;
esac
case $(uname | tr '[:upper:]' '[:lower:]') in
linux*)
HOST_PLATFORM=linux-x86_64
;;
darwin*)
HOST_PLATFORM=darwin-x86_64
;;
*)
echo "Unsupported platform"
exit 1
;;
esac

if [ ! -d "${ANDROID_NDK_ROOT}" ]; then
export FILENAME=$NDK_VERSION-$HOST_PLATFORM.zip
@@ -16,8 +16,18 @@ dependencies {
task copyLibs(type: Copy) {
def libraryPaths = System.getProperty('java.library.path').split(File.pathSeparator).toList()
libraryPaths.add('/usr/local/lib')
libraryPaths.add("${rootDir}/zyre-jni")
libraryPaths.add("${rootDir}/zyre-jni/build/Release")
if (osdetector.os == 'windows') {
libraryPaths.add("${rootDir}/zyre-jni/build/Release")
} else {
libraryPaths.add("${rootDir}/zyre-jni/build")
}
if (project.hasProperty('buildPrefix')) {
if (osdetector.os == 'windows') {
// DLLs are installed to the bin directory by cmake
libraryPaths.add("${project.buildPrefix}/bin")
}
libraryPaths.add("${project.buildPrefix}/lib")
}

libraryPaths.each { path ->
from path
@@ -36,34 +36,26 @@ task generateJniHeaders(type: Exec, dependsOn: 'classes') {

tasks.withType(Test) {
def defaultJavaLibraryPath = System.getProperty("java.library.path")
def extraJavaLibraryPath = hasNotEmptyProperty('buildPrefix') ? "$project.buildPrefix/lib" : ''
if (osdetector.os == 'windows') {
systemProperty "java.library.path", "${projectDir}/build/Release${File.pathSeparator}" +
"${defaultJavaLibraryPath}${File.pathSeparator}" +
"${extraJavaLibraryPath}"
def extraJavaLibraryPath = hasNotEmptyProperty('buildPrefix') ? "$project.buildPrefix\\bin;$project.buildPrefix\\lib" : ''
extraJavaLibraryPath = extraJavaLibraryPath.replace("/", "\\")
systemProperty "java.library.path", "${projectDir}\\build\\Release${File.pathSeparator}" +
"${extraJavaLibraryPath}${File.pathSeparator}" +
"${defaultJavaLibraryPath}"
} else {
systemProperty "java.library.path", "${projectDir}${File.pathSeparator}" +
"${defaultJavaLibraryPath}${File.pathSeparator}" +
def extraJavaLibraryPath = hasNotEmptyProperty('buildPrefix') ? "$project.buildPrefix/lib" : ''
systemProperty "java.library.path", "${projectDir}/build${File.pathSeparator}" +
"/usr/local/lib${File.pathSeparator}" +
"/tmp/lib${File.pathSeparator}" +
"${extraJavaLibraryPath}"
"${extraJavaLibraryPath}${File.pathSeparator}" +
"${defaultJavaLibraryPath}"
}
}

task initCMake(type: Exec, dependsOn: 'generateJniHeaders') {
if (osdetector.os == 'windows') {
def includePath = "${rootDir}/../../include"
includePath += "${File.pathSeparator}${rootDir}/../../../libzmq/include"
includePath += "${File.pathSeparator}${rootDir}/../../../czmq/include"
workingDir 'build'
commandLine 'cmake',
'-G', vsGenerator,
'-D', "CMAKE_INCLUDE_PATH=\"${includePath}\"",
'..'
} else {
def findRootPathOpt = hasNotEmptyProperty('buildPrefix') ? "-DCMAKE_FIND_ROOT_PATH=$project.buildPrefix" : ''
commandLine 'cmake', "$findRootPathOpt", '.'
}
workingDir 'build'
def prefixPath = hasNotEmptyProperty('buildPrefix') ? "-DCMAKE_PREFIX_PATH=$project.buildPrefix" : ''
commandLine 'cmake', "$prefixPath", '..'
}

task buildNative(type: Exec, dependsOn: 'initCMake') {
@@ -74,7 +66,8 @@ task buildNative(type: Exec, dependsOn: 'initCMake') {
'--target', 'zyrejni',
'--', '-verbosity:Minimal', '-maxcpucount'
} else {
commandLine 'make'
commandLine 'cmake',
'--build', 'build'
}
}

@@ -150,6 +150,8 @@ public void setInterval (long interval) {
Set network interface for UDP beacons. If you do not set this, CZMQ will
choose an interface for you. On boxes with several interfaces you should
specify which one you want to use, or strange things can happen.
The interface may by specified by either the interface name e.g. "eth0" or
an IP address associalted with the interface e.g. "192.168.0.1"
*/
native static void __setInterface (long self, String value);
public void setInterface (String value) {

Some generated files are not rendered by default. Learn more.

@@ -110,6 +110,8 @@ void
// Set network interface for UDP beacons. If you do not set this, CZMQ will
// choose an interface for you. On boxes with several interfaces you should
// specify which one you want to use, or strange things can happen.
// The interface may by specified by either the interface name e.g. "eth0" or
// an IP address associalted with the interface e.g. "192.168.0.1"
void
zyre_set_interface (zyre_t *self, const char *value);

@@ -156,6 +156,8 @@ nothing my_zyre.setInterface (String)
Set network interface for UDP beacons. If you do not set this, CZMQ will
choose an interface for you. On boxes with several interfaces you should
specify which one you want to use, or strange things can happen.
The interface may by specified by either the interface name e.g. "eth0" or
an IP address associalted with the interface e.g. "192.168.0.1"

```
integer my_zyre.setEndpoint (String)
@@ -301,6 +301,8 @@ def set_interface(self, value):
Set network interface for UDP beacons. If you do not set this, CZMQ will
choose an interface for you. On boxes with several interfaces you should
specify which one you want to use, or strange things can happen.
The interface may by specified by either the interface name e.g. "eth0" or
an IP address associalted with the interface e.g. "192.168.0.1"
"""
return lib.zyre_set_interface(self._as_parameter_, value)

@@ -121,6 +121,8 @@ def set_interface(self, value):
Set network interface for UDP beacons. If you do not set this, CZMQ will
choose an interface for you. On boxes with several interfaces you should
specify which one you want to use, or strange things can happen.
The interface may by specified by either the interface name e.g. "eth0" or
an IP address associalted with the interface e.g. "192.168.0.1"
"""
utils.lib.zyre_set_interface(self._p, utils.to_bytes(value))

@@ -4643,6 +4643,8 @@
// Set network interface for UDP beacons. If you do not set this, CZMQ will
// choose an interface for you. On boxes with several interfaces you should
// specify which one you want to use, or strange things can happen.
// The interface may by specified by either the interface name e.g. "eth0" or
// an IP address associalted with the interface e.g. "192.168.0.1"
void
zyre_set_interface (zyre_t *self, const char *value);
@@ -101,6 +101,8 @@ void QmlZyre::setInterval (size_t interval) {
// Set network interface for UDP beacons. If you do not set this, CZMQ will
// choose an interface for you. On boxes with several interfaces you should
// specify which one you want to use, or strange things can happen.
// The interface may by specified by either the interface name e.g. "eth0" or
// an IP address associalted with the interface e.g. "192.168.0.1"
void QmlZyre::setInterface (const QString &value) {
zyre_set_interface (self, value.toUtf8().data());
};
@@ -87,6 +87,8 @@ public slots:
// Set network interface for UDP beacons. If you do not set this, CZMQ will
// choose an interface for you. On boxes with several interfaces you should
// specify which one you want to use, or strange things can happen.
// The interface may by specified by either the interface name e.g. "eth0" or
// an IP address associalted with the interface e.g. "192.168.0.1"
void setInterface (const QString &value);

// By default, Zyre binds to an ephemeral TCP port and broadcasts the local
@@ -148,6 +148,8 @@ void QZyre::setInterval (size_t interval)
// Set network interface for UDP beacons. If you do not set this, CZMQ will
// choose an interface for you. On boxes with several interfaces you should
// specify which one you want to use, or strange things can happen.
// The interface may by specified by either the interface name e.g. "eth0" or
// an IP address associalted with the interface e.g. "192.168.0.1"
void QZyre::setInterface (const QString &value)
{
zyre_set_interface (self, value.toUtf8().data());
@@ -86,6 +86,8 @@ class QT_ZYRE_EXPORT QZyre : public QObject
// Set network interface for UDP beacons. If you do not set this, CZMQ will
// choose an interface for you. On boxes with several interfaces you should
// specify which one you want to use, or strange things can happen.
// The interface may by specified by either the interface name e.g. "eth0" or
// an IP address associalted with the interface e.g. "192.168.0.1"
void setInterface (const QString &value);

// By default, Zyre binds to an ephemeral TCP port and broadcasts the local
@@ -247,6 +247,8 @@ def set_interval(interval)
# Set network interface for UDP beacons. If you do not set this, CZMQ will
# choose an interface for you. On boxes with several interfaces you should
# specify which one you want to use, or strange things can happen.
# The interface may by specified by either the interface name e.g. "eth0" or
# an IP address associalted with the interface e.g. "192.168.0.1"
#
# @param value [String, #to_s, nil]
# @return [void]
@@ -25,6 +25,51 @@ case "$CI_TRACE" in
set -x ;;
esac

case $TRAVIS_OS_NAME in
windows)
export
choco install openjdk
export JAVA_HOME="C:\Program Files\OpenJDK\jdk-13.0.2"
export BUILD_PREFIX=$TEMP/ci_build

cd ..

git clone --quiet --depth 1 https://github.com/zeromq/libzmq.git libzmq
cd libzmq
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX -DCMAKE_PREFIX_PATH=$BUILD_PREFIX
cmake --build . --config Release --target install
cd ../..

git clone --quiet --depth 1 https://github.com/zeromq/czmq.git czmq
cd czmq
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX -DCMAKE_PREFIX_PATH=$BUILD_PREFIX
cmake --build . --config Release --target install
cd ../..

cd zyre
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX -DCMAKE_PREFIX_PATH=$BUILD_PREFIX
cmake --build . --config Release --target install
ctest --build-config Release
cd ../..

cd zyre
cd bindings/jni
# Build will fail if processes are still running at the end of the script.
# Gradle by default starts a daemon so consequtive builds are faster.
# Therefore instruct gradle not to use its daemon.
export GRADLE_OPTS=-Dorg.gradle.daemon=false
./gradlew build jar -PbuildPrefix=$BUILD_PREFIX -x test --info
./gradlew publishToMavenLocal -PbuildPrefix=$BUILD_PREFIX --info

exit 0
esac

case "$BUILD_TYPE" in
default|default-Werror|default-with-docs|valgrind|clang-format-check)
LANG=C

0 comments on commit f05b361

Please sign in to comment.
You can’t perform that action at this time.