Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add add_dotnet_test_project #1

Conversation

hoffmann-stefan
Copy link
Member

@hoffmann-stefan hoffmann-stefan commented Dec 7, 2021

Used to add test *.csproj files without generating them from cmake.

New variants of add_dotnet_*

The base branch feature-include-csproj and this branch adds the posibility to use your own *.csproj files instead of generating one with cmake.
This makes it easier to use advanced *.csproj features needed for ASP.NET as the developer can directly manipulate the .csproj file.

This is how the new commands corespond to the existing ones:

add_dotnet_executable -> add_dotnet_executable_project
add_dotnet_library -> add_dotnet_library_project
add_dotnet_test -> add_dotnet_test_project

Example:

...
set(_assemblies_dep_dlls
    ${rcldotnet_common_ASSEMBLIES_DLL}
    ${rcldotnet_ASSEMBLIES_DLL}
    ${std_msgs_ASSEMBLIES_DLL}
    ${std_srvs_ASSEMBLIES_DLL}
)

add_dotnet_executable_project(RosBlazorExample
  PROJ
  src/RosBlazorExample/RosBlazorExample.csproj
  INCLUDE_DLLS
  ${_assemblies_dep_dlls}
)
...

RosBlazorExample.csproj needs to import a generated file for this to work:

  <Import Project="obj/CMake.g.props"/>

New options for install_dotnet()

CD_TO_EXECUTABLE

This option changes the entry point script to change the working directory to the directory of the dotnet executable dll. his is usefull for ASP.NET projets as they expect the resources relative to pwd.

ENTRY_POINT_NAME

This option changes the name of the entry point script. This is the name which ros2 run uses to start the executable.

Example:

...
add_dotnet_executable_project(RosBlazorExample
  PROJ
  src/RosBlazorExample/RosBlazorExample.csproj
  INCLUDE_DLLS
  ${_assemblies_dep_dlls}
)

install_dotnet(RosBlazorExample
  CD_TO_EXECUTABLE
  ENTRY_POINT_NAME
  ros_blazor_example
  DESTINATION
  lib/${PROJECT_NAME}/dotnet
)
...

@hoffmann-stefan hoffmann-stefan changed the title Add add_dotnet_test_project [WIP] Add add_dotnet_test_project Dec 9, 2021
@hoffmann-stefan hoffmann-stefan marked this pull request as ready for review December 9, 2021 16:20
@hoffmann-stefan hoffmann-stefan changed the title [WIP] Add add_dotnet_test_project Add add_dotnet_test_project Dec 10, 2021
@fmessmer
Copy link

fmessmer commented Dec 15, 2021

can't say much about these kind of features - but formally they look consistent

@hoffmann-stefan can you also add this repo to the Mojin Teams (mojin-push, mojin-pull, etc) so we have the correct access?

@hoffmann-stefan
Copy link
Member Author

@fmessmer forgot to add any teams when forking this repo. Now the setup is like the internal ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants