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

Restore PackageReferences in temporary assembly projects to import build extensions #1056

Closed
wants to merge 2 commits into from
Closed
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
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
Compat issues with assembly PresentationBuildTasks:
MembersMustExist : Member 'Microsoft.Build.Tasks.Windows.GenerateTemporaryTargetAssembly.CompileTypeName.get()' does not exist in the implementation but it does exist in the contract.
Copy link
Member

Choose a reason for hiding this comment

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

There is a larger unrelated questions we should try to address - namely whether ref-assembly for PresentationBuildTasks needs to be rolled into the ref-pack for .NET Core 3.0.

@nguerrera?

MembersMustExist : Member 'Microsoft.Build.Tasks.Windows.GenerateTemporaryTargetAssembly.CompileTypeName.set(System.String)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'Microsoft.Build.Tasks.Windows.GenerateTemporaryTargetAssembly.GeneratedCodeFiles.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'Microsoft.Build.Tasks.Windows.GenerateTemporaryTargetAssembly.GeneratedCodeFiles.set(Microsoft.Build.Framework.ITaskItem[])' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'Microsoft.Build.Tasks.Windows.GenerateTemporaryTargetAssembly.MSBuildBinPath.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'Microsoft.Build.Tasks.Windows.GenerateTemporaryTargetAssembly.MSBuildBinPath.set(System.String)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'Microsoft.Build.Tasks.Windows.GenerateTemporaryTargetAssembly.ReferencePath.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'Microsoft.Build.Tasks.Windows.GenerateTemporaryTargetAssembly.ReferencePath.set(Microsoft.Build.Framework.ITaskItem[])' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'Microsoft.Build.Tasks.Windows.GenerateTemporaryTargetAssembly.ReferencePathTypeName.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'Microsoft.Build.Tasks.Windows.GenerateTemporaryTargetAssembly.ReferencePathTypeName.set(System.String)' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'Microsoft.Build.Tasks.Windows.GetWinFXPath' does not exist in the implementation but it does exist in the contract.
Total Issues: 1
Total Issues: 11
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<UsingTask TaskName="Microsoft.Build.Tasks.Windows.FileClassifier" AssemblyFile="$(_PresentationBuildTasksAssembly)" />
<UsingTask TaskName="Microsoft.Build.Tasks.Windows.MarkupCompilePass2" AssemblyFile="$(_PresentationBuildTasksAssembly)" />
<UsingTask TaskName="Microsoft.Build.Tasks.Windows.GenerateTemporaryTargetAssembly" AssemblyFile="$(_PresentationBuildTasksAssembly)" />
<UsingTask TaskName="Microsoft.Build.Tasks.Windows.CreateTemporaryTargetAssemblyProject" AssemblyFile="$(_PresentationBuildTasksAssembly)" />
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason you chose CreateTemporaryTargetAssemblyProject, instead of calling the task GenerateTemporaryTargetAssemblyProject and keep naming in line with previous task names?

<UsingTask TaskName="Microsoft.Build.Tasks.Windows.RunProjectBuildTarget" AssemblyFile="$(_PresentationBuildTasksAssembly)" />
<UsingTask TaskName="Microsoft.Build.Tasks.Windows.MergeLocalizationDirectives" AssemblyFile="$(_PresentationBuildTasksAssembly)" />


Expand Down Expand Up @@ -380,6 +382,8 @@
<PropertyGroup>

<MarkupCompilePass2ForMainAssemblyDependsOn>
CreateTemporaryTargetAssemblyProject;
RestoreTemporaryTargetAssemblyProject;
Copy link
Member

Choose a reason for hiding this comment

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

I would recommend renaming this target as "RunRestoreTargetOnTemporaryTargetAssemblyProject"

GenerateTemporaryTargetAssembly;
MarkupCompilePass2;
AfterMarkupCompilePass2;
Expand All @@ -400,6 +404,57 @@

</Target>

<!--

==========================================
CreateTemporaryTargetAssemblyProject
==========================================

Name : CreateTemporaryTargetAssemblyProject

-->

<Target Name="CreateTemporaryTargetAssemblyProject"
Condition="'$(_RequireMCPass2ForMainAssembly)' == 'true' " >

<CreateTemporaryTargetAssemblyProject
CurrentProject="$(MSBuildProjectFullPath)"
GeneratedCodeFiles="@(_GeneratedCodeFiles)"
CompileTypeName="Compile"
ReferencePath="@(ReferencePath)"
ReferencePathTypeName="ReferencePath" >
<Output TaskParameter="TemporaryTargetAssemblyProjectName" PropertyName="_TemporaryTargetAssemblyProjectName"/>
</CreateTemporaryTargetAssemblyProject>

<Message Text="GenerateTemporaryTargetAssembyProject project is $(_TemporaryTargetAssemblyProjectName)" />

</Target>

<!--

==========================================
RestoreTemporaryTargetAssemblyProject
==========================================

Name : RestoreTemporaryTargetAssemblyProject

-->

<Target Name="RestoreTemporaryTargetAssemblyProject"
Condition="'$(_RequireMCPass2ForMainAssembly)' == 'true' " >

<Message Text="RestoreTemporaryTargetAssemblyProject project is $(_TemporaryTargetAssemblyProjectName)" Condition="'$(MSBuildTargetsVerbose)' == 'true'" />

<RunProjectBuildTarget
ProjectName="$(_TemporaryTargetAssemblyProjectName)"
BuildTarget="Restore"
Copy link
Member

Choose a reason for hiding this comment

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

Use a pattern similar to that in <Target Name="_CompileTemporaryAssembly" DependsOnTargets="BuildOnlySettings;ResolveKeySource;CoreCompile" /> and <_CompileTargetNameForLocalType Condition="'$(_CompileTargetNameForLocalType)' == ''">_CompileTemporaryAssembly</_CompileTargetNameForLocalType> used in GenerateTemporaryTargetAssembly

/>

<CreateItem Include="$(IntermediateOutputPath)$(TargetFileName)" >
<Output TaskParameter="Include" ItemName="AssemblyForLocalTypeReference" />
</CreateItem>

</Target>

<!--

Expand All @@ -418,13 +473,9 @@

<GenerateTemporaryTargetAssembly
CurrentProject="$(MSBuildProjectFullPath)"
MSBuildBinPath="$(MSBuildBinPath)"
ReferencePathTypeName="ReferencePath"
CompileTypeName="Compile"
GeneratedCodeFiles="@(_GeneratedCodeFiles)"
ReferencePath="@(ReferencePath)"
IntermediateOutputPath="$(IntermediateOutputPath)"
AssemblyName="$(AssemblyName)"
TemporaryTargetAssemblyProjectName="$(_TemporaryTargetAssemblyProjectName)"
CompileTargetName="$(_CompileTargetNameForLocalType)"
GenerateTemporaryTargetAssemblyDebuggingInformation="$(GenerateTemporaryTargetAssemblyDebuggingInformation)"
>
Expand Down
Loading