243 lines
12 KiB
XML
243 lines
12 KiB
XML
<Project>
|
|
<Import Project="RepositoryBuild.targets" />
|
|
<Import Project="RuntimeStore.targets" />
|
|
<Import Project="RuntimeStoreInstaller.targets" />
|
|
<Import Project="PackageArchive.targets" />
|
|
<Import Project="Templating.targets" />
|
|
<Import Project="push.targets" />
|
|
|
|
<PropertyGroup>
|
|
<SubmoduleRoot>$(RepositoryRoot)modules\</SubmoduleRoot>
|
|
<_DependencyBuildDirectory>$(RepositoryRoot).deps\build\</_DependencyBuildDirectory>
|
|
<_DependencyPackagesDirectory>$(_DependencyBuildDirectory)</_DependencyPackagesDirectory>
|
|
|
|
<_RepositoryBuildTargets Condition="'$(_RepositoryBuildTargets)'=='' AND '$(CompileOnly)'=='true'">/t:Package /t:VerifyPackages</_RepositoryBuildTargets>
|
|
<_RepositoryBuildTargets Condition="'$(_RepositoryBuildTargets)'==''">/t:Verify</_RepositoryBuildTargets>
|
|
<!-- For external packages that come from feeds will mirrored to aspnetcore feeds. -->
|
|
<IntermediateMirrorPackageDir>$(IntermediateDir)mirror\</IntermediateMirrorPackageDir>
|
|
<!-- For external packages that come from feeds we don't mirror. -->
|
|
<IntermediateExternalPackageDir>$(IntermediateDir)ext\</IntermediateExternalPackageDir>
|
|
<GeneratedPackageVersionPropsPath>$(IntermediateDir)dependencies.g.props</GeneratedPackageVersionPropsPath>
|
|
<GeneratedRestoreSourcePropsPath>$(IntermediateDir)sources.g.props</GeneratedRestoreSourcePropsPath>
|
|
<GeneratedBrandingPropsPath>$(IntermediateDir)branding.g.props</GeneratedBrandingPropsPath>
|
|
|
|
<PrepareDependsOn>$(PrepareDependsOn);VerifyPackageArtifactConfig;PrepareOutputPath</PrepareDependsOn>
|
|
<CleanDependsOn>$(CleanDependsOn);CleanArtifacts;CleanUniverseArtifacts</CleanDependsOn>
|
|
<RestoreDependsOn>$(RestoreDependsOn);InstallDotNet;RestoreExternalDependencies</RestoreDependsOn>
|
|
<CompileDependsOn>$(CompileDependsOn);BuildRepositories</CompileDependsOn>
|
|
<PackageDependsOn>$(PackageDependsOn);BuildTemplates;SplitPackages</PackageDependsOn>
|
|
<VerifyDependsOn>$(VerifyDependsOn);VerifyCoherentVersions</VerifyDependsOn>
|
|
</PropertyGroup>
|
|
|
|
<Target Name="PrepareOutputPath">
|
|
<MakeDir Directories="$(ArtifactsDir);$(BuildDir)" />
|
|
</Target>
|
|
|
|
<Target Name="RestoreExternalDependencies">
|
|
<DownloadNuGetPackages
|
|
Packages="@(ExternalDependency->WithMetadataValue('Mirror', 'false'))"
|
|
DestinationFolder="$(IntermediateExternalPackageDir)" />
|
|
|
|
<DownloadNuGetPackages
|
|
Packages="@(ExternalDependency->WithMetadataValue('Mirror', 'true'))"
|
|
DestinationFolder="$(IntermediateMirrorPackageDir)" />
|
|
</Target>
|
|
|
|
<Target Name="GeneratePropsFiles" DependsOnTargets="ResolveRepoInfo">
|
|
<ItemGroup>
|
|
<_LineupPackages Include="@(ExternalDependency)" />
|
|
<_LineupPackages Include="%(ArtifactInfo.PackageId)" Version="%(ArtifactInfo.Version)" Condition=" '%(ArtifactInfo.ArtifactType)' == 'NuGetPackage' " />
|
|
<_LineupPackages Include="Microsoft.AspNetCore.All" Version="$(PackageVersion)" />
|
|
|
|
<_LineupSources Include="$(_DependencyPackagesDirectory)" Condition="'$(_DependencyPackagesDirectory)' != '' AND Exists('$(_DependencyPackagesDirectory)')" />
|
|
<_LineupSources Include="$(BuildDir)" />
|
|
<_LineupSources Include="$(IntermediateExternalPackageDir)" />
|
|
<_LineupSources Include="$(IntermediateMirrorPackageDir)" />
|
|
</ItemGroup>
|
|
|
|
<RepoTasks.GeneratePackageVersionPropsFile
|
|
Packages="@(_LineupPackages)"
|
|
OutputPath="$(GeneratedPackageVersionPropsPath)" />
|
|
|
|
<RepoTasks.GenerateRestoreSourcesPropsFile
|
|
Sources="@(_LineupSources)"
|
|
OutputPath="$(GeneratedRestoreSourcePropsPath)" />
|
|
|
|
<PropertyGroup>
|
|
<!-- Generate an MSBuild file that can be imported and used by Windows Installer builds to keep our versions consistent. -->
|
|
<BrandingPropsContent>
|
|
<![CDATA[
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
<PropertyGroup>
|
|
<AspNetCoreMajorVersion>$(AspNetCoreMajorVersion)</AspNetCoreMajorVersion>
|
|
<AspNetCoreMinorVersion>$(AspNetCoreMinorVersion)</AspNetCoreMinorVersion>
|
|
<AspNetCorePatchVersion>$(AspNetCorePatchVersion)</AspNetCorePatchVersion>
|
|
<AspNetCorePrereleaseVersionLabel>$(PrereleaseVersionLabel)</AspNetCorePrereleaseVersionLabel>
|
|
<AspNetCoreBuildNumber>$(BuildNumber)</AspNetCoreBuildNumber>
|
|
<AspNetCoreBrandingVersion>$(PackageBrandingVersion)</AspNetCoreBrandingVersion>
|
|
</PropertyGroup>
|
|
</Project>
|
|
]]>
|
|
</BrandingPropsContent>
|
|
</PropertyGroup>
|
|
|
|
<WriteLinesToFile File="$(GeneratedBrandingPropsPath)" Overwrite="true" Lines="$(BrandingPropsContent)"/>
|
|
|
|
<Copy SourceFiles="$(GeneratedPackageVersionPropsPath);$(GeneratedBrandingPropsPath)" DestinationFolder="$(ArtifactsDir)" />
|
|
</Target>
|
|
|
|
<Target Name="CleanUniverseArtifacts">
|
|
<RemoveDir Directories="$(RepositoryRoot)obj" Condition="Exists('$(RepositoryRoot)obj')" />
|
|
</Target>
|
|
|
|
<Target Name="_PrepareRepositories">
|
|
<ItemGroup Condition="'$(KOREBUILD_REPOSITORY_INCLUDE)'!=''">
|
|
<_RepositoriesToInclude Include="$(KOREBUILD_REPOSITORY_INCLUDE)" />
|
|
<Repository
|
|
Remove="@(Repository)"
|
|
Condition="'@(Repository)'!='@(_RepositoriesToInclude)' AND '%(Identity)'!=''" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup Condition="'$(KOREBUILD_REPOSITORY_EXCLUDE)'!=''">
|
|
<RepositoriesToExclude Include="$(KOREBUILD_REPOSITORY_EXCLUDE)" />
|
|
<Repository Remove="@(RepositoriesToExclude)" />
|
|
</ItemGroup>
|
|
|
|
<Error Text="KOREBUILD_REPOSITORY_EXCLUDE AND KOREBUILD_REPOSITORY_INCLUDE are specified."
|
|
Condition="'$(KOREBUILD_REPOSITORY_INCLUDE)' != '' AND '$(KOREBUILD_REPOSITORY_EXCLUDE)' != ''" />
|
|
|
|
<ItemGroup>
|
|
<Repository Update="%(Identity)" RootPath="$(SubmoduleRoot)%(Identity)\" />
|
|
<ShippedRepository Update="%(Identity)" RootPath="$(SubmoduleRoot)%(Identity)\" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<Target Name="BuildRepositories"
|
|
DependsOnTargets="_PrepareRepositories;GeneratePropsFiles;ComputeGraph;_BuildRepositories" />
|
|
|
|
<Target Name="ResolveRepoInfo" DependsOnTargets="_PrepareRepositories">
|
|
|
|
<Error Text="%(Repository.RootPath) does not exist. Did you forget to clone the submodules? Run `git submodule update --init`." Condition="'%(Repository.RootPath)' != '' AND !Exists(%(Repository.RootPath))" />
|
|
<Error Text="%(ShippedRepository.RootPath) does not exist. Did you forget to clone the submodules? Run `git submodule update --init`." Condition="'%(ShippedRepository.RootPath)' != '' AND !Exists(%(ShippedRepository.RootPath))" />
|
|
|
|
<MSBuild Projects="$(MSBuildProjectFullPath)"
|
|
Targets="GetArtifactInfo"
|
|
Properties="RepositoryRoot=%(Repository.RootPath);Configuration=$(Configuration);BuildNumber=$(BuildNumber)"
|
|
ContinueOnError="WarnAndContinue"
|
|
Condition="'%(Repository.Identity)' != ''">
|
|
<Output TaskParameter="TargetOutputs" ItemName="ArtifactInfo" />
|
|
</MSBuild>
|
|
|
|
<MSBuild Projects="$(MSBuildProjectFullPath)"
|
|
Targets="GetArtifactInfo"
|
|
Properties="RepositoryRoot=$(TemplatingProjectRoot);Configuration=$(Configuration);BuildNumber=$(BuildNumber)"
|
|
ContinueOnError="WarnAndContinue">
|
|
<Output TaskParameter="TargetOutputs" ItemName="ArtifactInfo" />
|
|
</MSBuild>
|
|
|
|
<MSBuild Projects="$(MSBuildProjectFullPath)"
|
|
Targets="ResolveSolutions"
|
|
Properties="RepositoryRoot=%(Repository.RootPath);Configuration=$(Configuration);BuildNumber=$(BuildNumber)"
|
|
ContinueOnError="WarnAndContinue"
|
|
Condition="'%(Repository.Identity)' != ''">
|
|
<Output TaskParameter="TargetOutputs" ItemName="Solution" Condition="'%(Repository.Build)' == 'true'" />
|
|
<Output TaskParameter="TargetOutputs" ItemName="_NoBuildSolution" Condition="'%(Repository.Build)' != 'true'" />
|
|
</MSBuild>
|
|
|
|
<!--
|
|
Analyze what was shipped in these repos.
|
|
This is required so we can verify that cascading versions are consistent.
|
|
-->
|
|
<MSBuild Projects="$(MSBuildProjectFullPath)"
|
|
Targets="GetArtifactInfo"
|
|
Properties="RepositoryRoot=%(ShippedRepository.RootPath);Configuration=$(Configuration);BuildNumber=$(BuildNumber);IsFinalBuild=true"
|
|
ContinueOnError="WarnAndContinue"
|
|
Condition="'%(ShippedRepository.Identity)' != ''">
|
|
<Output TaskParameter="TargetOutputs" ItemName="ShippedArtifactInfo" />
|
|
</MSBuild>
|
|
<MSBuild Projects="$(MSBuildProjectFullPath)"
|
|
Targets="ResolveSolutions"
|
|
Properties="RepositoryRoot=%(ShippedRepository.RootPath);Configuration=$(Configuration);BuildNumber=$(BuildNumber)"
|
|
ContinueOnError="WarnAndContinue"
|
|
Condition="'%(ShippedRepository.Identity)' != ''">
|
|
<Output TaskParameter="TargetOutputs" ItemName="_ShippedSolution" />
|
|
</MSBuild>
|
|
|
|
<ItemGroup>
|
|
<Solution Update="@(Solution)" Build="true" />
|
|
<_ShippedSolution Update="@(_ShippedSolution)" Build="false" Shipped="true" />
|
|
<_NoBuildSolution Update="@(_NoBuildSolution)" Build="false" />
|
|
<Solution Include="@(_NoBuildSolution);@(_ShippedSolution)" />
|
|
</ItemGroup>
|
|
|
|
<Error Text="No solutions were found in '$(SubmoduleRoot)'" Condition="@(Solution->Count()) == 0" />
|
|
</Target>
|
|
|
|
<Target Name="ComputeGraph" DependsOnTargets="ResolveRepoInfo;GeneratePropsFiles">
|
|
|
|
<ItemGroup>
|
|
<_UndeclaredPackageArtifact Include="%(ArtifactInfo.PackageId)" Condition="'%(ArtifactInfo.ArtifactType)' == 'NuGetPackage'" />
|
|
<_UndeclaredPackageArtifact Remove="@(PackageArtifact)" />
|
|
</ItemGroup>
|
|
|
|
<Error Text="Undeclared package artifacts. Add these to artifacts.props:%0A - @(_UndeclaredPackageArtifact, '%0A - ')"
|
|
Condition=" @(_UndeclaredPackageArtifact->Count()) != 0 " />
|
|
|
|
<RepoTasks.CheckRepoGraph
|
|
Solutions="@(Solution)"
|
|
Artifacts="@(ArtifactInfo);@(ShippedArtifactInfo)"
|
|
Repositories="@(Repository);@(ShippedRepository)"
|
|
Properties="Configuration=$(Configuration);BuildNumber=$(BuildNumber);DotNetPackageVersionPropsPath=$(GeneratedPackageVersionPropsPath);DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcePropsPath)" />
|
|
|
|
<RepoTasks.AnalyzeBuildGraph
|
|
Solutions="@(Solution)"
|
|
Artifacts="@(ArtifactInfo)"
|
|
Dependencies="@(ExternalDependency)"
|
|
StartGraphAt="$(BuildGraphOf)"
|
|
Properties="Configuration=$(Configuration);BuildNumber=$(BuildNumber);DotNetPackageVersionPropsPath=$(GeneratedPackageVersionPropsPath);DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcePropsPath)">
|
|
<Output TaskParameter="RepositoryBuildOrder" ItemName="RepositoryBuildOrder" />
|
|
</RepoTasks.AnalyzeBuildGraph>
|
|
</Target>
|
|
|
|
<Target Name="SplitPackages">
|
|
<ItemGroup>
|
|
<PackageArtifactFile Include="$(BuildDir)*.nupkg" />
|
|
<ExternalDependencyPackage Include="@(ExternalDependency->WithMetadataValue('Mirror', 'true'))" Category="mirror" />
|
|
<_MirroredPackageFiles Include="$(IntermediateMirrorPackageDir)*.nupkg" />
|
|
</ItemGroup>
|
|
|
|
<RepoTasks.CopyPackagesToSplitFolders
|
|
Packages="@(PackageArtifact);@(ExternalDependencyPackage)"
|
|
Files="@(PackageArtifactFile);@(_MirroredPackageFiles)"
|
|
DestinationFolder="$(ArtifactsDir)"
|
|
Overwrite="true" />
|
|
</Target>
|
|
|
|
<Target Name="VerifyPackageArtifactConfig">
|
|
<Error Text="Invalid configuration of %(PackageArtifact.Identity). PackageArtifact must have the 'Category' metadata."
|
|
Condition="'%(PackageArtifact.Category)' == '' " />
|
|
|
|
<Error Text="Invalid configuration of %(PackageArtifact.Identity). Packages marked as Metapackage='true' must be Category='ship'."
|
|
Condition="'%(PackageArtifact.Category)' != 'ship' AND '%(PackageArtifact.Metapackage)' == 'true' " />
|
|
|
|
<Error Text="Invalid configuration of %(PackageArtifact.Identity). Packages marked as LZMA='true' must be Category='ship'."
|
|
Condition="'%(PackageArtifact.Category)' != 'ship' AND '%(PackageArtifact.LZMA)' == 'true' " />
|
|
|
|
<Error Text="Invalid configuration of %(PackageArtifact.Identity). Packages marked as LZMATools='true' must be Category='ship'."
|
|
Condition="'%(PackageArtifact.Category)' != 'ship' AND '%(PackageArtifact.LZMATools)' == 'true' " />
|
|
</Target>
|
|
|
|
<Target Name="VerifyCoherentVersions" DependsOnTargets="ResolveRepoInfo">
|
|
<ItemGroup>
|
|
<ShippingPackageFiles Include="$(ArtifactsDir)ship\*.nupkg" />
|
|
<ShippedExternalDependency Include="%(ShippedArtifactInfo.PackageId)" Version="%(Version)" />
|
|
</ItemGroup>
|
|
|
|
<RepoTasks.VerifyCoherentVersions
|
|
PackageFiles="@(ShippingPackageFiles)"
|
|
ExternalDependencies="@(ExternalDependency);@(ShippedExternalDependency)" />
|
|
</Target>
|
|
|
|
</Project>
|