661 lines
38 KiB
XML
661 lines
38 KiB
XML
<Project>
|
|
<Import Project="common.props" />
|
|
|
|
<ItemGroup>
|
|
<!-- remove package references that don't belong in KoreBuild -->
|
|
<PackageReference Remove="Internal.AspNetCore.Sdk" />
|
|
</ItemGroup>
|
|
|
|
<PropertyGroup>
|
|
<!-- Project for building the Runtime Store -->
|
|
<MetaPackagePath>$(RepositoryRoot)src\Microsoft.AspNetCore.RuntimeStore\</MetaPackagePath>
|
|
<MetaPackageFile>$(MetaPackagePath)Microsoft.AspNetCore.RuntimeStore.csproj</MetaPackageFile>
|
|
|
|
<HostingStartupTemplatePath>$(RepositoryRoot)tools\Microsoft.AspNetCore.HostingStartup.Template\</HostingStartupTemplatePath>
|
|
<HostingStartupTemplateFile>$(HostingStartupTemplatePath)Microsoft.AspNetCore.HostingStartup.Template.csproj</HostingStartupTemplateFile>
|
|
|
|
<!-- Project for building the NuGet Fallback Archive (LZMA for CLI) -->
|
|
<FallbackArchiveDir>$(RepositoryRoot)src\Archive.AspNetCore.All\</FallbackArchiveDir>
|
|
<FallbackArchiveProj>$(FallbackArchiveDir)Archive.AspNetCore.All.csproj</FallbackArchiveProj>
|
|
|
|
<!-- Determine ASP.NET Package Version -->
|
|
<NoTimestampSuffix Condition="'$(TIMESTAMP_FREE_VERSION)' != ''">$(TIMESTAMP_FREE_VERSION)</NoTimestampSuffix>
|
|
<NoTimestampSuffix Condition="'$(NoTimestampSuffix)' == ''">final</NoTimestampSuffix>
|
|
|
|
<NoTimestampVersion>$(VersionPrefix)-$(OriginalVersionSuffix)-$(NoTimestampSuffix)</NoTimestampVersion>
|
|
<NoTimestampVersion Condition="'$(OriginalVersionSuffix)' == 'rtm'">$(VersionPrefix)</NoTimestampVersion>
|
|
<TimestampVersion>$(VersionPrefix)-$(OriginalVersionSuffix)-$(BuildNumber)</TimestampVersion>
|
|
|
|
<RuntimeStoreTimestampInstallerPackageName>aspnetcore-store-$(TimestampVersion)</RuntimeStoreTimestampInstallerPackageName>
|
|
<RuntimeStoreNoTimestampInstallerPackageName>aspnetcore-store-$(NoTimestampVersion)</RuntimeStoreNoTimestampInstallerPackageName>
|
|
|
|
<RuntimeStoreWorkingDirectory>$(RepositoryRoot).rw\</RuntimeStoreWorkingDirectory>
|
|
<RuntimeStoreOutputPath>$(RepositoryRoot).ro\</RuntimeStoreOutputPath>
|
|
<ArtifactsDir>$(RepositoryRoot)artifacts\</ArtifactsDir>
|
|
<ArtifactsZipDir>$(ArtifactsDir)zip\</ArtifactsZipDir>
|
|
<DepsOutputPath>$(ArtifactsDir)deps\</DepsOutputPath>
|
|
<RuntimeStoreZipTimestampDir>$(ArtifactsZipDir)t\</RuntimeStoreZipTimestampDir>
|
|
<RuntimeStoreZipNoTimestampDir>$(ArtifactsZipDir)n\</RuntimeStoreZipNoTimestampDir>
|
|
<RuntimeStoreSymbolsZipTimestampDir>$(ArtifactsZipDir)st\</RuntimeStoreSymbolsZipTimestampDir>
|
|
<RuntimeStoreSymbolsZipNoTimestampDir>$(ArtifactsZipDir)sn\</RuntimeStoreSymbolsZipNoTimestampDir>
|
|
<RuntimeStoreInstallerDirectory>$(ArtifactsDir)installers\</RuntimeStoreInstallerDirectory>
|
|
<RuntimeStoreArchiveDirectory>$(ArtifactsDir)rsArchive\</RuntimeStoreArchiveDirectory>
|
|
<RuntimeStoreInstallerLayoutTimestampDirectory>$(ArtifactsDir)itLayout\</RuntimeStoreInstallerLayoutTimestampDirectory>
|
|
<RuntimeStoreInstallerLayoutPackageRootTimestampDirectory>$(RuntimeStoreInstallerLayoutTimestampDirectory)package_root\</RuntimeStoreInstallerLayoutPackageRootTimestampDirectory>
|
|
<RuntimeStoreInstallerLayoutNoTimestampDirectory>$(ArtifactsDir)inLayout\</RuntimeStoreInstallerLayoutNoTimestampDirectory>
|
|
<RuntimeStoreInstallerLayoutPackageRootNoTimestampDirectory>$(RuntimeStoreInstallerLayoutNoTimestampDirectory)package_root\</RuntimeStoreInstallerLayoutPackageRootNoTimestampDirectory>
|
|
<RuntimeStoreInstallerOutputTimeStampDirectory>$(ArtifactsDir)itOutput\</RuntimeStoreInstallerOutputTimeStampDirectory>
|
|
<RuntimeStoreInstallerOutputNoTimeStampDirectory>$(ArtifactsDir)inOutput\</RuntimeStoreInstallerOutputNoTimeStampDirectory>
|
|
<TempDir>$(ArtifactsDir)temp\</TempDir>
|
|
<ToolsDir>$(RepositoryRoot)tools\</ToolsDir>
|
|
<DockerDir>$(ToolsDir)docker\</DockerDir>
|
|
<DependencyBuildDirectory>$(RepositoryRoot).deps\build\</DependencyBuildDirectory>
|
|
<RuntimeStoreReferenceDirectory>$(ToolsDir)Build.RuntimeStore.References\</RuntimeStoreReferenceDirectory>
|
|
<RuntimeStoreReferencePackageDirectory>$(RuntimeStoreReferenceDirectory)bin\Release\</RuntimeStoreReferencePackageDirectory>
|
|
<DebianConfigTemplateFile>$(ToolsDir)debian_config.json</DebianConfigTemplateFile>
|
|
<RPMChangelogTemplateFile>$(ToolsDir)changelog</RPMChangelogTemplateFile>
|
|
<DotnetDebToolDirectory>$(ToolsDir)dotnet-deb-tool-consumer\</DotnetDebToolDirectory>
|
|
<RestoreRuntimeStoreDirectory>$(ToolsDir)RestoreRuntimeStore\</RestoreRuntimeStoreDirectory>
|
|
<BuildDirectory>$(RepositoryRoot).build\</BuildDirectory>
|
|
<BuildTempDirectory>$(BuildDirectory)temp\</BuildTempDirectory>
|
|
<BuildDotnetDirectory>$(BuildDirectory)dotnet\</BuildDotnetDirectory>
|
|
<DockerRootDirectory>/opt/code/</DockerRootDirectory>
|
|
|
|
<PrepareDependsOn>
|
|
$(PrepareDependsOn);
|
|
UpdateNuGetConfig
|
|
</PrepareDependsOn>
|
|
</PropertyGroup>
|
|
|
|
<Target Name="UpdateNuGetConfig">
|
|
<UpdatePackageSource
|
|
NuGetConfigPath="$(RepositoryRoot)NuGet.config"
|
|
SourceName="Dependencies"
|
|
SourceUri="$(DependencyBuildDirectory)"
|
|
Condition="Exists('$(DependencyBuildDirectory)')" />
|
|
</Target>
|
|
|
|
<Target Name="BuildPackageCache" DependsOnTargets="UpdateNuGetConfig;AddDiaSymReaderToPath;_ResolveCurrentSharedFrameworkVersion">
|
|
<GetOSPlatform>
|
|
<!-- Returns {Linux, macOS, Windows} -->
|
|
<Output TaskParameter="PlatformName" PropertyName="OSPlatform" />
|
|
</GetOSPlatform>
|
|
|
|
<Error Text="Please specify the platform for the runtime package store via PACKAGE_CACHE_PLATFORM: {x64|x86}." Condition="'$(PACKAGE_CACHE_PLATFORM)' == ''"/>
|
|
|
|
<!-- Display dotnet info -->
|
|
<Exec Command="dotnet --info" />
|
|
|
|
<PropertyGroup>
|
|
<OutputZipSufix Condition="'$(OSPlatform)' == 'Windows'">win$(PACKAGE_CACHE_PLATFORM)</OutputZipSufix>
|
|
<OutputZipSufix Condition="'$(OSPlatform)' == 'Linux'">linux</OutputZipSufix>
|
|
<OutputZipSufix Condition="'$(OSPlatform)' == 'macOS'">osx</OutputZipSufix>
|
|
<RID Condition="'$(OSPlatform)' == 'Windows'">win7-$(PACKAGE_CACHE_PLATFORM)</RID>
|
|
<RID Condition="'$(OSPlatform)' == 'Linux'">linux-$(PACKAGE_CACHE_PLATFORM)</RID>
|
|
<RID Condition="'$(OSPlatform)' == 'macOS'">osx-$(PACKAGE_CACHE_PLATFORM)</RID>
|
|
|
|
<OutputZip>$(ArtifactsDir)Build.RS.$(OutputZipSufix)-$(VersionSuffix).zip</OutputZip>
|
|
<OutputZipNoTimestamp>$(ArtifactsDir)Build.RS.$(OutputZipSufix).zip</OutputZipNoTimestamp>
|
|
<OutputSymbolZip>$(ArtifactsDir)Build.Symbols.RS.$(OutputZipSufix)-$(VersionSuffix).zip</OutputSymbolZip>
|
|
<OutputSymbolZipNoTimestamp>$(ArtifactsDir)Build.Symbols.RS.$(OutputZipSufix).zip</OutputSymbolZipNoTimestamp>
|
|
<OutputSymbolTGZ>$(ArtifactsDir)Build.Symbols.RS.$(OutputZipSufix)-$(VersionSuffix).tar.gz</OutputSymbolTGZ>
|
|
<OutputSymbolTGZNoTimeStamp>$(ArtifactsDir)Build.Symbols.RS.$(OutputZipSufix).tar.gz</OutputSymbolTGZNoTimeStamp>
|
|
</PropertyGroup>
|
|
|
|
<!-- Build reference package -->
|
|
<Exec Command="dotnet restore" WorkingDirectory="$(RuntimeStoreReferenceDirectory)" />
|
|
<MSBuild Projects="$(RuntimeStoreReferenceDirectory)\Build.RuntimeStore.References.csproj"
|
|
Targets="Pack"
|
|
Properties="Configuration=Release" />
|
|
|
|
<UpdatePackageSource
|
|
NuGetConfigPath="$(RepositoryRoot)NuGet.config"
|
|
SourceName="RuntimeStoreReference"
|
|
SourceUri="$(RuntimeStoreReferencePackageDirectory)"
|
|
Condition="Exists('$(RuntimeStoreReferencePackageDirectory)')" />
|
|
|
|
<!-- Build runtime store -->
|
|
<RemoveDir Directories="$(RuntimeStoreOutputPath)" />
|
|
<RemoveDir Directories="$(RuntimeStoreWorkingDirectory)" />
|
|
|
|
<Exec Command="dotnet store -m $(MetaPackageFile) -f netcoreapp2.0 -r $(RID) -o $(RuntimeStoreOutputPath) --framework-version 2.0.0-* -w $(RuntimeStoreWorkingDirectory) $(RUNTIME_STORE_ADDITIONAL_ARGUMENTS)" />
|
|
|
|
<!-- Create deps files for hosting startup -->
|
|
<Exec Command="dotnet restore" WorkingDirectory="$(RepositoryRoot)tools\TrimDeps" />
|
|
<Exec Command="dotnet restore" WorkingDirectory="$(HostingStartupTemplatePath)" />
|
|
|
|
<!--- MSBuild caches things if you run inproc so have to use Exec -->
|
|
<Exec Command="dotnet msbuild /t:"Restore;Rebuild;CollectDeps" $(HostingStartupTemplateFile) /p:"DepsOutputPath=$(DepsOutputPath);HostingStartupPackageName=%(HostingStartupPackageReference.Identity);HostingStartupPackageVersion=%(Version);RuntimeFrameworkVersion=$(SharedFrameworkVersion)""/>
|
|
|
|
<ItemGroup>
|
|
<PackageStoreManifestFiles Include="$(RuntimeStoreOutputPath)**\artifact.xml">
|
|
<TimestampDestinationFile>aspnetcore-store-$(TimestampVersion)-$(RID).xml</TimestampDestinationFile>
|
|
</PackageStoreManifestFiles>
|
|
<_RuntimeStoreFiles Include="$(RuntimeStoreOutputPath)**\*" Exclude="$(RuntimeStoreOutputPath)**\artifact.xml;$(RuntimeStoreOutputPath)symbols\**\*" />
|
|
<RuntimeStoreFiles Include="@(_RuntimeStoreFiles)" >
|
|
<NoTimestampRecursiveDir>$([System.String]::new('%(RecursiveDir)').Replace('$(TimestampVersion)', '$(NoTimestampVersion)'))</NoTimestampRecursiveDir>
|
|
</RuntimeStoreFiles>
|
|
<_RuntimeStoreSymbolFiles Include="$(RuntimeStoreOutputPath)symbols\**\*" />
|
|
<RuntimeStoreSymbolFiles Include="@(_RuntimeStoreSymbolFiles )" >
|
|
<NoTimestampRecursiveDir>$([System.String]::new('%(RecursiveDir)').Replace('$(TimestampVersion)', '$(NoTimestampVersion)'))</NoTimestampRecursiveDir>
|
|
</RuntimeStoreSymbolFiles>
|
|
<DepsFiles Include="$(DepsOutputPath)**\*" />
|
|
</ItemGroup>
|
|
|
|
<Move SourceFiles="%(PackageStoreManifestFiles.FullPath)" DestinationFiles="$(ArtifactsDir)%(PackageStoreManifestFiles.TimestampDestinationFile)" />
|
|
|
|
<Copy SourceFiles="@(DepsFiles)" DestinationFolder="$(RuntimeStoreZipTimestampDir)additionalDeps\%(RecursiveDir)" />
|
|
<Copy SourceFiles="@(DepsFiles)" DestinationFolder="$(RuntimeStoreZipNoTimestampDir)additionalDeps\%(RecursiveDir)" />
|
|
<Copy SourceFiles="@(RuntimeStoreFiles)" DestinationFolder="$(RuntimeStoreZipTimestampDir)store\%(RecursiveDir)" />
|
|
<Copy SourceFiles="@(RuntimeStoreFiles)" DestinationFiles="$(RuntimeStoreZipNoTimestampDir)store\%(RuntimeStoreFiles.NoTimestampRecursiveDir)%(RuntimeStoreFiles.FileName)%(RuntimeStoreFiles.Extension)" />
|
|
<Copy SourceFiles="@(RuntimeStoreSymbolFiles)" DestinationFolder="$(RuntimeStoreSymbolsZipTimestampDir)%(RecursiveDir)" />
|
|
<Copy SourceFiles="@(RuntimeStoreSymbolFiles)" DestinationFiles="$(RuntimeStoreSymbolsZipNoTimestampDir)%(RuntimeStoreSymbolFiles.NoTimestampRecursiveDir)%(RuntimeStoreSymbolFiles.FileName)%(RuntimeStoreSymbolFiles.Extension)" />
|
|
|
|
<ItemGroup>
|
|
<NoTimestampDepsFiles Include="$(RuntimeStoreZipNoTimestampDir)additionalDeps\**\*"/>
|
|
</ItemGroup>
|
|
|
|
<MSBuild Projects="$(ProjectPath)" Targets="_RemoveTimestampFromDepsFile" Properties="DepsFile=%(NoTimestampDepsFiles.FullPath)" />
|
|
|
|
<ItemGroup>
|
|
<OutputZipFiles Include="$(RuntimeStoreZipTimestampDir)**\*" />
|
|
<OutputZipFilesNoTimestamp Include="$(RuntimeStoreZipNoTimestampDir)**\*" />
|
|
<OutputSymbolZipFiles Include="$(RuntimeStoreSymbolsZipTimestampDir)**\*" />
|
|
<OutputSymbolZipFilesNoTimestamp Include="$(RuntimeStoreSymbolsZipNoTimestampDir)**\*" />
|
|
</ItemGroup>
|
|
|
|
<ZipArchive File="$(OutputZip)" SourceFiles="@(OutputZipFiles)" WorkingDirectory="$(RuntimeStoreZipTimestampDir)" Overwrite="true"/>
|
|
<ZipArchive File="$(OutputZipNoTimeStamp)" SourceFiles="@(OutputZipFilesNoTimestamp)" WorkingDirectory="$(RuntimeStoreZipNoTimestampDir)" Overwrite="true"/>
|
|
<ZipArchive File="$(OutputSymbolZip)" SourceFiles="@(OutputSymbolZipFiles)" WorkingDirectory="$(RuntimeStoreSymbolsZipTimestampDir)" Overwrite="true" Condition="'@(OutputSymbolZipFiles)' != ''"/>
|
|
<ZipArchive File="$(OutputSymbolZipNoTimeStamp)" SourceFiles="@(OutputSymbolZipFilesNoTimestamp)" WorkingDirectory="$(RuntimeStoreSymbolsZipNoTimestampDir)" Overwrite="true" Condition="'@(OutputSymbolZipFilesNoTimestamp)' != ''"/>
|
|
|
|
<MSBuild Projects="$(ProjectPath)" Targets="ConvertZipToTGZ" Properties="ZipFileName=$(OutputSymbolZip);TGZFileName=$(OutputSymbolTGZ)" Condition="'$(OSPlatform)' == 'Linux'"/>
|
|
<MSBuild Projects="$(ProjectPath)" Targets="ConvertZipToTGZ" Properties="ZipFileName=$(OutputSymbolZipNoTimeStamp);TGZFileName=$(OutputSymbolTGZNoTimeStamp)" Condition="'$(OSPlatform)' == 'Linux'"/>
|
|
|
|
<!--Drop a nuspec file in artifacts for packing zip files into a nupkg-->
|
|
<Copy SourceFiles="$(RepositoryRoot)build\Build.RS.nuspec" DestinationFolder="$(ArtifactsDir)" Condition="'$(OSPlatform)'=='Linux'" />
|
|
<WriteLinesToFile File="$(ArtifactsDir)version.txt" Lines="$(VersionPrefix)-$(VersionSuffix)" Overwrite="true" Condition="'$(OSPlatform)'=='Linux'" />
|
|
|
|
<!-- Add a common manifest for package trimming -->
|
|
<MSBuild Projects="$(ProjectPath)" Targets="CreateCommonManifest" Condition="'$(OSPlatform)' == 'Windows' AND '$(PACKAGE_CACHE_PLATFORM)' == 'x64'"/>
|
|
</Target>
|
|
|
|
<Target Name="CreateCommonManifest">
|
|
<PropertyGroup>
|
|
<CommonManifestFileName>aspnetcore-store-$(TimestampVersion)-common.xml</CommonManifestFileName>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<PackageToTrim Include="runtime.win-arm64.runtime.native.system.data.sqlclient.sni" />
|
|
</ItemGroup>
|
|
|
|
<MSBuild Projects="$(RuntimeStoreReferenceDirectory)\Build.RuntimeStore.References.csproj" Targets="GetPackageDefinitions" >
|
|
<Output TaskParameter="TargetOutputs" ItemName="_PackageDefinitions" />
|
|
</MSBuild>
|
|
|
|
<RepoTasks.CreateCommonManifest DestinationFilePath="$(ArtifactsDir)$(CommonManifestFileName)" PackageDefinitions="@(_PackageDefinitions)" Packages="@(PackageToTrim)"/>
|
|
</Target>
|
|
|
|
<Target Name="ConvertZipToTGZ">
|
|
<Exec Command=""$(ToolsDir)zip2tgz.sh" "$(ZipFileName)" "$(TGZFileName)"" />
|
|
<Delete Files="$(ZipFileName)" />
|
|
</Target>
|
|
|
|
<Target Name="AddDiaSymReaderToPath" Condition="'$(OS)' == 'Windows_NT'" DependsOnTargets="_AddDiaSymReaderFromCurrentSharedFramework;_AddDiaSymReaderFromDownloadedSharedFramework" />
|
|
|
|
<Target Name="_ResolveCurrentSharedFrameworkVersion">
|
|
<!-- Parse framework version -->
|
|
<Exec Command="powershell.exe $(ToolsDir)GetSharedFrameworkVersion.ps1" ConsoleToMSBuild="true" Condition="'$(OS)' == 'Windows_NT'">
|
|
<Output TaskParameter="ConsoleOutput" PropertyName="SharedFrameworkVersion" />
|
|
</Exec>
|
|
<Exec Command="bash $(ToolsDir)GetSharedFrameworkVersion.sh" ConsoleToMSBuild="true" Condition="'$(OS)' != 'Windows_NT'">
|
|
<Output TaskParameter="ConsoleOutput" PropertyName="SharedFrameworkVersion" />
|
|
</Exec>
|
|
</Target>
|
|
|
|
<Target Name="_AddDiaSymReaderFromCurrentSharedFramework" DependsOnTargets="_ResolveCurrentSharedFrameworkVersion" Condition="'$(PACKAGE_CACHE_PLATFORM)' == 'x64'">
|
|
<GetDotNetHost>
|
|
<Output TaskParameter="DotNetDirectory" PropertyName="DotnetHomeDirectory" />
|
|
</GetDotNetHost>
|
|
|
|
<PropertyGroup>
|
|
<DiaSymReaderDirectory>$(DotnetHomeDirectory)shared\Microsoft.NETCore.App\$(SharedFrameworkVersion)</DiaSymReaderDirectory>
|
|
</PropertyGroup>
|
|
|
|
<Message Text="Adding DiaSymReader to PATH by appending: $(DiaSymReaderDirectory)" Importance="high" />
|
|
|
|
<SetEnvironmentVariable Variable="PATH" Value="$(PATH);$(DiaSymReaderDirectory)" />
|
|
</Target>
|
|
|
|
<Target Name="_AddDiaSymReaderFromDownloadedSharedFramework" DependsOnTargets="_ResolveCurrentSharedFrameworkVersion" Condition="'$(PACKAGE_CACHE_PLATFORM)' == 'x86'">
|
|
<Exec Command="powershell.exe $(ToolsDir)InstallSharedFrameworkx86.ps1 $(SharedFrameworkVersion) $(BuildTempDirectory)"/>
|
|
|
|
<PropertyGroup>
|
|
<DiaSymReaderDirectory>$(BuildTempDirectory)shared\Microsoft.NETCore.App\$(SharedFrameworkVersion)</DiaSymReaderDirectory>
|
|
</PropertyGroup>
|
|
|
|
<Message Text="Adding DiaSymReader to PATH by appending: $(DiaSymReaderDirectory)" Importance="high" />
|
|
|
|
<SetEnvironmentVariable Variable="PATH" Value="$(PATH);$(DiaSymReaderDirectory)" />
|
|
</Target>
|
|
|
|
<Target Name="_RemoveTimestampFromDepsFile">
|
|
<GetOSPlatform>
|
|
<!-- Returns {Linux, macOS, Windows} -->
|
|
<Output TaskParameter="PlatformName" PropertyName="OSPlatform" />
|
|
</GetOSPlatform>
|
|
|
|
<Exec Command="powershell.exe -command "(Get-Content $(DepsFile)).replace('$(TimestampVersion)', '$(NoTimestampVersion)') | Set-Content $(DepsFile)"" Condition="'$(OSPlatform)'=='Windows'"/>
|
|
<Exec Command="sed -i -e "s/$(TimestampVersion)/$(NoTimestampVersion)/g" $(DepsFile)" Condition="'$(OSPlatform)'=='macOS'"/>
|
|
<Exec Command="sed -i -e "s/$(TimestampVersion)/$(NoTimestampVersion)/g" $(DepsFile)" Condition="'$(OSPlatform)'=='Linux'"/>
|
|
</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>
|
|
<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>
|
|
|
|
<Target Name="BuildInstallers" DependsOnTargets="GenerateDebs;GenerateRpms" />
|
|
|
|
<Target Name="EnsureInstallerPrerequisites">
|
|
<!-- Check Docker server OS -->
|
|
<Exec Command="docker version -f "{{.Server.Os}}"" ConsoleToMSBuild="true">
|
|
<Output TaskParameter="ConsoleOutput" PropertyName="DockerHostOS" />
|
|
</Exec>
|
|
|
|
<Error Text="Docker host must be using Linux containers." Condition="'$(DockerHostOS)' != 'linux'"/>
|
|
|
|
<!-- Download runtime store archives -->
|
|
<Message Text="Local runtime store signed artifacts not specified via RUNTIMESTORE_SIGNED_ARTIFACTS_PATH, falling back to artifacts availabe on myget." Importance="high" Condition="'$(RUNTIMESTORE_SIGNED_ARTIFACTS_PATH)' == ''"/>
|
|
<MSBuild Projects="$(RestoreRuntimeStoreDirectory)\RestoreRuntimeStore.csproj" Targets="Restore" Properties="RestorePackagesPath=$(RuntimeStoreArchiveDirectory)" Condition="'$(RUNTIMESTORE_SIGNED_ARTIFACTS_PATH)' == ''"/>
|
|
|
|
<PropertyGroup>
|
|
<RuntimeStoreSignedArchivesPath>$(RUNTIMESTORE_SIGNED_ARTIFACTS_PATH)</RuntimeStoreSignedArchivesPath>
|
|
<RuntimeStoreSignedArchivesPath Condition="'$(RuntimeStoreSignedArchivesPath)' == ''">$(RuntimeStoreArchiveDirectory)</RuntimeStoreSignedArchivesPath>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<RuntimeStoreTimestampArchive Include="$(RuntimeStoreSignedArchivesPath)**\Build.RS.linux-*.tar.gz"/>
|
|
<RuntimeStoreNoTimestampArchive Include="$(RuntimeStoreSignedArchivesPath)**\Build.RS.linux.tar.gz"/>
|
|
</ItemGroup>
|
|
|
|
<Error Text="@(RuntimeStoreTimestampArchive->Count()) timestamp linux archives found at $(RuntimeStoreSignedArchivesPath)." Condition="'@(RuntimeStoreTimestampArchive->Count())' != 1" />
|
|
<Error Text="@(RuntimeStoreNoTimestampArchive->Count()) no timestamp linux archives found at $(RuntimeStoreSignedArchivesPath)." Condition="'@(RuntimeStoreNoTimestampArchive->Count())' != 1" />
|
|
</Target>
|
|
|
|
<Target Name="GenerateRpms" DependsOnTargets="EnsureInstallerPrerequisites">
|
|
<!-- Create layout: Aspnet runtime store -->
|
|
<RemoveDir Directories="$(RuntimeStoreInstallerLayoutTimestampDirectory)" />
|
|
<MakeDir Directories="$(RuntimeStoreInstallerLayoutPackageRootTimestampDirectory)" />
|
|
<Exec Command="tar -xzf @(RuntimeStoreTimestampArchive) -C $(RuntimeStoreInstallerLayoutPackageRootTimestampDirectory)" />
|
|
<RemoveDir Directories="$(RuntimeStoreInstallerLayoutNoTimestampDirectory)" />
|
|
<MakeDir Directories="$(RuntimeStoreInstallerLayoutPackageRootNoTimestampDirectory)" />
|
|
<Exec Command="tar -xzf @(RuntimeStoreNoTimestampArchive) -C $(RuntimeStoreInstallerLayoutPackageRootNoTimestampDirectory)" />
|
|
|
|
<!-- Create layout: Place changelog -->
|
|
<Copy
|
|
SourceFiles="$(RPMChangelogTemplateFile)"
|
|
DestinationFiles="$(RuntimeStoreInstallerLayoutTimestampDirectory)templates/changelog"
|
|
OverwriteReadOnlyFiles="True"
|
|
SkipUnchangedFiles="False"
|
|
UseHardlinksIfPossible="False" />
|
|
<Copy
|
|
SourceFiles="$(RPMChangelogTemplateFile)"
|
|
DestinationFiles="$(RuntimeStoreInstallerLayoutNoTimestampDirectory)templates/changelog"
|
|
OverwriteReadOnlyFiles="True"
|
|
SkipUnchangedFiles="False"
|
|
UseHardlinksIfPossible="False" />
|
|
|
|
<!-- Common installer parameters -->
|
|
<JsonPeek Query="$.short_description" JsonInputPath="$(DebianConfigTemplateFile)">
|
|
<Output TaskParameter="Result" ItemName="_InstallerSummary" />
|
|
</JsonPeek>
|
|
<JsonPeek Query="$.long_description" JsonInputPath="$(DebianConfigTemplateFile)">
|
|
<Output TaskParameter="Result" ItemName="_InstallerDescription" />
|
|
</JsonPeek>
|
|
<JsonPeek Query="$.license.type" JsonInputPath="$(DebianConfigTemplateFile)">
|
|
<Output TaskParameter="Result" ItemName="_InstallerLicense" />
|
|
</JsonPeek>
|
|
<JsonPeek Query="$.release.package_revision" JsonInputPath="$(DebianConfigTemplateFile)">
|
|
<Output TaskParameter="Result" ItemName="_InstallerPackageRevision" />
|
|
</JsonPeek>
|
|
<JsonPeek Query="$.homepage" JsonInputPath="$(DebianConfigTemplateFile)">
|
|
<Output TaskParameter="Result" ItemName="_InstallerHomepage" />
|
|
</JsonPeek>
|
|
<JsonPeek Query="$.maintainer_name" JsonInputPath="$(DebianConfigTemplateFile)">
|
|
<Output TaskParameter="Result" ItemName="_InstallerMaintainerName" />
|
|
</JsonPeek>
|
|
<JsonPeek Query="$.maintainer_email" JsonInputPath="$(DebianConfigTemplateFile)">
|
|
<Output TaskParameter="Result" ItemName="_InstallerMaintainerEmail" />
|
|
</JsonPeek>
|
|
<JsonPeek Query="$.release.changelog_message" JsonInputPath="$(DebianConfigTemplateFile)">
|
|
<Output TaskParameter="Result" ItemName="_InstallerChangelogMessage" />
|
|
</JsonPeek>
|
|
|
|
<PropertyGroup>
|
|
<InstallerSummary>@(_InstallerSummary)</InstallerSummary>
|
|
<InstallerDescription>@(_InstallerDescription)</InstallerDescription>
|
|
<InstallerLicense>@(_InstallerLicense)</InstallerLicense>
|
|
<InstallerPackageRevision>@(_InstallerPackageRevision)</InstallerPackageRevision>
|
|
<InstallerHomepage>@(_InstallerHomepage)</InstallerHomepage>
|
|
<InstallerMaintainerName>@(_InstallerMaintainerName)</InstallerMaintainerName>
|
|
<InstallerMaintainerEmail>@(_InstallerMaintainerEmail)</InstallerMaintainerEmail>
|
|
<InstallerChangelogMessage>@(_InstallerChangelogMessage)</InstallerChangelogMessage>
|
|
</PropertyGroup>
|
|
|
|
<!-- Update Date, Maintainer, Version, Revision and Changelog Message -->
|
|
<Exec Command="sed -i
|
|
-e 's/DATE/$([System.DateTime]::UtcNow.ToString(ddd MMM dd yyyy))/'
|
|
-e 's/MAINTAINER_NAME/$(InstallerMaintainerName)/'
|
|
-e 's/MAINTAINER_EMAIL/$(InstallerMaintainerEmail)/'
|
|
-e 's/PACKAGE_VERSION/$(TimestampVersion)/'
|
|
-e 's/PACKAGE_REVISION/$(InstallerPackageRevision)/'
|
|
-e 's/CHANGELOG_MESSAGE/$(InstallerChangelogMessage)/'
|
|
$(RuntimeStoreInstallerLayoutTimestampDirectory)templates/changelog" />
|
|
<Exec Command="sed -i
|
|
-e 's/DATE/$([System.DateTime]::UtcNow.ToString(ddd MMM dd yyyy))/'
|
|
-e 's/MAINTAINER_NAME/$(InstallerMaintainerName)/'
|
|
-e 's/MAINTAINER_EMAIL/$(InstallerMaintainerEmail)/'
|
|
-e 's/PACKAGE_VERSION/$(NoTimestampVersion)/'
|
|
-e 's/PACKAGE_REVISION/$(InstallerPackageRevision)/'
|
|
-e 's/CHANGELOG_MESSAGE/$(InstallerChangelogMessage)/'
|
|
$(RuntimeStoreInstallerLayoutNoTimestampDirectory)templates/changelog" />
|
|
|
|
<MSBuild
|
|
Projects="$(ProjectPath)"
|
|
Targets="BuildRuntimeStoreRPM"
|
|
Properties="InstallerPlatform=rhel;InstallerSummary=$(InstallerSummary);InstallerDescription=$(InstallerDescription);InstallerLicense=$(InstallerLicense);InstallerPackageRevision=$(InstallerPackageRevision);InstallerHomepage=$(InstallerHomepage);InstallerMaintainerName=$(InstallerMaintainerName);InstallerMaintainerEmail=$(InstallerMaintainerEmail);InstallerChangelogMessage=$(InstallerChangelogMessage)" />
|
|
</Target>
|
|
|
|
<Target Name="BuildRuntimeStoreRPM">
|
|
<ItemGroup>
|
|
<RPMDirectories Include="/opt/rh/rh-dotnet20/root/usr/lib64/dotnet/store" />
|
|
<RPMDirectories Include="/opt/rh/rh-dotnet20/root/usr/lib64/dotnet/additionalDeps" />
|
|
</ItemGroup>
|
|
|
|
<PropertyGroup>
|
|
<!-- rpm unique installer parameters -->
|
|
<RuntimeStoreTimestampRPMFileName>$(RuntimeStoreTimestampInstallerPackageName)-$(InstallerPlatform)-$(PACKAGE_CACHE_PLATFORM).rpm</RuntimeStoreTimestampRPMFileName>
|
|
<RuntimeStoreNoTimestampRPMFileName>$(RuntimeStoreNoTimestampInstallerPackageName)-$(InstallerPlatform)-$(PACKAGE_CACHE_PLATFORM).rpm</RuntimeStoreNoTimestampRPMFileName>
|
|
<RPMDirectoriesArguments>@(RPMDirectories->' --directories "%(FullPath)"', ' ')</RPMDirectoriesArguments>
|
|
<InstallerMaintainer>$(InstallerMaintainerName) <$(InstallerMaintainerEmail)></InstallerMaintainer>
|
|
<InstallerVendor>.NET Foundation</InstallerVendor>
|
|
<InstallerInstallRoot>/opt/rh/rh-dotnet20/root/usr/lib64/dotnet</InstallerInstallRoot>
|
|
</PropertyGroup>
|
|
|
|
<!-- Clear the output dir -->
|
|
<RemoveDir Directories="$(RuntimeStoreInstallerOutputTimeStampDirectory);$(RuntimeStoreInstallerOutputNoTimeStampDirectory)" />
|
|
<MakeDir Directories="$(RuntimeStoreInstallerOutputTimeStampDirectory);$(RuntimeStoreInstallerOutputNoTimeStampDirectory)" />
|
|
|
|
<!-- Build Docker Image -->
|
|
<Exec
|
|
Command="docker build --build-arg USER_ID=%24(id -u) -t docker-image-$(InstallerPlatform) $(InstallerPlatform)"
|
|
WorkingDirectory="$(DockerDir)" />
|
|
|
|
<!-- Build Runtime Store Deb package -->
|
|
<Exec Command="docker run
|
|
--rm
|
|
-v $(RepositoryRoot):$(DockerRootDirectory)
|
|
docker-image-$(InstallerPlatform)
|
|
fpm
|
|
--verbose
|
|
-s dir
|
|
-t rpm
|
|
-n $(RuntimeStoreTimestampInstallerPackageName)
|
|
-v $(TimestampVersion)
|
|
-a amd64
|
|
$(RPMDirectoriesArguments)
|
|
--rpm-changelog $(DockerRootDirectory)artifacts/itLayout/templates/changelog
|
|
--rpm-summary "$(InstallerSummary)"
|
|
--description "$(InstallerDescription)"
|
|
--maintainer "$(InstallerMaintainer)"
|
|
--vendor "$(InstallerVendor)"
|
|
-p $(DockerRootDirectory)artifacts/itOutput/$(RuntimeStoreTimestampRPMFileName)
|
|
--license "$(InstallerLicense)"
|
|
--iteration $(InstallerPackageRevision)
|
|
--url "$(InstallerHomepage)"
|
|
$(DockerRootDirectory)artifacts/itLayout/package_root/="$(InstallerInstallRoot)"" />
|
|
<Exec Command="docker run
|
|
--rm
|
|
-v $(RepositoryRoot):$(DockerRootDirectory)
|
|
docker-image-$(InstallerPlatform)
|
|
fpm
|
|
--verbose
|
|
-s dir
|
|
-t rpm
|
|
-n $(RuntimeStoreNoTimestampInstallerPackageName)
|
|
-v $(NoTimestampVersion)
|
|
-a amd64
|
|
$(RPMDirectoriesArguments)
|
|
--rpm-changelog $(DockerRootDirectory)artifacts/inLayout/templates/changelog
|
|
--rpm-summary "$(InstallerSummary)"
|
|
--description "$(InstallerDescription)"
|
|
--maintainer "$(InstallerMaintainer)"
|
|
--vendor "$(InstallerVendor)"
|
|
-p $(DockerRootDirectory)artifacts/inOutput/$(RuntimeStoreNoTimestampRPMFileName)
|
|
--license "$(InstallerLicense)"
|
|
--iteration $(InstallerPackageRevision)
|
|
--url "$(InstallerHomepage)"
|
|
$(DockerRootDirectory)artifacts/inLayout/package_root/="$(InstallerInstallRoot)"" />
|
|
|
|
<!-- Remove Docker Image to save disk space -->
|
|
<Exec Command="docker rmi docker-image-$(InstallerPlatform)" />
|
|
|
|
<!-- Copy Runtime Store package to output -->
|
|
<ItemGroup>
|
|
<GeneratedTimestampRPMFiles Include="$(RuntimeStoreInstallerOutputTimeStampDirectory)/*.rpm" />
|
|
<GeneratedNoTimestampRPMFiles Include="$(RuntimeStoreInstallerOutputNoTimeStampDirectory)/*.rpm" />
|
|
</ItemGroup>
|
|
|
|
<Error Text="@(GeneratedTimestampRPMFiles->Count()) timestamp .rpm files generated." Condition="'@(GeneratedTimestampRPMFiles->Count())' != 1" />
|
|
<Error Text="@(GeneratedNoTimestampRPMFiles->Count()) no timestamp .rpm files generated." Condition="'@(GeneratedNoTimestampRPMFiles->Count())' != 1" />
|
|
|
|
<Copy
|
|
DestinationFiles="$(RuntimeStoreInstallerDirectory)$(RuntimeStoreTimestampRPMFileName)"
|
|
SourceFiles="@(GeneratedTimestampRPMFiles)"
|
|
OverwriteReadOnlyFiles="true"
|
|
SkipUnchangedFiles="false" />
|
|
<Copy
|
|
DestinationFiles="$(RuntimeStoreInstallerDirectory)$(RuntimeStoreNoTimestampRPMFileName)"
|
|
SourceFiles="@(GeneratedNoTimestampRPMFiles)"
|
|
OverwriteReadOnlyFiles="true"
|
|
SkipUnchangedFiles="false" />
|
|
</Target>
|
|
|
|
<Target Name="GenerateDebs" DependsOnTargets="EnsureInstallerPrerequisites">
|
|
<!-- Create layout: Aspnet runtime store -->
|
|
<RemoveDir Directories="$(RuntimeStoreInstallerLayoutTimestampDirectory)" />
|
|
<MakeDir Directories="$(RuntimeStoreInstallerLayoutPackageRootTimestampDirectory)" />
|
|
<Exec Command="tar -xzf @(RuntimeStoreTimestampArchive) -C $(RuntimeStoreInstallerLayoutPackageRootTimestampDirectory)" />
|
|
<RemoveDir Directories="$(RuntimeStoreInstallerLayoutNoTimestampDirectory)" />
|
|
<MakeDir Directories="$(RuntimeStoreInstallerLayoutPackageRootNoTimestampDirectory)" />
|
|
<Exec Command="tar -xzf @(RuntimeStoreNoTimestampArchive) -C $(RuntimeStoreInstallerLayoutPackageRootNoTimestampDirectory)" />
|
|
|
|
<!-- Create layout: Generate and Place debian_config.json -->
|
|
<Copy
|
|
SourceFiles="$(DebianConfigTemplateFile)"
|
|
DestinationFiles="$(RuntimeStoreInstallerLayoutTimestampDirectory)debian_config.json"
|
|
OverwriteReadOnlyFiles="True"
|
|
SkipUnchangedFiles="False"
|
|
UseHardlinksIfPossible="False" />
|
|
<Copy
|
|
SourceFiles="$(DebianConfigTemplateFile)"
|
|
DestinationFiles="$(RuntimeStoreInstallerLayoutNoTimestampDirectory)debian_config.json"
|
|
OverwriteReadOnlyFiles="True"
|
|
SkipUnchangedFiles="False"
|
|
UseHardlinksIfPossible="False" />
|
|
|
|
<MSBuild Projects="$(ProjectPath)" Targets="BuildRuntimeStoreDeb" Properties="InstallerPlatform=debian" />
|
|
<MSBuild Projects="$(ProjectPath)" Targets="BuildRuntimeStoreDeb" Properties="InstallerPlatform=ubuntu.14.04" />
|
|
<MSBuild Projects="$(ProjectPath)" Targets="BuildRuntimeStoreDeb" Properties="InstallerPlatform=ubuntu.16.04" />
|
|
<MSBuild Projects="$(ProjectPath)" Targets="BuildRuntimeStoreDeb" Properties="InstallerPlatform=ubuntu.16.10" />
|
|
</Target>
|
|
|
|
|
|
<Target Name="BuildRuntimeStoreDeb">
|
|
<PropertyGroup>
|
|
<RuntimeStoreTimestampDebianFileName>$(RuntimeStoreTimestampInstallerPackageName)-$(InstallerPlatform)-$(PACKAGE_CACHE_PLATFORM).deb</RuntimeStoreTimestampDebianFileName>
|
|
<RuntimeStoreNoTimestampDebianFileName>$(RuntimeStoreNoTimestampInstallerPackageName)-$(InstallerPlatform)-$(PACKAGE_CACHE_PLATFORM).deb</RuntimeStoreNoTimestampDebianFileName>
|
|
</PropertyGroup>
|
|
|
|
<!-- Clear the output dir -->
|
|
<RemoveDir Directories="$(RuntimeStoreInstallerOutputTimeStampDirectory)" />
|
|
<RemoveDir Directories="$(RuntimeStoreInstallerOutputNoTimeStampDirectory)" />
|
|
<MakeDir Directories="$(RuntimeStoreInstallerOutputTimeStampDirectory)" />
|
|
<MakeDir Directories="$(RuntimeStoreInstallerOutputNoTimeStampDirectory)" />
|
|
|
|
<!-- Build Docker Image -->
|
|
<Exec
|
|
Command="docker build --build-arg USER_ID=%24(id -u) -t docker-image-$(InstallerPlatform) $(InstallerPlatform)"
|
|
WorkingDirectory="$(DockerDir)" />
|
|
|
|
<!-- Parse CLI version -->
|
|
<ReadLinesFromFile File="$(BuildDirectory)cli.version">
|
|
<Output TaskParameter="Lines" PropertyName="CLIVersionNumber" />
|
|
</ReadLinesFromFile>
|
|
|
|
<!-- Build Runtime Store Deb package -->
|
|
<Exec Command="docker run
|
|
--rm
|
|
-v $(RepositoryRoot):$(DockerRootDirectory)
|
|
-e DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
|
|
-e KOREBUILD_SKIP_RUNTIME_INSTALL=true
|
|
-e BuildNumber=$(BuildNumber)
|
|
-e RUNTIMESTORE_TIMESTAMP_INSTALLERNAME=$(RuntimeStoreTimestampInstallerPackageName)
|
|
-e RUNTIMESTORE_NOTIMESTAMP_INSTALLERNAME=$(RuntimeStoreNoTimestampInstallerPackageName)
|
|
docker-image-$(InstallerPlatform)
|
|
/bin/bash -c "
|
|
$(DockerRootDirectory).build/dotnet/dotnet-install.sh
|
|
--channel preview
|
|
--version $(CLIVersionNumber) &&
|
|
export PATH=$PATH:/home/code_executor/.dotnet &&
|
|
./build.sh /t:RunDebTool
|
|
""
|
|
ContinueOnError="WarnAndContinue" />
|
|
|
|
<!-- Remove Docker Image to save disk space -->
|
|
<Exec Command="docker rmi docker-image-$(InstallerPlatform)" />
|
|
|
|
<!-- Copy Runtime Store package to output -->
|
|
<ItemGroup>
|
|
<GeneratedTimestampDebFiles Include="$(RuntimeStoreInstallerOutputTimeStampDirectory)/*.deb" />
|
|
<GeneratedNoTimestampDebFiles Include="$(RuntimeStoreInstallerOutputNoTimeStampDirectory)/*.deb" />
|
|
</ItemGroup>
|
|
|
|
<Error Text="@(GeneratedTimestampDebFiles->Count()) timestamp .deb files generated." Condition="'@(GeneratedTimestampDebFiles->Count())' != 1" />
|
|
<Error Text="@(GeneratedNoTimestampDebFiles->Count()) no timestamp .deb files generated." Condition="'@(GeneratedTimestampDebFiles->Count())' != 1" />
|
|
|
|
<Copy
|
|
DestinationFiles="$(RuntimeStoreInstallerDirectory)$(RuntimeStoreTimestampDebianFileName)"
|
|
SourceFiles="@(GeneratedTimestampDebFiles)"
|
|
OverwriteReadOnlyFiles="True"
|
|
SkipUnchangedFiles="False"
|
|
UseHardlinksIfPossible="False" />
|
|
<Copy
|
|
DestinationFiles="$(RuntimeStoreInstallerDirectory)$(RuntimeStoreNoTimestampDebianFileName)"
|
|
SourceFiles="@(GeneratedNoTimestampDebFiles)"
|
|
OverwriteReadOnlyFiles="True"
|
|
SkipUnchangedFiles="False"
|
|
UseHardlinksIfPossible="False" />
|
|
</Target>
|
|
|
|
<Target Name="RunDebTool">
|
|
<!-- Install dotnet-deb tool -->
|
|
<Exec Command="dotnet restore" WorkingDirectory="$(DotnetDebToolDirectory)" />
|
|
|
|
<!-- Build Runtime Store Timestamp Deb package -->
|
|
<Exec Command="
|
|
dotnet deb-tool
|
|
-i $(RuntimeStoreInstallerLayoutTimestampDirectory)
|
|
-o $(RuntimeStoreInstallerOutputTimeStampDirectory)
|
|
-n $(RUNTIMESTORE_TIMESTAMP_INSTALLERNAME)
|
|
-v $(TimestampVersion)"
|
|
WorkingDirectory="$(DotnetDebToolDirectory)" />
|
|
|
|
<!-- Build Runtime Store NoTimestamp Deb package -->
|
|
<Exec Command="
|
|
dotnet deb-tool
|
|
-i $(RuntimeStoreInstallerLayoutNoTimestampDirectory)
|
|
-o $(RuntimeStoreInstallerOutputNoTimeStampDirectory)
|
|
-n $(RUNTIMESTORE_NOTIMESTAMP_INSTALLERNAME)
|
|
-v $(NoTimestampVersion)"
|
|
WorkingDirectory="$(DotnetDebToolDirectory)" />
|
|
</Target>
|
|
</Project>
|