<!-- By default the SDK produces ref assembly for 5.0 or later -->
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
+
+ <!-- Set IsPackable true for all pkgproj as Arcade unconditionally overrides the value. -->
+ <IsPackable Condition="'$(MSBuildProjectExtension)' == '.pkgproj'">true</IsPackable>
</PropertyGroup>
<!-- Language configuration -->
-<Project>
-
+<Project InitialTargets="ErrorForMissingPackageDescription">
<PropertyGroup>
<!--
For non-SDK projects that import this file and then import Microsoft.Common.targets,
<!-- Keep in sync as required by the Packaging SDK in Arcade. -->
<Description>$(PackageDescription)</Description>
</PropertyGroup>
+
+ <!-- Remove when https://github.com/NuGet/Home/issues/10405 is implemented and consumed. -->
+ <Target Name="ErrorForMissingPackageDescription"
+ Condition="'$(IsPackable)' == 'true' and '$(PackageDescription)' == ''">
+ <Error Text="Required property 'PackageDescription' is missing for $(MSBuildProjectName)." />
+ </Target>
</Project>
\ No newline at end of file
<SkipValidatePackage>true</SkipValidatePackage>
</PropertyGroup>
+ <PropertyGroup>
+ <PkgProjPath>$(MSBuildProjectDirectory)\..\pkg\$(MSBuildProjectName).pkgproj</PkgProjPath>
+ <!-- Controls if packages for libraries should be created in (traversal) builds. -->
+ <PackAllLibraries Condition="'$(PackAllLibraries)' == '' and
+ ('$(PreReleaseVersionLabel)' != 'servicing' or
+ '$(BuildAllProjects)' != 'true')">true</PackAllLibraries>
+ <IsPackable Condition="('$(MSBuildProjectExtension)' == '.pkgproj' or
+ ('$(IsSourceProject)' == 'true' and Exists('$(PkgProjPath)'))) and
+ '$(PackAllLibraries)' == 'true'">true</IsPackable>
+ </PropertyGroup>
+
<Import Condition="Exists('$(PkgDir)baseline\baseline.props') and '$(MSBuildProjectExtension)' == '.pkgproj'" Project="$(PkgDir)baseline\baseline.props" />
- <PropertyGroup Condition="'$(OsEnvironment)'=='Unix'">
+ <PropertyGroup Condition="'$(OsEnvironment)' == 'Unix'">
<!--
Building packages fails for two reasons.
First, nuget doesn't like the paths in the nuspec having backslashes as directory separators.
-<Project>
+<Project InitialTargets="_OverridePackDependsOn">
<!-- There are some packages where we require only one ref for a specific framework to be present. In order to avoid problems with this package when targetting
dektop with RAR we will make sure there are no exclude=compile references in the package.
For more info, please check issues:
'%(Dependency.Identity)' != '_._'" />
</Target>
- <PropertyGroup>
- <PkgProjPath>$(MSBuildProjectDirectory)\..\pkg\$(MSBuildProjectName).pkgproj</PkgProjPath>
- <!-- Point to our custom pack target which builds the pkgproj instead. -->
- <PackDependsOn Condition="'$(IsSourceProject)' == 'true' and
- Exists('$(PkgProjPath)')">_BuildPkgProj</PackDependsOn>
- </PropertyGroup>
+ <Target Name="_OverridePackDependsOn"
+ Condition="'$(IsSourceProject)' == 'true' and
+ '$(IsPackable)' == 'true' and
+ Exists('$(PkgProjPath)')">
+ <PropertyGroup>
+ <!-- Point to the custom pack target which invokes the pkgproj. -->
+ <PackDependsOn>_BuildPkgProj</PackDependsOn>
+ </PropertyGroup>
+ </Target>
<Target Name="_BuildPkgProj">
<MSBuild Projects="$(PkgProjPath)"
<PropertyGroup>
<TraversalGlobalProperties>BuildAllProjects=true</TraversalGlobalProperties>
<AdditionalBuildTargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(AdditionalBuildTargetFrameworks);package-$(Configuration)</AdditionalBuildTargetFrameworks>
- <BuildAllOOBPackages Condition="'$(BuildAllOOBPackages)' == ''">true</BuildAllOOBPackages>
</PropertyGroup>
<PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(PkgDir)*\*.proj" Exclude="$(PkgDir)test\*" />
- <ProjectReference Include="$(MSBuildThisFileDirectory)*\src\*.*proj" Condition="('$(BuildAllConfigurations)' == 'true' or '$(DotNetBuildFromSource)' == 'true') And '$(BuildAllOOBPackages)' == 'true'" Exclude="$(MSBuildThisFileDirectory)*\src\**\*.shproj"/>
- <!-- If setting BuildAllOOBPackages to false, add bellow the individual OOB packages you want to continue to build -->
+ <ProjectReference Include="$(MSBuildThisFileDirectory)*\src\*.*proj"
+ Condition="('$(BuildAllConfigurations)' == 'true' or '$(DotNetBuildFromSource)' == 'true')"
+ Exclude="$(MSBuildThisFileDirectory)*\src\**\*.shproj"/>
</ItemGroup>
<!-- Need the PackageIndexFile file property from baseline.props -->