From 18d4718c256766e2af82e5b9a7629e9c706dd6b9 Mon Sep 17 00:00:00 2001 From: Esteve Fernandez Date: Sun, 22 Apr 2018 11:38:14 +0200 Subject: [PATCH] Added support for multiple generators --- .vsts-ci.yml | 27 ++++++------------ ci-scripts/build-uwp.bat | 21 -------------- ci-scripts/build-windows-uwp.bat | 49 ++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 40 deletions(-) delete mode 100644 ci-scripts/build-uwp.bat create mode 100644 ci-scripts/build-windows-uwp.bat diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 39d0e5ef..1099c584 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -4,48 +4,37 @@ steps: filename: python arguments: '-m pip install -U pip setuptools' displayName: python -m pip install -U pip setuptools - - task: CmdLine@1 inputs: filename: python arguments: '-m pip install pyparsing pyyaml' displayName: python -m pip install pyparsing pyyaml - - task: CmdLine@1 inputs: filename: python arguments: '-m pip install EmPy' displayName: python -m pip install EmPy - - task: CmdLine@1 inputs: filename: python arguments: '-m pip install vcstool' displayName: python -m pip install vcstool - - task: BatchScript@1 inputs: - filename: 'ci-scripts/build-uwp.bat' + arguments: '$(Build.SourceBranchName) $(ros2.arch)' modifyEnvironment: false displayName: Build ROS2 .Net - - task: CopyFiles@2 inputs: - SourceFolder: 'D:\dev\ament' - Contents: 'install\**' - TargetFolder: '$(Build.ArtifactStagingDirectory)' - displayName: Copy Ament artifacts - -- task: CopyFiles@2 - inputs: - SourceFolder: 'D:\dev\ros2' - Contents: 'install\**' - TargetFolder: '$(Build.ArtifactStagingDirectory)' + SourceFolder: 'D:\dev' + Contents: | + ament\install\** + ros2\install\** + TargetFolder: '$(Build.ArtifactStagingDirectory)\ros2-dotnet-uwp-$(ros2.arch)' displayName: Copy ROS2 .Net artifacts - - task: PublishBuildArtifacts@1 inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)' - ArtifactName: 'ros2-dotnet' + PathtoPublish: '$(Build.ArtifactStagingDirectory)\ros2-dotnet-uwp-$(ros2.arch)' + ArtifactName: 'ros2-dotnet-uwp-$(ros2.arch)' publishLocation: Container displayName: Publish ROS2 .Net artifacts diff --git a/ci-scripts/build-uwp.bat b/ci-scripts/build-uwp.bat deleted file mode 100644 index 6206ea5f..00000000 --- a/ci-scripts/build-uwp.bat +++ /dev/null @@ -1,21 +0,0 @@ -@echo off - -echo "===== BUILDING BRANCH: %1 =====" - -md \dev\ament\src -cd \dev\ament -curl -sk https://raw.githubusercontent.com/esteve/ros2_dotnet/%1/ament_dotnet_uwp.repos -o ament_dotnet_uwp.repos -vcs import src < ament_dotnet_uwp.repos -python src\ament\ament_tools\scripts\ament.py build --cmake-args -G "Visual Studio 15 2017 Win64" -DMSBUILD_EXECUTABLE="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe" -- - -call \dev\ament\install\local_setup.bat -md \dev\ros2\src -cd \dev\ros2 -curl -sk https://raw.githubusercontent.com/esteve/ros2_dotnet/%1/ros2_dotnet_uwp.repos -o ros2_dotnet_uwp.repos -vcs import src < ros2_dotnet_uwp.repos -cd \dev\ros2\src\ros2\rosidl_typesupport -patch -p1 < ..\..\ros2_dotnet/ros2_dotnet\rosidl_typesupport_ros2_uwp.patch -cd \dev\ros2\src\ros2_dotnet\ros2_dotnet -git checkout %1 -cd \dev\ros2 -ament build --cmake-args -G "Visual Studio 15 2017" -DMSBUILD_EXECUTABLE="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 -DTHIRDPARTY=ON -DCOMPILE_EXAMPLES=OFF -DCMAKE_FIND_ROOT_PATH="\dev\ament\install;\dev\ros2\install" -- diff --git a/ci-scripts/build-windows-uwp.bat b/ci-scripts/build-windows-uwp.bat new file mode 100644 index 00000000..ff7c608d --- /dev/null +++ b/ci-scripts/build-windows-uwp.bat @@ -0,0 +1,49 @@ +@echo off + +echo "===== BUILDING BRANCH: %1 =====" + +if [%2] == [] ( + set ROS2_DOTNET_CMAKE_GENERATOR="Visual Studio 15 2017 Win64" +) else if [%2] == [x86] ( + set ROS2_DOTNET_CMAKE_GENERATOR="Visual Studio 15 2017" +) else if [%2] == [x64] ( + set ROS2_DOTNET_CMAKE_GENERATOR="Visual Studio 15 2017 Win64" +) else if [%2] == [arm] ( + set ROS2_DOTNET_CMAKE_GENERATOR="Visual Studio 15 2017 ARM" +) else ( + echo "Unknown architecture: %2" + exit /b 1 +) + +set ROS2_DOTNET_MSBUILD_EXECUTABLE="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe" + +md \dev\ament\src +cd \dev\ament +curl -sk https://raw.githubusercontent.com/esteve/ros2_dotnet/%1/ament_dotnet_uwp.repos -o ament_dotnet_uwp.repos +vcs import src < ament_dotnet_uwp.repos +python src\ament\ament_tools\scripts\ament.py build ^ + --cmake-args ^ + -G "Visual Studio 15 2017 Win64" ^ + -DMSBUILD_EXECUTABLE=%ROS2_DOTNET_MSBUILD_EXECUTABLE% ^ + -- + +call \dev\ament\install\local_setup.bat +md \dev\ros2\src +cd \dev\ros2 +curl -sk https://raw.githubusercontent.com/esteve/ros2_dotnet/%1/ros2_dotnet_uwp.repos -o ros2_dotnet_uwp.repos +vcs import src < ros2_dotnet_uwp.repos +cd \dev\ros2\src\ros2\rosidl_typesupport +patch -p1 < ..\..\ros2_dotnet/ros2_dotnet\rosidl_typesupport_ros2_uwp.patch +cd \dev\ros2\src\ros2_dotnet\ros2_dotnet +git checkout %1 +cd \dev\ros2 +ament build ^ + --cmake-args ^ + -G %ROS2_DOTNET_CMAKE_GENERATOR% ^ + -DMSBUILD_EXECUTABLE=%ROS2_DOTNET_MSBUILD_EXECUTABLE% ^ + -DCMAKE_SYSTEM_NAME=WindowsStore ^ + -DCMAKE_SYSTEM_VERSION=10.0 ^ + -DTHIRDPARTY=ON ^ + -DCOMPILE_EXAMPLES=OFF ^ + -DCMAKE_FIND_ROOT_PATH="\dev\ament\install;\dev\ros2\install" ^ + --