Skip to content

Commit

Permalink
Add Windows CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Theosakamg committed Jun 11, 2018
1 parent 8700790 commit 5f931b8
Show file tree
Hide file tree
Showing 7 changed files with 222 additions and 8 deletions.
@@ -0,0 +1,3 @@
# generated from ament_package/template/environment_hook/javapath.bat.in

ament_prepend_unique_value JAVAPATH "@JAVAPATH@"
157 changes: 157 additions & 0 deletions appveyor.yml
@@ -0,0 +1,157 @@
#---------------------------------#
# 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 true

# 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
VisualStudioVersion: 14.0

# already install : git, python, cmake
install:
- SET PATH=%PYTHON_PATH%;%PYTHON_PATH%\Scripts;%path%
- cinst patch curl cppcheck wget


#---------------------------------#
# 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
6 changes: 2 additions & 4 deletions rcljava/src/main/java/org/ros2/rcljava/RCLJava.java
Expand Up @@ -57,8 +57,6 @@ public final class RCLJava {
*/
private static volatile boolean initialized = false;

private static String libExtention = ".unknow";

private static String[] arguments;

/**
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -351,7 +349,7 @@ public static String getTypesupportIdentifier() {
}

/**
* Switch of ROS2 middleware implementation
* Switch of ROS2 middle-ware implementation
*
* <p>TODO need to check implementation available.</p>
*
Expand Down
Expand Up @@ -72,12 +72,14 @@ private void processInit(final ThreadedExecutor executor, final String topic)

this.futureOne = new RCLFuture<UInt32>(executor);
this.subscriptionOne = (NativeSubscription<UInt32>)this.subscriptionNodeOne.<UInt32>createSubscription(
UInt32.class, topic,
UInt32.class,
topic,
new TestConsumer<UInt32>(this.futureOne));

this.futureTwo = new RCLFuture<UInt32>(executor);
this.subscriptionTwo = (NativeSubscription<UInt32>)this.subscriptionNodeTwo.<UInt32>createSubscription(
UInt32.class, topic,
UInt32.class,
topic,
new TestConsumer<UInt32>(futureTwo));

this.msg = new UInt32();
Expand Down Expand Up @@ -114,15 +116,14 @@ private void processResult(final ThreadedExecutor executor)
@Test
public final void testLinkMultipleProcess() {
logger.debug(new Object(){}.getClass().getEnclosingMethod().getName());

boolean test = true;

try {
final ThreadedExecutor executor = new MultiThreadedExecutor();
this.processInit(executor, TEST_TOPIC_MULTI);

while (!(futureOne.isDone() && futureTwo.isDone())) {
publisher.publish(msg);
publisher.publish(this.msg);
executor.spinOnce(-1);
}

Expand Down
55 changes: 55 additions & 0 deletions scripts/appveyor/windows_prepare.bat
@@ -0,0 +1,55 @@
CD %HOME%

ECHO. & ECHO "Download components..."
curl -skL https://github.com/ros2/choco-packages/releases/download/2017-04-04-1/asio.1.10.6.nupkg -o asio.1.10.6.nupkg
curl -skL https://github.com/ros2/choco-packages/releases/download/2017-04-04-1/eigen.3.3.3.nupkg -o eigen.3.3.3.nupkg
curl -skL https://github.com/ros2/choco-packages/releases/download/2017-04-04-1/tinyxml-usestl.2.6.2.nupkg -o tinyxml-usestl.2.6.2.nupkg
curl -skL https://github.com/ros2/choco-packages/releases/download/2017-04-04-1/tinyxml2.4.0.1.nupkg -o tinyxml2.4.0.1.nupkg
dir

ECHO. & ECHO "Install VCS tools..."
pip install vcstool
python.exe -m pip install -U setuptools pip
python.exe -m pip install catkin_pkg EmPy pyparsing pyyaml
python.exe -m pip install nose coverage mock pytest pytest-cov pytest-runner
python.exe -m pip install flake8 flake8-blind-except flake8-builtins flake8-class-newline flake8-comprehensions flake8-deprecated flake8-docstrings flake8-import-order flake8-quotes pep8 pydocstyle pyflakes


ECHO. & ECHO "Install components..."
choco install -y -s %HOME% asio eigen tinyxml-usestl tinyxml2

ECHO. & ECHO "Check version..."
git.exe --version
python.exe --version
cmake.exe --version

ECHO. & ECHO "INSTALL/BUILD ROS2 AMENT..."
MKDIR "%HOME_BUILD%\ament_ws\src"
CD %HOME_BUILD%\ament_ws
wget https://gist.githubusercontent.com/Theosakamg/e6084cfafa6b7ea690104424cef970a2/raw/ament_java.repos
vcs import %HOME_BUILD%\ament_ws\src < ament_java.repos
python.exe src\ament\ament_tools\scripts\ament.py build
REM --parallel --symlink-install --isolated

ECHO. & ECHO "INSTALL ROS2 WS..."
MKDIR "%ROS2WS%\src"
CD %ROS2WS%
wget https://gist.githubusercontent.com/Theosakamg/d9259bbc708c5145255fbdeb25e65e19/raw/ros2_java_desktop.repos
vcs import %ROS2WS%\src < ros2_java_desktop.repos

ECHO. & ECHO "Sync with git trigger"
RMDIR /Q /S %ROS2WS%\src\ros2_java\ros2_java && MKLINK /D %ROS2WS%\src\ros2_java\ros2_java %HOME_REPO%

ECHO. & ECHO "Patch for Java support."
CD %ROS2WS%\src\ros2\rosidl_typesupport && patch -p1 < ..\..\ros2_java\ros2_java\rosidl_ros2_android.diff

ECHO. & ECHO "BUILD ROS2 WS..."
CD %HOME_BUILD%
CALL "%HOME_BUILD%\ament_ws\install\setup.bat"
CD %ROS2WS%
ament build --skip-packages %PKG_EXCLUDE%
REM --parallel --symlink-install --isolated --ament-gradle-args --parallel --daemon --configure-on-demand




Empty file.
Empty file.

0 comments on commit 5f931b8

Please sign in to comment.