dotnet: Use multiple TFM in samples

This commit is contained in:
Corentin Le Molgat
2021-12-06 12:02:40 +01:00
parent 949ff20da4
commit a6408ddb3b
4 changed files with 6 additions and 6 deletions

View File

@@ -350,7 +350,7 @@ function(add_dotnet_sample FILE_NAME)
if(BUILD_TESTING)
add_test(
NAME dotnet_${COMPONENT_NAME}_${SAMPLE_NAME}
COMMAND ${DOTNET_EXECUTABLE} run --no-build -c Release
COMMAND ${DOTNET_EXECUTABLE} run --no-build --framework net6.0 -c Release
WORKING_DIRECTORY ${DOTNET_SAMPLE_DIR})
endif()
message(STATUS "Configuring sample ${FILE_NAME} done")
@@ -411,7 +411,7 @@ function(add_dotnet_example FILE_NAME)
if(BUILD_TESTING)
add_test(
NAME dotnet_${COMPONENT_NAME}_${EXAMPLE_NAME}
COMMAND ${DOTNET_EXECUTABLE} run --no-build -c Release
COMMAND ${DOTNET_EXECUTABLE} run --no-build --framework net6.0 -c Release
WORKING_DIRECTORY ${DOTNET_EXAMPLE_DIR})
endif()
message(STATUS "Configuring example ${FILE_NAME} done")

View File

@@ -590,7 +590,7 @@ rdotnet_%: \
$$(TEMP_DOTNET_DIR)/$1/%/%.cs \
FORCE
cd $$(TEMP_DOTNET_DIR)$$S$1$$S$$* && "$$(DOTNET_BIN)" build -c Release
cd $$(TEMP_DOTNET_DIR)$$S$1$$S$$* && "$$(DOTNET_BIN)" run --no-build -c Release $$(ARGS)
cd $$(TEMP_DOTNET_DIR)$$S$1$$S$$* && "$$(DOTNET_BIN)" run --no-build --framework net6.0 -c Release $$(ARGS)
endef
$(foreach sample,$(DOTNET_SAMPLES),$(eval $(call dotnet-sample-target,$(sample))))
@@ -639,7 +639,7 @@ rdotnet_%: \
$$(TEMP_DOTNET_DIR)/$1/%/%.cs \
FORCE
cd $$(TEMP_DOTNET_DIR)$$S$1$$S$$* && "$$(DOTNET_BIN)" build -c Release
cd $$(TEMP_DOTNET_DIR)$$S$1$$S$$* && "$$(DOTNET_BIN)" test --no-build -c Release $$(ARGS)
cd $$(TEMP_DOTNET_DIR)$$S$1$$S$$* && "$$(DOTNET_BIN)" run --no-build --framework net6.0 -c Release $$(ARGS)
endef
$(foreach example,$(DOTNET_EXAMPLES),$(eval $(call dotnet-example-target,$(example))))

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<LangVersion>8.0</LangVersion>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
<EnableDefaultItems>false</EnableDefaultItems>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<!-- see https://github.com/dotnet/docs/issues/12237 -->

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<LangVersion>8.0</LangVersion>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
<EnableDefaultItems>false</EnableDefaultItems>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<!-- see https://github.com/dotnet/docs/issues/12237 -->