Replies: 1 comment
-
The first scenario where
The problem is that when we pack such a module, packing happens after the build of both TFMs (if not yet built), then when the pack happens, the nuget script looks at the .props files to use for packing, and in that case it was not using the .props file under the The second scenario is with the same multi TFMs module as described above but referenced as a project by a single TFM application (if the app is multi targetable it was working), here the .targets script of the
To fix this second scenario, we just needed to do the same for the .targets file of the For this 2nd scenario, see the use case in #8734 |
Beta Was this translation helpful? Give feedback.
-
While looking at changes in #8742, I seemed to recall the documentation of
buildMultiTargeting
stating different behavior. Specifically, looking at the statement here:OrchardCore/src/OrchardCore/OrchardCore.Module.Targets/OrchardCore.Module.Targets.csproj
Lines 16 to 23 in 25ef9dd
I put together a quick test app (attached) to see if I could track down the behavior.
nuget-props-test.zip
To run the test properly, build the
PackTest1
lib first and copy the resulting nuget package toPackTest1/nuget
folder. Then build thePackTest2
lib or the solution.I added several prop files to different folders in the PackTest1 nuget lib.
Each of the props file has similar contents. The goal is to identify if the props file was properly included in the
PackTest2
build. Thebuild\net5.0
props file has the following contents:and the
build
props file has the following:In the PackTest2.csproj, the
PackTestBuildProps
are printed out with:Here's a summary of the output I got based on different configurations of .props files in different folders. (You can see this in the comments of the PackTest1.csproj..you'll need to edit that file to test the different scenarios. Each test was:
1) Edit the PackTest1.csproj to copy different props files to different folders for the desired test
1)
dotnet nuget local -c all
1) build the PackTest1.csproj again using
dotnet build && cp bin/Debug/PackTest1.1.0.0.nupkg nuget
1)
dotnet build
in thePackTest2
folder@jtkech Based on the above, wouldn't we want to keep everything just the
build
folder unless it was specific for a TFM? It seems like thebuildMultiTargeting
folder is more useful for managing targets that need to be done once per nuget package rather than including .props files that sets properties needed for the assembly to be built properly? Specifically because it seems that thebuildMultiTargeting
folder is not included for each TFM assembly build. Unless I'm missing something?Beta Was this translation helpful? Give feedback.
All reactions