-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathGetProjectProperties.targets
More file actions
33 lines (29 loc) · 2.29 KB
/
GetProjectProperties.targets
File metadata and controls
33 lines (29 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<Project>
<PropertyGroup>
<!-- Handle the varying properties across the SDK version/PackageReference methods for enabling containerization.
For the PackageReference, SDKContainerSupportEnabled is present. For the SDK built-in version, EnableSdkContainerSupport is the primary flag.
Certain project types have it set automatically, while others require users to manually set the property.
So for compat, we need to make sure and be responsive to both flags to check if a project supports containerization. -->
<EnableSdkContainerSupport Condition=" '$(EnableSdkContainerSupport)' == '' ">$(SDKContainerSupportEnabled)</EnableSdkContainerSupport>
<GetProjectPropertiesDependsOn Condition=" '$(EnableSdkContainerSupport)' == 'true' ">$(GetProjectPropertiesDependsOn);ComputeContainerConfig;</GetProjectPropertiesDependsOn>
<!-- Temporary patch for .NET 10 Previews 3 and 4. -->
<GetProjectPropertiesDependsOn Condition=" $([MSBuild]::VersionEquals($(NetCoreSdkVersion), 10.0.100-preview.3)) or $([MSBuild]::VersionEquals($(NetCoreSdkVersion), 10.0.100-preview.4)) ">$(GetProjectPropertiesDependsOn);_ComputeContainerExecutionArgs</GetProjectPropertiesDependsOn>
<!-- Temporary patch for .NET 10 Previews 5 and 6. -->
<GetProjectPropertiesDependsOn Condition=" $([MSBuild]::VersionEquals($(NetCoreSdkVersion), 10.0.100-preview.5)) or $([MSBuild]::VersionEquals($(NetCoreSdkVersion), 10.0.100-preview.6)) ">$(GetProjectPropertiesDependsOn);_ContainerEstablishRIDNess;_ComputeContainerExecutionArgs</GetProjectPropertiesDependsOn>
</PropertyGroup>
<Target Name="GetProjectProperties" DependsOnTargets="$(GetProjectPropertiesDependsOn)">
<PropertyGroup>
<InferImageName>$(ContainerRepository)</InferImageName>
<InferImageName Condition=" '$(InferImageName)' == '' ">$(ContainerImageName)</InferImageName>
</PropertyGroup>
<WriteLinesToFile
File="$(InfoOutputPath)"
Lines="$(AssemblyName).dll
$(TargetFramework)$(TargetFrameworks.Split(';')[0])
$(OutputPath)$(AssemblyName).dll
$(ContainerWorkingDirectory)/$(AssemblyName).dll
$(EnableSdkContainerSupport)
$(InferImageName)"
Overwrite="True" />
</Target>
</Project>