Skip to content

Honor RecursiveDir when used on packed items in framework packs #34291

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

Merged
merged 3 commits into from
Jul 13, 2021
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
29 changes: 0 additions & 29 deletions .azure/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -673,35 +673,6 @@ stages:
publishOnError: true
includeForks: true

- template: jobs/default-build.yml
parameters:
condition: ne(variables['SkipTests'], 'true')
jobName: Windows_Templates_Test
jobDisplayName: "Test: Templates - Windows Server 2016 x64"
agentOs: Windows
isTestingJob: true
testRunTitle: Templates-$(AgentOsName)-$(BuildConfiguration)
steps:
- script: ./eng/build.cmd -ci -nobl -all -pack $(_InternalRuntimeDownloadArgs)
displayName: Build Repo
- script: ./src/ProjectTemplates/build.cmd -ci -nobl -noBuildRepoTasks -pack -NoRestore -noBuildNative -NoBuilddeps "/p:RunTemplateTests=true"
displayName: Pack Templates
- script: ./src/ProjectTemplates/build.cmd -ci -nobl -noBuildRepoTasks -test -NoRestore -NoBuild -NoBuilddeps "/p:RunTemplateTests=true"
displayName: Test Templates
artifacts:
- name: Windows_Test_Templates_Dumps
path: artifacts/dumps/
publishOnError: true
includeForks: true
- name: Windows_Test_Templates_Logs
path: artifacts/log/
publishOnError: true
includeForks: true
- name: Windows_Test_Templates_Results
path: artifacts/TestResults/
publishOnError: true
includeForks: true

- template: jobs/default-build.yml
parameters:
condition: ne(variables['SkipTests'], 'true')
Expand Down
5 changes: 1 addition & 4 deletions .azure/pipelines/quarantined-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,7 @@ jobs:
steps:
- powershell: "& ./eng/build.ps1 -CI -nobl -all -pack -NoBuildJava"
displayName: Build
# The templates part can be removed when the Blazor Templates run on Helix
- script: ./src/ProjectTemplates/build.cmd -ci -nobl -pack -NoRestore -NoBuildNative -NoBuilddeps "/p:RunTemplateTests=true"
displayName: Pack Templates
- script: ./eng/build.cmd -ci -nobl -test -NoRestore -NoBuild -NoBuilddeps "/p:RunTemplateTests=true /p:RunQuarantinedTests=true /p:SkipHelixReadyTests=true"
- script: ./eng/build.cmd -ci -nobl -test -NoRestore -NoBuild -NoBuilddeps "/p:RunQuarantinedTests=true /p:SkipHelixReadyTests=true"
displayName: Run Quarantined Tests
continueOnError: true
- task: PublishTestResults@2
Expand Down
14 changes: 13 additions & 1 deletion eng/tools/RepoTasks/CreateFrameworkListFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public override bool Execute()
FileVersion = FileUtilities.GetFileVersion(item.ItemSpec),
IsNative = item.GetMetadata("IsNativeImage") == "true",
IsSymbolFile = item.GetMetadata("IsSymbolFile") == "true",
PackagePath = item.GetMetadata("PackagePath")
PackagePath = GetPackagePath(item)
})
.Where(f =>
!f.IsSymbolFile &&
Expand Down Expand Up @@ -125,5 +125,17 @@ public override bool Execute()

return !Log.HasLoggedErrors;
}
private static string GetPackagePath(ITaskItem item)
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
private static string GetPackagePath(ITaskItem item)
private static string GetPackagePath(ITaskItem item)

{
string packagePath = item.GetMetadata("PackagePath");

// replicate the logic used by PackTask https://github.com/NuGet/NuGet.Client/blob/f24bad0668193ce21a1db8cabd1ce95ba509c7f0/src/NuGet.Core/NuGet.Build.Tasks.Pack/PackTaskLogic.cs#L644-L647
string recursiveDir = item.GetMetadata("RecursiveDir");
recursiveDir = string.IsNullOrEmpty(recursiveDir) ? item.GetMetadata("NuGetRecursiveDir") : recursiveDir;

return string.IsNullOrEmpty(recursiveDir) ? packagePath :
Path.Combine(packagePath, recursiveDir);
}
}

}
11 changes: 5 additions & 6 deletions src/Framework/App.Ref/src/Microsoft.AspNetCore.App.Ref.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
Include="@(AspNetCoreReferenceAssemblyPath->WithMetadataValue('ExternallyResolved', 'true')->'%(RootDir)%(Directory)%(Filename).xml')"
Condition="Exists('%(RootDir)%(Directory)%(Filename).xml')" />

