From 860dcc0d9d373aeb9a25dfe9fa5a20d1b01b6634 Mon Sep 17 00:00:00 2001 From: Mickael Gaillard Date: Sun, 10 Jun 2018 16:35:36 +0200 Subject: [PATCH] Add Windows CI --- appveyor.yml | 156 ++++++++++++++++++ .../main/java/org/ros2/rcljava/RCLJava.java | 6 +- .../ros2/rcljava/executor/ExecutorTest.java | 9 +- scripts/appveyor/windows_prepare.bat | 18 ++ scripts/appveyor/windows_run.bat | 0 scripts/appveyor/windows_success.bat | 0 6 files changed, 181 insertions(+), 8 deletions(-) create mode 100644 appveyor.yml create mode 100644 scripts/appveyor/windows_prepare.bat create mode 100644 scripts/appveyor/windows_run.bat create mode 100644 scripts/appveyor/windows_success.bat diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..b0ddbb6 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,156 @@ +#---------------------------------# +# general configuration # +#---------------------------------# + +# version format +version: 0.4.0.{build} + +# Do not build on tags (GitHub and BitBucket) +#skip_tags: true + +# Start builds on tags only (GitHub and BitBucket) +#skip_non_tags: true + +# Do not build feature branch with open Pull Requests +pull_requests: + do_not_increment_build_number: true + +# Maximum number of concurrent jobs for the project +#max_jobs: 1 + +#---------------------------------# +# environment configuration # +#---------------------------------# + +# Build worker image (VM template) +image: Visual Studio 2017 +#os: Windows Server 2016 + +# scripts that are called at very beginning, before repo cloning +#init: +# - git config --global core.autocrlf input + +# clone directory +clone_folder: C:\projects\appveyor\ros2-java + +# fetch repository as zip archive +#shallow_clone: true # default is "false" + +# set clone depth +#clone_depth: 5 # clone entire repository history if not defined + +# environment variables +environment: + global: + HOME: C:\projects\appveyor\ + HOME_REPO: ${HOME}\ros2-java + HOME_BUILD: ${HOME}\build + ROS2WS: ${HOME_BUILD}\ros2_java_ws + COMMIT: ${APPVEYOR_REPO_COMMIT} + PYTHON_PATH: C:\Python36-x64 + ENV_PATH: ${HOME_BUILD}\.env + +# already install : git, python, cmake +install: + - SET PATH=%PYTHON_PATH%;%path% + - cinst patch curl + + +#---------------------------------# +# build configuration # +#---------------------------------# + +# build platform, i.e. x86, x64, Any CPU. This setting is optional. +platform: x64 + +# to add several platforms to build matrix: +#platform: +# - x86 +# - Any CPU + +# build Configuration, i.e. Debug, Release, etc. +configuration: Debug + +build: + parallel: true + +# scripts to run before build +before_build: + - dir + - .\scripts\appveyor\windows_prepare.bat + +# scripts to run *after* solution is built and *before* automatic packaging occurs (web apps, NuGet packages, Azure Cloud Services) +#before_package: + +# scripts to run after build +#after_build: + +# to run your custom scripts instead of automatic MSBuild +build_script: + - .\scripts\appveyor\windows_run.bat + +# to disable automatic builds +#build: off + +#---------------------------------# +# tests configuration # +#---------------------------------# + +# to run tests again only selected assemblies and/or categories +#test: + +# scripts to run before tests +#before_test: + +# scripts to run after tests +#after_test: + +# to run your custom scripts instead of automatic tests +#test_script: + +# to disable automatic tests +test: off + +#---------------------------------# +# global handlers # +#---------------------------------# + +# on successful build +on_success: + - .\scripts\appveyor\windows_success.bat + +# on build failure +#on_failure: + +# after build failure or success +#on_finish: + +#---------------------------------# +# notifications # +#---------------------------------# + +notifications: + +# # Email +# - provider: Email +# to: +# - user1@email.com +# - user2@email.com +# subject: 'Build {{status}}' # optional +# message: "{{message}}, {{commitId}}, ..." # optional +# on_build_status_changed: true + +# # Slack +# - provider: Slack +# incoming_webhook: http://incoming-webhook-url + + # Webhook + - provider: Webhook + url: https://webhooks.gitter.im/e/4aac82b42245203edceb +# headers: +# User-Agent: myapp 1.0 +# Authorization: +# secure: GhD+5xhLz/tkYY6AO3fcfQ== + on_build_success: true + on_build_failure: true + on_build_status_changed: true diff --git a/rcljava/src/main/java/org/ros2/rcljava/RCLJava.java b/rcljava/src/main/java/org/ros2/rcljava/RCLJava.java index 1e7cc6c..ef12fd4 100644 --- a/rcljava/src/main/java/org/ros2/rcljava/RCLJava.java +++ b/rcljava/src/main/java/org/ros2/rcljava/RCLJava.java @@ -57,8 +57,6 @@ public final class RCLJava { */ private static volatile boolean initialized = false; - private static String libExtention = ".unknow"; - private static String[] arguments; /** @@ -182,7 +180,7 @@ private static void displayReport() { msgLog.append(key); msgLog.append(System.lineSeparator()); } - RCLJava.logger.debug(String.format("Native libraries Loaded: %n", msgLog.toString())); + RCLJava.logger.debug(String.format("Native libraries Loaded: %n%s", msgLog.toString())); RCLJava.logger.debug(DISPLAY_SEPARATOR); } @@ -351,7 +349,7 @@ public static String getTypesupportIdentifier() { } /** - * Switch of ROS2 middleware implementation + * Switch of ROS2 middle-ware implementation * *

