Welcome to mirror list, hosted at ThFree Co, Russian Federation.

libraries-packages.proj « libraries « src - github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1545e5f6773e472d10913fc9ca95aabf1c4f207b (plain)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<Project Sdk="Microsoft.Build.Traversal" DefaultTargets="Pack">

  <PropertyGroup>
    <TraversalGlobalProperties>BuildAllProjects=true</TraversalGlobalProperties>
    <AdditionalBuildTargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(AdditionalBuildTargetFrameworks);package-$(Configuration)</AdditionalBuildTargetFrameworks>
    <BuildAllOOBPackages Condition="'$(BuildAllOOBPackages)' == ''">true</BuildAllOOBPackages>
  </PropertyGroup>
  
  <PropertyGroup>
    <PackagingTaskAssembly>$(NuGetPackageRoot)microsoft.dotnet.build.tasks.packaging\$(MicrosoftDotNetBuildTasksPackagingVersion)\tools\</PackagingTaskAssembly>
    <PackagingTaskAssembly Condition="'$(MSBuildRuntimeType)' == 'core'">$(PackagingTaskAssembly)netcoreapp2.1\</PackagingTaskAssembly>
    <PackagingTaskAssembly Condition="'$(MSBuildRuntimeType)' != 'core'">$(PackagingTaskAssembly)net472\</PackagingTaskAssembly>
    <PackagingTaskAssembly>$(PackagingTaskAssembly)Microsoft.DotNet.Build.Tasks.Packaging.dll</PackagingTaskAssembly>
  </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 -->
  </ItemGroup>

  <!-- Need the PackageIndexFile file property from baseline.props -->
  <Import Project="$(PkgDir)baseline\baseline.props" />

  <!-- Calculate PackageDownload items for restore. -->
  <Import Project="$(RepositoryEngineeringDir)restore\harvestPackages.targets" Condition="'$(MSBuildRestoreSessionId)' != ''" />

  <!--
    Updates the package index to mark all packages we are building that can go stable as stable.
    this will allow for a kicked off build to control package stability at queue time. This does edit
    the package index in-place but that shouldn't cause any problems for official builds are the only
    ones that might do this. After we ship a stable set of packages this target should be ran and the
    changes to the package index should be commited to the repo.
  -->
  <UsingTask TaskName="UpdatePackageIndex" AssemblyFile="$(PackagingTaskAssembly)"/>
  <Target Name="UpdatePackageIndexWithStableVersions"
          BeforeTargets="Build;Pack"
          Condition="'$(DotNetFinalVersionKind)' == 'release'">
    <ItemGroup>
      <!--
      The private packages don't get stabilized so they don't need to be included
      in the set of packages that we are gathering stable versions from.
      -->
      <PkgProjects Include="$(PkgDir)*\*.pkgproj" Exclude="$(MSBuildThisFileDirectory)pkg\*Private*\*.pkgproj" />
      <PkgProjects Include="*\pkg\**\*.pkgproj" />
    </ItemGroup>

    <MSBuild Targets="GetPackageIdentityIfStable"
             BuildInParallel="$(BuildInParallel)"
             Projects="@(PkgProjects)"
             RemoveProperties="Configuration">
      <Output TaskParameter="TargetOutputs" ItemName="_StablePackages" />
    </MSBuild>

    <Message Text="Marking package '%(_StablePackages.Identity)' stable with version '%(_StablePackages.Version)'" />

    <UpdatePackageIndex
      PackageIndexFile="$(PackageIndexFile)"
      StablePackages="@(_StablePackages)" />

  </Target>

  <!-- Generate a version text file we include in our packages -->
  <Target Name="GenerateVersionFileForPackages"
          BeforeTargets="Build;Pack"
          DependsOnTargets="InitializeSourceControlInformationFromSourceControlManager">
    <Error Condition="'$(SourceRevisionId)' == ''" Text="SourceRevisionId is not set, which means the SourceLink targets are not included in the build. Those are needed to produce a correct sha for our build outputs." />

    <MakeDir Directories="$([System.IO.Path]::GetDirectoryName($(VersionFileForPackages)))" />
    <WriteLinesToFile File="$(VersionFileForPackages)"
                      Lines="$(SourceRevisionId)"
                      Overwrite="true" />
  </Target>

  <Target Name="SetAzureDevOpsVariableForBuiltPackages"
          Condition="'$(ContinuousIntegrationBuild)' == 'true'"
          AfterTargets="Build;Pack">
    <ItemGroup>
      <_PackageReports Include="$(PackageReportDir)*.json" />
    </ItemGroup>

    <Message Condition="'@(_PackageReports)' != '' and Exists('$(ArtifactsDir)packages')" Importance="High" Text="##vso[task.setvariable variable=_librariesBuildProducedPackages]true" />
  </Target>

</Project>