<_AnalyzerContent Include="$(PkgMicrosoft_AspNetCore_Internal_Transport)\$(AnalyzersPackagePath)**\*.*" />
<RefPackContent Include="@(_AnalyzerContent)" PackagePath="$(AnalyzersPackagePath)%(RecursiveDir)" />
<RefPackContent Include="$(PkgMicrosoft_AspNetCore_Internal_Transport)\$(AnalyzersPackagePath)**\*.*" PackagePath="$(AnalyzersPackagePath)" />

<RefPackContent Include="@(AspNetCoreReferenceAssemblyPath)" PackagePath="$(RefAssemblyPackagePath)" />
<RefPackContent Include="@(AspNetCoreReferenceDocXml)" PackagePath="$(RefAssemblyPackagePath)" />
Expand Down Expand Up @@ -204,9 +203,9 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<Target Name="_BatchCopyToLayoutTargetDir"
DependsOnTargets="_ResolveTargetingPackContent"
Inputs="@(RefPackContent)"
Outputs="@(RefPackContent->'$(LayoutTargetDir)%(PackagePath)%(FileName)%(Extension)')">
Outputs="@(RefPackContent->'$(LayoutTargetDir)%(PackagePath)%(RecursiveDir)%(FileName)%(Extension)')">
<Copy SourceFiles="@(RefPackContent)"
DestinationFiles="@(RefPackContent->'$(LayoutTargetDir)%(PackagePath)%(FileName)%(Extension)')"
DestinationFiles="@(RefPackContent->'$(LayoutTargetDir)%(PackagePath)%(RecursiveDir)%(FileName)%(Extension)')"
UseHardlinksIfPossible="true" />
<Message Importance="High" Text="$(MSBuildProjectName) -> $(LayoutTargetDir)" />
</Target>
Expand All @@ -219,9 +218,9 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<Target Name="_InstallTargetingPackIntoLocalDotNet"
DependsOnTargets="_ResolveTargetingPackContent"
Inputs="@(RefPackContent)"
Outputs="@(RefPackContent->'$(LocalInstallationOutputPath)%(PackagePath)%(FileName)%(Extension)')">
Outputs="@(RefPackContent->'$(LocalInstallationOutputPath)%(PackagePath)%(RecursiveDir)%(FileName)%(Extension)')">
<Copy SourceFiles="@(RefPackContent)"
DestinationFiles="@(RefPackContent->'$(LocalInstallationOutputPath)%(PackagePath)%(FileName)%(Extension)')"
DestinationFiles="@(RefPackContent->'$(LocalInstallationOutputPath)%(PackagePath)%(RecursiveDir)%(FileName)%(Extension)')"
UseHardlinksIfPossible="true" />
<Message Importance="High" Text="$(MSBuildProjectName) -> $(LocalInstallationOutputPath)" />
</Target>
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/test/TargetingPackTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ void CompareFrameworkElements(HashSet<string> expectedAssemblyNames, IEnumerable
});
}

[Fact(Skip = "Skip until layout issues are resolved. See https://github.com/dotnet/aspnetcore/pull/34033")]
[Fact]
public void FrameworkListListsContainsCorrectPaths()
{
if (!_isTargetingPackBuilding || string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
Expand Down
1 change: 0 additions & 1 deletion src/ProjectTemplates/test/ProjectTemplates.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

<RunTemplateTests Condition="'$(RunTemplateTests)' == ''" >true</RunTemplateTests>
<SkipTests Condition="'$(RunTemplateTests)' != 'true'">true</SkipTests>
<BuildHelixPayload>false</BuildHelixPayload>

<BaseOutputPath />
<OutputPath />
Expand Down