TODO need to check implementation available.

* diff --git a/rcljava/src/test/java/org/ros2/rcljava/executor/ExecutorTest.java b/rcljava/src/test/java/org/ros2/rcljava/executor/ExecutorTest.java index 0a60a67..20d2a40 100644 --- a/rcljava/src/test/java/org/ros2/rcljava/executor/ExecutorTest.java +++ b/rcljava/src/test/java/org/ros2/rcljava/executor/ExecutorTest.java @@ -72,12 +72,14 @@ private void processInit(final ThreadedExecutor executor, final String topic) this.futureOne = new RCLFuture(executor); this.subscriptionOne = (NativeSubscription)this.subscriptionNodeOne.createSubscription( - UInt32.class, topic, + UInt32.class, + topic, new TestConsumer(this.futureOne)); this.futureTwo = new RCLFuture(executor); this.subscriptionTwo = (NativeSubscription)this.subscriptionNodeTwo.createSubscription( - UInt32.class, topic, + UInt32.class, + topic, new TestConsumer(futureTwo)); this.msg = new UInt32(); @@ -114,7 +116,6 @@ private void processResult(final ThreadedExecutor executor) @Test public final void testLinkMultipleProcess() { logger.debug(new Object(){}.getClass().getEnclosingMethod().getName()); - boolean test = true; try { @@ -122,7 +123,7 @@ public final void testLinkMultipleProcess() { this.processInit(executor, TEST_TOPIC_MULTI); while (!(futureOne.isDone() && futureTwo.isDone())) { - publisher.publish(msg); + publisher.publish(this.msg); executor.spinOnce(-1); } diff --git a/scripts/appveyor/windows_prepare.bat b/scripts/appveyor/windows_prepare.bat new file mode 100644 index 0000000..126dff8 --- /dev/null +++ b/scripts/appveyor/windows_prepare.bat @@ -0,0 +1,18 @@ +cd %HOME% + +echo "Download components..." +curl https://github.com/ros2/choco-packages/releases/download/2017-04-04-1/asio.1.10.6.nupkg -o asio.nupkg +curl https://github.com/ros2/choco-packages/releases/download/2017-04-04-1/eigen.3.3.3.nupkg -o eigen.nupkg +curl https://github.com/ros2/choco-packages/releases/download/2017-04-04-1/tinyxml-usestl.2.6.2.nupkg -o tinyxml-usestl.nupkg +curl https://github.com/ros2/choco-packages/releases/download/2017-04-04-1/tinyxml2.4.0.1.nupkg -o tinyxml.nupkg + +echo "Install VCS tools..." +pip install vcstool +python.exe -m pip install -U setuptools pip + +echo "Install components..." +choco install -y -s ./ asio eigen tinyxml-usestl tinyxml2 + +git.exe --version +python.exe --version +cmake.exe --version diff --git a/scripts/appveyor/windows_run.bat b/scripts/appveyor/windows_run.bat new file mode 100644 index 0000000..e69de29 diff --git a/scripts/appveyor/windows_success.bat b/scripts/appveyor/windows_success.bat new file mode 100644 index 0000000..e69de29