|
1 | 1 | <Project>
|
2 |
| - <PropertyGroup> |
3 |
| - <_TemplatesDirectory>$(MSBuildThisFileDirectory)tools\templates\</_TemplatesDirectory> |
4 |
| - <_WorkRoot>$(RepositoryRoot).w\</_WorkRoot> |
5 |
| - <PreviousArchivePropsFile>$(MSBuildThisFileDirectory)PreviousArchiveManifest.props</PreviousArchivePropsFile> |
6 |
| - <MetapackageRestoreSource>$(RepositoryRoot).deps\Signed\Packages\</MetapackageRestoreSource> |
7 |
| - <LzmaOutputPackageName>nuGetPackagesArchive-$(PackageVersion)</LzmaOutputPackageName> |
8 |
| - <FallbackStagingDir>$(_WorkRoot)obj\$(LzmaOutputPackageName)\</FallbackStagingDir> |
9 |
| - <FallbackOutputDir>$(ArtifactsDir)lzma\</FallbackOutputDir> |
10 |
| - <FallbackOutputPath>$(FallbackOutputDir)$(LzmaOutputPackageName).lzma</FallbackOutputPath> |
11 |
| - <FallbackAntaresZipOutputPath>$(FallbackOutputDir)$(LzmaOutputPackageName)-antares.zip</FallbackAntaresZipOutputPath> |
12 |
| - <GeneratedFallbackRestoreSourcesPropsPath>$(_WorkRoot)restoresources.$(LzmaOutputPackageName).props</GeneratedFallbackRestoreSourcesPropsPath> |
13 |
| - </PropertyGroup> |
14 |
| - |
15 |
| - <Import Project="$(PreviousArchivePropsFile)" Condition="Exists($(PreviousArchivePropsFile))" /> |
16 |
| - |
17 |
| - <Target Name="BuildFallbackArchive" DependsOnTargets="ResolveRepoInfo"> |
18 |
| - <!-- Clear the directories --> |
19 |
| - <RemoveDir Directories="$(_WorkRoot)" /> |
20 |
| - |
21 |
| - <!-- Copy the archive template --> |
22 |
| - <Copy SourceFiles="$(_TemplatesDirectory)Archive\Archive.csproj" DestinationFiles="$(_WorkRoot)Archive.csproj" /> |
23 |
| - |
24 |
| - <!-- Copy the archive template --> |
25 |
| - <RepoTasks.AddArchiveReferences |
26 |
| - ReferencePackagePath="$(_WorkRoot)Archive.csproj" |
27 |
| - BuildArtifacts="@(ArtifactInfo)" |
28 |
| - PackageArtifacts="@(PackageArtifact)" |
29 |
| - ExternalDependencies="@(ExternalDependency)" |
30 |
| - MetapackageVersion="$(LZMAMicrosoftAspNetCoreAppAll21PackageVersion)" /> |
| 2 | + <Target Name="BuildFallbackArchive" DependsOnTargets="ResolveRepoInfo;GeneratePropsFiles"> |
31 | 3 |
|
32 | 4 | <ItemGroup>
|
33 |
| - <_FallbackArchiveRestoreSources Include="$(RestoreSources)" /> |
34 |
| - <_FallbackArchiveRestoreSources Include="$(BuildDir)" Condition="Exists($(BuildDir))" /> |
35 |
| - <_FallbackArchiveRestoreSources Include="$(MetapackageRestoreSource)" Condition="Exists($(MetapackageRestoreSource))" /> |
| 5 | + <ArchiveProjects Include="$(RepositoryRoot)src\PackageArchive\Archive.*\*.*proj" /> |
36 | 6 | </ItemGroup>
|
37 | 7 |
|
38 |
| - <RepoTasks.GenerateRestoreSourcesPropsFile |
39 |
| - Sources="@(_FallbackArchiveRestoreSources)" |
40 |
| - OutputPath="$(GeneratedFallbackRestoreSourcesPropsPath)" /> |
41 |
| - |
42 |
| - <!-- Create the Staging Dir --> |
43 |
| - <MakeDir Directories="$(FallbackStagingDir);$(FallbackOutputDir)" /> |
44 |
| - |
45 |
| - <!-- Restore the target project --> |
46 |
| - <MSBuild |
47 |
| - Projects="$(_WorkRoot)Archive.csproj" |
48 |
| - Targets="Restore" |
49 |
| - Properties="RestorePackagesPath=$(FallbackStagingDir);RuntimeFrameworkVersion=$(LZMAMicrosoftNETCoreApp21PackageVersion);DotNetRestoreSourcePropsPath=$(GeneratedFallbackRestoreSourcesPropsPath);DotNetBuildOffline=true;AspNetUniverseBuildOffline=true" /> |
50 |
| - |
51 |
| - <!-- Restore the netstandard2.0 project --> |
52 |
| - <MSBuild |
53 |
| - Projects="$(MSBuildThisFileDirectory)tools\templates\Archive\Archive.Library.csproj" |
54 |
| - Targets="Restore" |
55 |
| - Properties="RestorePackagesPath=$(FallbackStagingDir);NETStandardLibraryPackageVersion=$(NETStandardLibrary20PackageVersion);DotNetRestoreSourcePropsPath=$(GeneratedFallbackRestoreSourcesPropsPath);DotNetBuildOffline=true;AspNetUniverseBuildOffline=true" /> |
56 |
| - |
57 |
| - <!-- Create the archive --> |
58 |
| - <RepoTasks.CreateLzma OutputPath="$(FallbackOutputPath)" Sources="$(FallbackStagingDir)" /> |
59 |
| - </Target> |
60 |
| - |
61 |
| - <Target Name="UpdatePreviousArchiveManifest"> |
62 |
| - <Error Text="Please only specify one of PreviousLzmaUrl or PreviousLzmaFile but not both" Condition="'$(PreviousLzmaUrl)' != '' AND '$(PreviousLzmaFile)' != ''" /> |
63 |
| - |
64 | 8 | <PropertyGroup>
|
65 |
| - <PreviousLzmaLayout>$(_WorkRoot)previous\</PreviousLzmaLayout> |
66 |
| - <PreviousLzmaFile Condition="'$(PreviousLzmaFile)' == ''">$(RepositoryRoot).deps\nuGetPackagesArchive.previous.lzma</PreviousLzmaFile> |
| 9 | + <ArchiveBuildProps> |
| 10 | + DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcesPropsPath); |
| 11 | + DotNetPackageVersionPropsPath=$(GeneratedPackageVersionPropsPath); |
| 12 | + OutputPath=$(ArtifactsDir)lzma\; |
| 13 | + _BuildToolsAssembly=$(_BuildToolsAssembly) |
| 14 | + </ArchiveBuildProps> |
67 | 15 | </PropertyGroup>
|
68 | 16 |
|
69 |
| - <!-- Clear the directories --> |
70 |
| - <RemoveDir Directories="$(PreviousLzmaLayout)" /> |
71 |
| - |
72 |
| - <!-- Download and extract the previous LZMA if specified --> |
73 |
| - <KoreBuild.Tasks.DownloadFile |
74 |
| - Uri="$(PreviousLzmaUrl)" |
75 |
| - DestinationPath="$(PreviousLzmaFile)" |
76 |
| - Condition="'$(PreviousLzmaUrl)' != ''" /> |
77 |
| - <RepoTasks.ExtractLzma |
78 |
| - InputArchive="$(PreviousLzmaFile)" |
79 |
| - OutputPath="$(PreviousLzmaLayout)" |
80 |
| - Condition="Exists($(PreviousLzmaFile))" /> |
| 17 | + <Error Text="Could not find any package archive projects to build" |
| 18 | + Condition=" @(ArchiveProjects->Count()) == 0 " /> |
81 | 19 |
|
82 |
| - <ItemGroup> |
83 |
| - <PreviousLzmaContents Remove="@(PreviousLzmaContents)" /> |
84 |
| - <PreviousLzmaContents Include="$(PreviousLzmaLayout)**\*.*" /> |
85 |
| - </ItemGroup> |
86 |
| - |
87 |
| - <!-- Create the archive --> |
88 |
| - <RepoTasks.UpdatePreviousArchiveManifest OutputPath="$(PreviousArchivePropsFile)" Contents="@(PreviousLzmaContents)" /> |
89 |
| - </Target> |
90 |
| - |
91 |
| - <Target Name="BuildAntaresFallbackZip"> |
92 |
| - <Error Text="Please only specify one of InputLzmaUrl or InputLzmaFile but not both" Condition="'$(InputLzmaUrl)' != '' AND '$(InputLzmaFile)' != ''" /> |
93 |
| - |
94 |
| - <PropertyGroup> |
95 |
| - <InputLzmaLayout>$(_WorkRoot)input\</InputLzmaLayout> |
96 |
| - <InputLzmaFile Condition="'$(InputLzmaFile)' == ''">$(RepositoryRoot).deps\nuGetPackagesArchive.input.lzma</InputLzmaFile> |
97 |
| - </PropertyGroup> |
98 |
| - |
99 |
| - <!-- Clear the directories --> |
100 |
| - <RemoveDir Directories="$(InputLzmaLayout)" /> |
101 |
| - |
102 |
| - <!-- Download and extract the input LZMA if specified --> |
103 |
| - <KoreBuild.Tasks.DownloadFile |
104 |
| - Uri="$(InputLzmaUrl)" |
105 |
| - DestinationPath="$(InputLzmaFile)" |
106 |
| - Condition="'$(InputLzmaUrl)' != ''" /> |
107 |
| - <RepoTasks.ExtractLzma |
108 |
| - InputArchive="$(InputLzmaFile)" |
109 |
| - OutputPath="$(InputLzmaLayout)" |
110 |
| - Condition="Exists($(InputLzmaFile))" /> |
111 |
| - |
112 |
| - <ItemGroup> |
113 |
| - <InputLzmaContents Include="$(InputLzmaLayout)**\*.*" Exclude="$(InputLzmaLayout)**\*.nupkg" /> |
114 |
| - </ItemGroup> |
115 |
| - |
116 |
| - <Error Text="No lzma content found. Please specify a lzma via InputLzmaUrl or InputLzmaFile or run the BuildFallbackArchive target." Condition="'@(InputLzmaContents)' == ''" /> |
117 |
| - |
118 |
| - <!-- Filter lzma content to remove existing content and .xml files --> |
119 |
| - <RepoTasks.FilterLzmaContent PreviousLzmaContent="@(PreviousLzmaContents)" InputLzmaContent="@(InputLzmaContents)"> |
120 |
| - <Output TaskParameter="FilteredLzmaContent" ItemName="AntaresLzmaContents" /> |
121 |
| - </RepoTasks.FilterLzmaContent> |
122 |
| - |
123 |
| - <!-- Create antares zip --> |
124 |
| - <ZipArchive |
125 |
| - File="$(FallbackAntaresZipOutputPath)" |
126 |
| - SourceFiles="@(AntaresLzmaContents)" |
127 |
| - WorkingDirectory="$(InputLzmaLayout)" |
128 |
| - Overwrite="true" |
129 |
| - Condition="'@(AntaresLzmaContents)' != ''"/> |
| 20 | + <MSBuild Projects="@(ArchiveProjects)" |
| 21 | + Targets="Restore" |
| 22 | + BuildInParallel="true" |
| 23 | + Properties="$(ArchiveBuildProps);_Dummy=restore" /> |
| 24 | + |
| 25 | + <MSBuild Projects="@(ArchiveProjects)" |
| 26 | + Targets="Build" |
| 27 | + BuildInParallel="false" |
| 28 | + StopOnFirstFailure="true" |
| 29 | + Properties="$(ArchiveBuildProps)" /> |
130 | 30 | </Target>
|
131 | 31 | </Project>
|
0 commit comments