Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GenerateFileFromTemplate task from arcade instead of repo copy #96049

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eng/Tools.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Packaging" Version="$(MicrosoftDotNetBuildTasksPackagingVersion)" />
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Templating" Version="$(MicrosoftDotNetBuildTasksTemplatingVersion)" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this required?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .pkgproj didn't work otherwise.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annoying pkgprojs. Right, they might use Arcade's Tools.proj project.assets.json and nuget.g.props and nuget.g.targets files.

</ItemGroup>

<!-- excluded from source build -->
Expand Down
6 changes: 1 addition & 5 deletions eng/testing/workloads-testing.targets
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,6 @@
TaskName="Microsoft.Workload.Build.Tasks.InstallWorkloadFromArtifacts"
AssemblyFile="$(WorkloadBuildTasksAssemblyPath)" />

<UsingTask Condition="'$(InstallWorkloadForTesting)' == 'true'"
TaskName="GenerateFileFromTemplate"
AssemblyFile="$(WorkloadBuildTasksAssemblyPath)" />

<Target Name="InstallWorkloadUsingArtifacts"
AfterTargets="ArchiveTests"
DependsOnTargets="$(InstallWorkloadUsingArtifactsDependsOn)"
Expand All @@ -193,7 +189,7 @@
" />

<MSBuild Projects="%(_NuGetsToBuild.Project)"
Properties="%(_NuGetsToBuild.Properties)"
Properties="%(_NuGetsToBuild.Properties);MSBuildRestoreSessionId=$([System.Guid]::NewGuid())"
Targets="Restore" />
<MSBuild Projects="%(_NuGetsToBuild.Project)"
Properties="%(_NuGetsToBuild.Properties)"
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/.nuget/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<!-- Packaging projects (.pkgproj) are non-SDK-style, so they need to directly import Directory.Build.props -->
<Import Project="..\Directory.Build.props" />
<Import Project="$(NuGetPackageRoot)\microsoft.dotnet.build.tasks.packaging\$(MicrosoftDotNetBuildTasksPackagingVersion)\build\Microsoft.DotNet.Build.Tasks.Packaging.props" />
<Import Project="$(NuGetPackageRoot)\microsoft.dotnet.build.tasks.templating\$(MicrosoftDotNetBuildTasksTemplatingVersion)\build\Microsoft.DotNet.Build.Tasks.Templating.props" />

<PropertyGroup>
<!-- Defined in Packaging.targets, but we need this before targets are imported -->
Expand Down
1 change: 1 addition & 0 deletions src/installer/pkg/projects/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,6 @@

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Packaging" Version="$(MicrosoftDotNetBuildTasksPackagingVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Templating" Version="$(MicrosoftDotNetBuildTasksTemplatingVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,5 @@
<PackageReference Condition="'$(SkipInstallersPackageReference)' != 'true'" Include="Microsoft.DotNet.Build.Tasks.Installers" Version="$(MicrosoftDotNetBuildTasksInstallersVersion)" />
</ItemGroup>

<UsingTask TaskName="GenerateFileFromTemplate" AssemblyFile="$(WorkloadBuildTasksAssemblyPath)" />

<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets, $(MSBuildThisFileDirectory)..))" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,20 @@
<GenerateFileFromTemplate
Condition="!$([MSBuild]::IsOsPlatform('Windows'))"
TemplateFile="Microsoft.NETCore.App.MonoCrossAOT.UnixFilePermissions.xml.in"
Properties="@(_PermissionsProperties)"
Properties="@(_PermissionsProperties->'%(Identity)=%(Value)')"
OutputPath="$(IntermediateOutputPath)Microsoft.NETCore.App.MonoCrossAOT.UnixFilePermissions.xml" />
<GenerateFileFromTemplate
TemplateFile="Microsoft.NETCore.App.MonoCrossAOT.Sdk.props.in"
Properties="@(_SdkPropsProperties)"
Properties="@(_SdkPropsProperties->'%(Identity)=%(Value)')"
OutputPath="$(IntermediateOutputPath)$(TargetCrossRid).Sdk.props" />
</Target>

<Target Name="ValidateProperties" BeforeTargets="GetFilesToPackage">
<Error Condition="'$(TargetCrossRid)' == ''" Text="TargetCrossRid not set" />
<Error Condition="!Exists('$(AotCompilerPath)$(AotCompilerFileName)')" Text="Cross compiler not found in $(AotCompilerPath). MonoAotCrossDir=$(MonoAotCrossDir)" />
</Target>

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Templating" Version="$(MicrosoftDotNetBuildTasksTemplatingVersion)" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions src/mono/nuget/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project>
<!-- Packaging projects (.pkgproj) are non-SDK-style, so they need to directly import Directory.Build.props -->
<Import Project="..\Directory.Build.props" />
<Import Project="$(NuGetPackageRoot)\microsoft.dotnet.build.tasks.templating\$(MicrosoftDotNetBuildTasksTemplatingVersion)\build\Microsoft.DotNet.Build.Tasks.Templating.props" />
<Import Project="$(NuGetPackageRoot)\microsoft.dotnet.build.tasks.packaging\$(MicrosoftDotNetBuildTasksPackagingVersion)\build\Microsoft.DotNet.Build.Tasks.Packaging.props" />

<PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion src/mono/nuget/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<Project>
<UsingTask TaskName="GenerateFileFromTemplate" AssemblyFile="$(WorkloadBuildTasksAssemblyPath)" />
<Import Project="..\Directory.Build.targets" />

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<GenerateFileFromTemplate
TemplateFile="Sdk/Sdk.targets.in"
Properties="@(_ReplacementValue)"
Properties="@(_ReplacementValue->'%(Identity)=%(Value)')"
OutputPath="$(SdkTargetsPath)" />

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<GenerateFileFromTemplate
TemplateFile="Sdk/Sdk.props.in"
Properties="@(_ReplacementValue)"
Properties="@(_ReplacementValue->'%(Identity)=%(Value)')"
OutputPath="$(SdkPropsPath)" />

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<GenerateFileFromTemplate
TemplateFile="Sdk/MonoTargetsTasks.props.in"
Properties="@(_ReplacementValue)"
Properties="@(_ReplacementValue->'%(Identity)=%(Value)')"
OutputPath="$(MonoTargetsTasksPropsPath)" />

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

<GenerateFileFromTemplate
TemplateFile="Sdk/Sdk.targets.in"
Properties="@(_ReplacementValue)"
Properties="@(_ReplacementValue->'%(Identity)=%(Value)')"
OutputPath="$(SdkTargetsPath)" />

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<GenerateFileFromTemplate
TemplateFile="Sdk/Sdk.targets.in"
Properties="@(_ReplacementValue)"
Properties="@(_ReplacementValue->'%(Identity)=%(Value)')"
OutputPath="$(SdkTargetsPath)" />

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@

<GenerateFileFromTemplate
TemplateFile="WorkloadManifest.json.in"
Properties="@(_WorkloadManifestValues)"
Properties="@(_WorkloadManifestValues->'%(Identity)=%(Value)')"
OutputPath="$(WorkloadManifestPath)" />

<GenerateFileFromTemplate
TemplateFile="WorkloadManifest.targets.in"
Properties="@(_WorkloadManifestValues)"
Properties="@(_WorkloadManifestValues->'%(Identity)=%(Value)')"
OutputPath="$(WorkloadManifestTargetsPath)" />

<GenerateFileFromTemplate
TemplateFile="WorkloadManifest.Wasi.targets.in"
Properties="@(_WorkloadManifestValues)"
Properties="@(_WorkloadManifestValues->'%(Identity)=%(Value)')"
OutputPath="$(WorkloadManifestWasiTargetsPath)" />
</Target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@

<GenerateFileFromTemplate
TemplateFile="WorkloadManifest.json.in"
Properties="@(_WorkloadManifestValues)"
Properties="@(_WorkloadManifestValues->'%(Identity)=%(Value)')"
OutputPath="$(WorkloadManifestPath)" />

<GenerateFileFromTemplate
TemplateFile="WorkloadManifest.targets.in"
Properties="@(_WorkloadManifestValues)"
Properties="@(_WorkloadManifestValues->'%(Identity)=%(Value)')"
OutputPath="$(WorkloadManifestTargetsPath)" />
</Target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@

<GenerateFileFromTemplate
TemplateFile="WorkloadManifest.json.in"
Properties="@(_WorkloadManifestValues)"
Properties="@(_WorkloadManifestValues->'%(Identity)=%(Value)')"
OutputPath="$(WorkloadManifestPath)" />

<GenerateFileFromTemplate
TemplateFile="WorkloadManifest.targets.in"
Properties="@(_WorkloadManifestValues)"
Properties="@(_WorkloadManifestValues->'%(Identity)=%(Value)')"
OutputPath="$(WorkloadManifestTargetsPath)" />
</Target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@

<GenerateFileFromTemplate
TemplateFile="WorkloadManifest.json.in"
Properties="@(_WorkloadManifestValues)"
Properties="@(_WorkloadManifestValues->'%(Identity)=%(Value)')"
OutputPath="$(WorkloadManifestPath)" />

<GenerateFileFromTemplate
TemplateFile="WorkloadManifest.targets.in"
Properties="@(_WorkloadManifestValues)"
Properties="@(_WorkloadManifestValues->'%(Identity)=%(Value)')"
OutputPath="$(WorkloadManifestTargetsPath)" />
</Target>

Expand Down
150 changes: 0 additions & 150 deletions src/tasks/WorkloadBuildTasks/GenerateFileFromTemplate.cs

This file was deleted.

Loading