Azure / iot-edge-v1

Azure IoT Edge
http://azure.github.io/iot-edge/
Other
525 stars 258 forks source link

[Suggestion][Dotnet-Binding] Add makefile to include dotnet binding projects into build process. #57

Closed yphuangms closed 6 years ago

yphuangms commented 8 years ago

For the convenience to build and to debug/run those dotnet modules, "CMakeLists.txt" could be added into these project folders, and add these folder into parent folder "CMakeLists.txt".

For example,

  1. To add "Microsoft.Azure.IoT.Gateway" into build process, add "%build-root%\bindings\dotnet\dotnet-binding\Microsoft.Azure.IoT.Gateway\CMakeLists.txt", content of this file:
include_external_msproject(Microsoft.Azure.IoT.Gateway ${azure_iot_gateway_sdk_SOURCE_DIR}/bindings/dotnet/dotnet-binding/Microsoft.Azure.IoT.Gateway/Microsoft.Azure.IoT.Gateway.csproj)
add_binding_to_solution(Microsoft.Azure.IoT.Gateway)

To add "SensorModule" module sample into build process, add ""%build-root%\bindings\dotnet\dotnet-binding\SensorModule\CMakeLists.txt"

include_external_msproject(SensorModule ${azure_iot_gateway_sdk_SOURCE_DIR}/bindings/dotnet/dotnet-binding/SensorModule/SensorModule.csproj)
add_binding_to_solution(SensorModule)
  1. And add "%build-root%\bindings\dotnet\dotnet-binding\CMakeLists.txt", content of this file:

    add_subdirectory(Microsoft.Azure.IoT.Gateway)
    add_subdirectory(SensorModule)
    add_subdirectory(PrinterModule)
  2. Apply the same methods above to those dotnet modules you would like to add into build process.

  3. Modify to add one line at the end of file of "%build-root%\bindings\dotnet\CMakeLists.txt"

add_subdirectory(dotnet-binding)
  1. Start to build using "build.cmd" with dotnet-binding enabled.

Later on, when "build.cmd --enable-dotnet-binding" is done, find the gateway SDK Visual Studio Solution file at "%build-root%\build\azure_iot_gateway_sdk.sln". Open this solution file to start build/debug/run the gateway sample program for dotnet modules. To debug into dotnet modules, one project properties needs to be changed for debugging in gateway sample program, open "dotnet_binding_sample" project property page, select "Configuration Properties>Debugging", and modify following property values:

-- "Command Arguments" : (JSON configuration file path) -- "Working Directory": "$(OutDir)" -- "Debugger Type": "Mixed"

By doing so, it will work when you set breakpoint at dotnet modules and debug step by step between native C code and dotnet code.

aribeironovaes commented 8 years ago

Great Suggestion @yphuangms!

I will add here to out backlog try it out and add.

Remember that you can always do a Pull Request and contribute back! This would be a great contribution.

Let us know,

Angelo Ribeiro.

myagley commented 6 years ago

Thanks for the feature request. However, at this time, we are not planning to take on this work. We would be happy to take a pull request. Thanks!