pulumi/pkg/codegen/dotnet
Justin Van Patten 277dee6cc1
[codegen/dotnet] Fixes to version.txt (#6398)
We currently include `version.txt` in the package via `<Content Include="version.txt">`. This places the file in the NuGet package in two locations: the `content` directory and `contentFiles`.

We want the file to be in `content` because this is where the Pulumi .NET Language host looks for the file when determining a program's required plugins.

However, having the file in `contentFiles` is problematic. For packages that reference other Pulumi resource packages (e.g. for multi-lang components), referenced `contentFiles` are included in the package by default. This means another package's `version.txt` will be included and used over the current project's `version.txt`. For example, if a multi-lang component package `Pulumi.Xyz` references `Pulumi.Aws`, the `version.txt` from `Pulumi.Aws` will be used in `Pulumi.Xyz` package rather than the intended `version.txt` for `Pulumi.Xyz`.

To address this, stop including `version.txt` in `contentFiles`. We do this by changing the `<Content Include="version.txt" />` to `<None Include="version.txt" Pack="True" PackagePath="content" />` in the project file. This  ensures the file will still be included in the package in the `content` dir (where the Pulumi .NET language host expects to find it), but doesn't include the file in `contentFiles` which would cause it to be used in other packages that reference the package.

Further, when generating `<PackageReference>`s for packages that start with "Pulumi.", include an additional `ExcludeAssets="contentFiles"` attribute to prevent the package's `contentFiles` from being included.
2021-02-22 08:33:16 -08:00
..
doc.go [codegen/*] - Fix enum names that start with an underscore. (#5950) 2020-12-16 09:22:44 -08:00
doc_test.go [codegen/schema] - Expand ObjectTypeSpec to ComplexTypeSpec (#5379) 2020-09-16 13:47:40 -07:00
gen.go [codegen/dotnet]: Fix bugs referencing external resources/types (#6182) 2021-01-26 11:02:34 -08:00
gen_intrinsics.go Initial support for C# program gen (#4611) 2020-05-19 10:18:38 +02:00
gen_program.go Convert config params to outputs only if promise types are seen 2020-10-07 12:29:33 -07:00
gen_program_expressions.go [codegen] Generate null values for model.NoneType (#5122) 2020-08-06 14:12:27 -06:00
gen_program_test.go Turn program gen NYIs into diagnostic errors (#4794) 2020-06-10 10:21:53 -07:00
gen_test.go [codegen/*] - Align makeValidIdentifier between languages (#5944) 2020-12-15 12:41:27 -08:00
importer.go Introduce k8s compatibility mode to C# codegen (#4544) 2020-05-19 11:41:06 +02:00
templates.go [codegen/dotnet] Fixes to version.txt (#6398) 2021-02-22 08:33:16 -08:00
utilities.go [codegen/*] - Fix enum names that start with an underscore. (#5950) 2020-12-16 09:22:44 -08:00
utilities_test.go [codegen/*] - Fix enum names that start with an underscore. (#5950) 2020-12-16 09:22:44 -08:00