184 lines
9.8 KiB
XML
184 lines
9.8 KiB
XML
<Project>
|
|
<Import Project="common.props" />
|
|
|
|
<PropertyGroup>
|
|
<!-- Project for building the Runtime Store -->
|
|
<MetaPackagePath>$(RepositoryRoot)src\Microsoft.AspNetCore.RuntimeStore\</MetaPackagePath>
|
|
<MetaPackageFile>$(MetaPackagePath)Microsoft.AspNetCore.RuntimeStore.csproj</MetaPackageFile>
|
|
|
|
<!-- Project for building the NuGet Fallback Archive (LZMA for CLI) -->
|
|
<FallbackArchiveDir>$(RepositoryRoot)src\Archive.AspNetCore.All\</FallbackArchiveDir>
|
|
<FallbackArchiveProj>$(FallbackArchiveDir)Archive.AspNetCore.All.csproj</FallbackArchiveProj>
|
|
|
|
<WorkingDirectory>$(MetaPackagePath)bin\work\</WorkingDirectory>
|
|
<PackageCacheOutputPath>$(MetaPackagePath)bin\packageCache\</PackageCacheOutputPath>
|
|
<DepsOutputPath>$(MetaPackagePath)bin\deps\</DepsOutputPath>
|
|
<ArtifactsDir>$(RepositoryRoot)artifacts\</ArtifactsDir>
|
|
<ArtifactsZipDir>$(ArtifactsDir)zip\</ArtifactsZipDir>
|
|
<TempDir>$(ArtifactsDir)temp\</TempDir>
|
|
<ToolsDir>$(RepositoryRoot)tools\</ToolsDir>
|
|
<DependencyBuildDirectory>$(RepositoryRoot).deps\build\</DependencyBuildDirectory>
|
|
<PrepareDependsOn>
|
|
$(PrepareDependsOn);
|
|
UpdateNuGetConfig
|
|
</PrepareDependsOn>
|
|
<CompileDependsOn Condition="'$(BUILD_PACKAGE_CACHE)' == 'true'">
|
|
$(CompileDependsOn);
|
|
BuildPackageCache
|
|
</CompileDependsOn>
|
|
</PropertyGroup>
|
|
|
|
<Target Name="UpdateNuGetConfig">
|
|
<UpdatePackageSource
|
|
NuGetConfigPath="$(RepositoryRoot)NuGet.config"
|
|
SourceName="Dependencies"
|
|
SourceUri="$(DependencyBuildDirectory)"
|
|
Condition="Exists('$(DependencyBuildDirectory)')" />
|
|
</Target>
|
|
|
|
<Target Name="BuildPackageCache">
|
|
<GetOSPlatform>
|
|
<!-- Returns {Linux, macOS, Windows} -->
|
|
<Output TaskParameter="PlatformName" PropertyName="OSPlatform" />
|
|
</GetOSPlatform>
|
|
|
|
<PropertyGroup>
|
|
<OutputZipSufix Condition="'$(OSPlatform)' == 'Windows'">win</OutputZipSufix>
|
|
<OutputZipSufix Condition="'$(OSPlatform)' == 'Linux'">linux</OutputZipSufix>
|
|
<OutputZipSufix Condition="'$(OSPlatform)' == 'macOS'">osx</OutputZipSufix>
|
|
|
|
<OutputZip>$(ArtifactsDir)Build.RS.$(OutputZipSufix).zip</OutputZip>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<RIDs Include="win7-x64" Condition="'$(OSPlatform)'=='Windows'" >
|
|
<PlatformDir>x64</PlatformDir>
|
|
</RIDs>
|
|
<RIDs Include="win7-x86" Condition="'$(OSPlatform)'=='Windows'" >
|
|
<PlatformDir>x86</PlatformDir>
|
|
</RIDs>
|
|
<RIDs Include="linux-x64" Condition="'$(OSPlatform)'=='Linux'" >
|
|
<PlatformDir>x64</PlatformDir>
|
|
</RIDs>
|
|
<RIDs Include="osx.10.12-x64" Condition="'$(OSPlatform)'=='macOS'" >
|
|
<PlatformDir>x64</PlatformDir>
|
|
</RIDs>
|
|
</ItemGroup>
|
|
|
|
<RemoveDir Directories="$(PackageCacheOutputPath)" />
|
|
<RemoveDir Directories="$(WorkingDirectory)%(RIDs.Identity)\" />
|
|
<Exec Command="dotnet store --manifest $(MetaPackageFile) --configuration Release --framework netcoreapp2.0 --runtime %(RIDs.Identity) --output $(PackageCacheOutputPath) --framework-version 2.0.0-* --working-dir $(WorkingDirectory)%(RIDs.Identity)/" />
|
|
<MsBuild Projects="$(MetaPackageFile)" Targets="CollectDeps" Properties="DepsOutputPath=$(DepsOutputPath)"/>
|
|
|
|
<ItemGroup>
|
|
<PackageStoreManifestFiles Include="$(PackageCacheOutputPath)%(RIDs.PlatformDir)\**\artifact.xml">
|
|
<DestinationFile>manifest.%(RIDs.Identity).xml</DestinationFile>
|
|
</PackageStoreManifestFiles>
|
|
<PackageCacheFiles Include="$(PackageCacheOutputPath)**\*" Exclude="$(PackageCacheOutputPath)**\artifact.xml" />
|
|
<DepsFiles Include="$(DepsOutputPath)**\*" />
|
|
</ItemGroup>
|
|
|
|
<Move SourceFiles="%(PackageStoreManifestFiles.FullPath)" DestinationFiles="$(ArtifactsDir)%(PackageStoreManifestFiles.DestinationFile)" />
|
|
|
|
<Copy SourceFiles="@(PackageCacheFiles)" DestinationFolder="$(ArtifactsZipDir)store\%(RecursiveDir)" />
|
|
<Copy SourceFiles="@(DepsFiles)" DestinationFolder="$(ArtifactsZipDir)additionalDeps\%(RecursiveDir)" />
|
|
|
|
<ItemGroup>
|
|
<OutputZipFiles Include="$(ArtifactsZipDir)**\*" />
|
|
</ItemGroup>
|
|
|
|
<ZipArchive File="$(OutputZip)" SourceFiles="@(OutputZipFiles)" WorkingDirectory="$(ArtifactsZipDir)" />
|
|
|
|
<!--Drop a nuspec file in artifacts for packing zip files into a nupkg-->
|
|
<Copy SourceFiles="$(RepositoryRoot)build\Build.RS.nuspec" DestinationFolder="$(ArtifactsDir)" Condition="'$(OSPlatform)'=='Windows'" />
|
|
<WriteLinesToFile File="$(ArtifactsDir)version.txt" Lines="$(VersionPrefix)-$(VersionSuffix)" Overwrite="true" Condition="'$(OSPlatform)'=='Windows'" />
|
|
</Target>
|
|
|
|
<Target Name="_BuildFallbackArchive">
|
|
<Error Text="AspNetPackageVersion must be specified" Condition=" '$(AspNetPackageVersion)' == '' " />
|
|
<Error Text="PackageSource must be specified" Condition=" '$(PackageSource)' == '' " />
|
|
<Error Text="OutputPackageName must be specified" Condition=" '$(OutputPackageName)' == '' " />
|
|
<Error Text="ArchiverPath must be specified" Condition=" '$(ArchiverPath)' == '' " />
|
|
<Error Text="Archiver not found at $(ArchiverPath)" Condition="!Exists('$(ArchiverPath)')" />
|
|
|
|
<!-- Clear the directories -->
|
|
<RemoveDir Directories="$(FallbackArchiveDir)bin" />
|
|
<RemoveDir Directories="$(FallbackArchiveDir)obj" />
|
|
|
|
<PropertyGroup>
|
|
<FallbackStagingDir>$(FallbackArchiveDir)obj/$(OutputPackageName)</FallbackStagingDir>
|
|
<FallbackOutputArchive>$(RepositoryRoot)artifacts\$(OutputPackageName).lzma</FallbackOutputArchive>
|
|
<FallbackRestoreConfigFile>$(FallbackArchiveDir)\obj\$(OutputPackageName).NuGet.config</FallbackRestoreConfigFile>
|
|
</PropertyGroup>
|
|
|
|
<!-- Create the Staging Dir -->
|
|
<MakeDir Directories="$(FallbackStagingDir)" />
|
|
|
|
<!-- Copy the NuGet.config from this repo and update it with the Package Source -->
|
|
<Copy SourceFiles="$(RepositoryRoot)NuGet.config" DestinationFiles="$(FallbackRestoreConfigFile)" />
|
|
<UpdatePackageSource
|
|
NuGetConfigPath="$(FallbackRestoreConfigFile)"
|
|
SourceName="Dependencies"
|
|
SourceUri="$(PackageSource)" />
|
|
|
|
<!-- Restore the target project -->
|
|
<MSBuild Projects="$(FallbackArchiveProj)" Targets="Restore" Properties="RestorePackagesPath=$(FallbackStagingDir);AspNetPackageVersion=$(AspNetPackageVersion);RestoreConfigFile=$(FallbackRestoreConfigFile)" />
|
|
|
|
<!-- Create the archive -->
|
|
<Message Text="Producing LZMA Archive, this may take a while..." Importance="high" />
|
|
<Exec Command="$(ArchiverPath) -a $(FallbackOutputArchive) $(FallbackStagingDir)" />
|
|
</Target>
|
|
|
|
<Target Name="BuildFallbackArchive">
|
|
<!-- Validate Arguments -->
|
|
<Error Text="COHERENCE_SIGNED_DROP_LOCATION is not specified. This requires a path like \\aspnetci\drops\Coherence-Signed\{branch}\{build-number}"
|
|
Condition=" '$(COHERENCE_SIGNED_DROP_LOCATION)' == '' " />
|
|
<Error Text="Required Property 'BuildNumber' not provided" Condition="'$(BuildNumber)' == ''" />
|
|
|
|
<!-- Determine ASP.NET Package Version -->
|
|
<PropertyGroup>
|
|
<NoTimestampSuffix Condition="'$(TIMESTAMP_FREE_VERSION)' != ''">$(TIMESTAMP_FREE_VERSION)</NoTimestampSuffix>
|
|
<NoTimestampSuffix Condition="'$(NoTimestampSuffix)' == ''">final</NoTimestampSuffix>
|
|
|
|
<NoTimestampVersion>$(VersionPrefix)-$(OriginalVersionSuffix)-$(NoTimestampSuffix)</NoTimestampVersion>
|
|
<TimestampVersion>$(VersionPrefix)-$(OriginalVersionSuffix)-$(BuildNumber)</TimestampVersion>
|
|
|
|
<NoTimestampSource>$(COHERENCE_SIGNED_DROP_LOCATION)\Signed\Packages-NoTimeStamp</NoTimestampSource>
|
|
<TimestampSource>$(COHERENCE_SIGNED_DROP_LOCATION)\Signed\Packages</TimestampSource>
|
|
</PropertyGroup>
|
|
|
|
<!-- Run the actual target twice, once for timestamped packages, once for non-timestamped packages -->
|
|
<!-- Here, we're re-invoking KoreBuild, but limiting it to a specific target. -->
|
|
<!-- This won't rerun the whole build, but it ensures that the necessary MSBuild Tasks and Properties are initialized -->
|
|
<MSBuild Projects="$(ProjectPath)" Targets="_BuildFallbackArchive" Properties="AspNetPackageVersion=$(TimestampVersion);PackageSource=$(TimestampSource);OutputPackageName=nuGetPackagesArchive.timestamped;ArchiverPath=$(ArchiverPath)" />
|
|
<MSBuild Projects="$(ProjectPath)" Targets="_BuildFallbackArchive" Properties="AspNetPackageVersion=$(NoTimestampVersion);PackageSource=$(NoTimestampSource);OutputPackageName=nuGetPackagesArchive.notimestamp;ArchiverPath=$(ArchiverPath)" />
|
|
|
|
<!-- Copy LZMA archives to Coherence-Signed drop location -->
|
|
<PropertyGroup>
|
|
<PublishDir Condition="'$(PublishShare)' != ''">$(PublishShare)\fallbackArchives</PublishDir>
|
|
</PropertyGroup>
|
|
<Copy SourceFiles="$(RepositoryRoot)artifacts\nuGetPackagesArchive.timestamped.lzma;$(RepositoryRoot)artifacts\nuGetPackagesArchive.notimestamp.lzma" DestinationFolder="$(PublishDir)" Condition="'$(PublishDir)' != ''" />
|
|
</Target>
|
|
|
|
<Target Name="AddManifestsToNupkg">
|
|
<Error Text="COHERENCE_DROP_LOCATION is not specified. This requires a path like \\aspnetci\drops\Coherence\{branch}\{build-number}"
|
|
Condition=" '$(COHERENCE_DROP_LOCATION)' == '' " />
|
|
|
|
<ItemGroup>
|
|
<MetaPackageNupkg Include="$(COHERENCE_DROP_LOCATION)\ship\Microsoft.AspNetCore.All.*.nupkg" />
|
|
<ManifestFiles Include="$(ArtifactsDir)*.xml"/>
|
|
</ItemGroup>
|
|
|
|
<RemoveDir Directories="@(MetaPackageNupkg->'$(TempDir)%(Filename)')" />
|
|
<Copy SourceFiles="@(MetaPackageNupkg)" DestinationFolder="$(ArtifactsDir)" />
|
|
<UnzipArchive File="$(ArtifactsDir)%(MetaPackageNupkg.FileName)%(MetaPackageNupkg.Extension)" Destination="@(MetaPackageNupkg->'$(TempDir)%(Filename)')" />
|
|
<Copy SourceFiles="@(ManifestFiles)" DestinationFolder="@(MetaPackageNupkg->'$(TempDir)%(Filename)\build\')" />
|
|
|
|
<ItemGroup>
|
|
<ArchiveFiles Include="$(TempDir)%(MetaPackageNupkg.Filename)\**\*" />
|
|
</ItemGroup>
|
|
|
|
<ZipArchive File="%(MetaPackageNupkg.FullPath)" SourceFiles="@(ArchiveFiles)" WorkingDirectory="@(MetaPackageNupkg->'$(TempDir)%(Filename)')" Overwrite="true" />
|
|
</Target>
|
|
</Project>
|