Skip to content

Commit

Permalink
Added support for multiple generators
Browse files Browse the repository at this point in the history
  • Loading branch information
esteve committed Apr 22, 2018
1 parent 80170ec commit 18d4718
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 40 deletions.
27 changes: 8 additions & 19 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 0 additions & 21 deletions ci-scripts/build-uwp.bat

This file was deleted.

49 changes: 49 additions & 0 deletions ci-scripts/build-windows-uwp.bat
Original file line number Diff line number Diff line change
@@ -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" ^
--

0 comments on commit 18d4718

Please sign in to comment.