18
18
- Ioc: a helper class to configure dependency injection service containers.
19
19
</Description >
20
20
<PackageTags >MVVM;Toolkit;MVVMToolkit;INotifyPropertyChanged;Observable;IOC;DI;Dependency Injection;Object Messaging;Extensions;Helpers</PackageTags >
21
- <TargetsForTfmSpecificContentInPackage >$(TargetsForTfmSpecificContentInPackage);CopyAnalyzerProjectReferencesToPackage</TargetsForTfmSpecificContentInPackage >
22
21
</PropertyGroup >
23
22
24
23
<!-- .NET Standard 2.0 doesn't have the Span<T> and IAsyncEnumerable<T> types -->
36
35
</ItemGroup >
37
36
38
37
<!-- Source generator project reference for packing -->
39
- <ItemGroup >
40
- <ProjectReference Include =" ..\CommunityToolkit.Mvvm.SourceGenerators\CommunityToolkit.Mvvm.SourceGenerators.csproj" PrivateAssets = " all " />
38
+ <ItemGroup Condition = " '$(TargetFramework)' == 'netstandard2.0' " >
39
+ <ProjectReference Include =" ..\CommunityToolkit.Mvvm.SourceGenerators\CommunityToolkit.Mvvm.SourceGenerators.csproj" ReferenceOutputAssembly = " false " />
41
40
</ItemGroup >
42
41
43
- <!--
44
- Target to pack the source generator into the "analyzers\dotnet\cs" package folder.
45
- The condition is set to .NET Standard 2.0 so that the analyzer is only added to the package
46
- when that target is being built, instead of once for all three targets, which would fail.
47
- It will still be available for all targets anyway though, as analyzers don't have a target.
48
- -->
49
- <Target Name =" CopyAnalyzerProjectReferencesToPackage" DependsOnTargets =" BuildOnlySettings;ResolveReferences" Condition =" '$(TargetFramework)' == 'netstandard2.0' " >
50
- <ItemGroup >
51
- <TfmSpecificPackageFile Include =" @(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference')->WithMetadataValue('PrivateAssets', 'All'))" >
52
- <PackagePath >analyzers\dotnet\cs</PackagePath >
53
- </TfmSpecificPackageFile >
54
- </ItemGroup >
55
- </Target >
42
+ <ItemGroup Label =" Package" >
43
+
44
+ <!-- Include the custom .targets file to check the source generator (.NET 6 is not needed as it guarantees Roslyn 4.x) -->
45
+ <None Include =" CommunityToolkit.Mvvm.targets" PackagePath =" buildTransitive\netstandard2.0" Pack =" true" />
46
+ <None Include =" CommunityToolkit.Mvvm.targets" PackagePath =" buildTransitive\netstandard2.1" Pack =" true" />
47
+ <None Include =" CommunityToolkit.Mvvm.targets" PackagePath =" build\netstandard2.0" Pack =" true" />
48
+ <None Include =" CommunityToolkit.Mvvm.targets" PackagePath =" build\netstandard2.1" Pack =" true" />
49
+
50
+ <!-- Pack the source generator to the right package folder -->
51
+ <None Include =" ..\CommunityToolkit.Mvvm.SourceGenerators\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Mvvm.SourceGenerators.dll"
52
+ PackagePath =" analyzers\dotnet\roslyn4.0\cs"
53
+ Pack =" true"
54
+ Visible =" false" />
55
+ </ItemGroup >
56
56
57
57
</Project >
0 commit comments