Refactor publish.target

This commit is contained in:
Justin Goshi 2017-02-22 16:54:15 -08:00
parent 5f08a55b9d
commit e894d7e60e
9 changed files with 58 additions and 59 deletions

View file

@ -24,6 +24,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestPackages", "TestPackage
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4-BC0F-443B-8ADF-691321F10108}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4-BC0F-443B-8ADF-691321F10108}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
build\AzureInfo.props = build\AzureInfo.props
build\Branding.props = build\Branding.props build\Branding.props = build\Branding.props
build\BranchInfo.props = build\BranchInfo.props build\BranchInfo.props = build\BranchInfo.props
build\BuildDefaults.props = build\BuildDefaults.props build\BuildDefaults.props = build\BuildDefaults.props
@ -43,6 +44,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4
build\InitRepo.props = build\InitRepo.props build\InitRepo.props = build\InitRepo.props
build\InitRepo.targets = build\InitRepo.targets build\InitRepo.targets = build\InitRepo.targets
build\InputDirectories.props = build\InputDirectories.props build\InputDirectories.props = build\InputDirectories.props
build\InstallerInfo.props = build\InstallerInfo.props
build\OutputDirectories.props = build\OutputDirectories.props build\OutputDirectories.props = build\OutputDirectories.props
build\Package.targets = build\Package.targets build\Package.targets = build\Package.targets
build\Prepare.targets = build\Prepare.targets build\Prepare.targets = build\Prepare.targets

14
build/AzureInfo.props Normal file
View file

@ -0,0 +1,14 @@
<Project>
<PropertyGroup>
<Product>Sdk</Product>
<ArtifactContainerName>$(ARTIFACT_STORAGE_CONTAINER)</ArtifactContainerName>
<ArtifactContainerName Condition="'$(ArtifactContainerName)' == ''">dotnet</ArtifactContainerName>
<ArtifactCloudDropAccessToken>$(ARTIFACT_STORAGE_KEY)</ArtifactCloudDropAccessToken>
<ArtifactCloudDropAccountName>$(ARTIFACT_STORAGE_ACCOUNT)</ArtifactCloudDropAccountName>
<ArtifactCloudDropAccountName Condition="'$(ArtifactCloudDropAccountName)' == ''">dotnetcli</ArtifactCloudDropAccountName>
<DotnetBlobRootUrl>https://$(ArtifactCloudDropAccountName).blob.core.windows.net/$(ArtifactContainerName)</DotnetBlobRootUrl>
<ChecksumContainerName>$(CHECKSUM_STORAGE_CONTAINER)</ChecksumContainerName>
<ChecksumCloudDropAccessToken>$(CHECKSUM_STORAGE_KEY)</ChecksumCloudDropAccessToken>
<ChecksumCloudDropAccountName>$(CHECKSUM_STORAGE_ACCOUNT)</ChecksumCloudDropAccountName>
</PropertyGroup>
</Project>

10
build/InstallerInfo.props Normal file
View file

@ -0,0 +1,10 @@
<Project>
<PropertyGroup>
<SdkDebianPackageVersion>$(SdkVersion)</SdkDebianPackageVersion>
<SdkDebianPackageName>dotnet-dev-$(SdkDebianPackageVersion)</SdkDebianPackageName>
<SdkDebianIntermediateDirectory>$(IntermediateDirectory)/debian/sdk</SdkDebianIntermediateDirectory>
<InstallerOutputDirectory>$(PackagesDirectory)</InstallerOutputDirectory>
<SdkInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionSdk)$(InstallerExtension)</SdkInstallerFile>
</PropertyGroup>
</Project>

View file

@ -5,6 +5,25 @@
<Import Project="$(MSBuildThisFileDirectory)/publish/Badge.targets" /> <Import Project="$(MSBuildThisFileDirectory)/publish/Badge.targets" />
<Import Project="$(MSBuildThisFileDirectory)/publish/Checksum.targets" /> <Import Project="$(MSBuildThisFileDirectory)/publish/Checksum.targets" />
<ItemGroup>
<SdkInstallerFileItemGroup Include="$(SdkInstallerFile)" />
</ItemGroup>
<PropertyGroup>
<SdkDebianUploadUrl>$(DotnetBlobRootUrl)/$(Product)/$(FullNugetVersion)/%(SdkInstallerFileItemGroup.Filename)%(SdkInstallerFileItemGroup.Extension)</SdkDebianUploadUrl>
<DebianUploadJsonFile>$(SdkDebianIntermediateDirectory)/package_upload.json</DebianUploadJsonFile>
<DebianRevisionNumber>1</DebianRevisionNumber>
<DebianUploadJsonContent>
{
"name":"$(SdkDebianPackageName)",
"version":"$(NugetVersion)-$(DebianRevisionNumber)",
"repositoryId":"$(REPO_ID)",
"sourceUrl": "$(SdkDebianUploadUrl)"
}
</DebianUploadJsonContent>
</PropertyGroup>
<!-- PUBLISH_TO_AZURE_BLOB env variable set by CI --> <!-- PUBLISH_TO_AZURE_BLOB env variable set by CI -->
<Target Name="Publish" <Target Name="Publish"
Condition=" '$(PUBLISH_TO_AZURE_BLOB)' != '' " Condition=" '$(PUBLISH_TO_AZURE_BLOB)' != '' "
@ -15,8 +34,7 @@
<!-- UploadToAzure target comes from Build Tools --> <!-- UploadToAzure target comes from Build Tools -->
<Target Name="PublishArtifacts" <Target Name="PublishArtifacts"
DependsOnTargets="SetupAzureBlobInformation; DependsOnTargets="GenerateVersionBadge;
GenerateVersionBadge;
GatherItemsForPattern; GatherItemsForPattern;
GenerateChecksums; GenerateChecksums;
UploadArtifactsToAzure; UploadArtifactsToAzure;
@ -24,21 +42,6 @@
PublishDebFilesToDebianRepo; PublishDebFilesToDebianRepo;
PublishCliVersionBadge" /> PublishCliVersionBadge" />
<Target Name="SetupAzureBlobInformation">
<PropertyGroup>
<Product>Sdk</Product>
<ArtifactContainerName>$(ARTIFACT_STORAGE_CONTAINER)</ArtifactContainerName>
<ArtifactContainerName Condition="'$(ArtifactContainerName)' == ''">dotnet</ArtifactContainerName>
<ArtifactCloudDropAccessToken>$(ARTIFACT_STORAGE_KEY)</ArtifactCloudDropAccessToken>
<ArtifactCloudDropAccountName>$(ARTIFACT_STORAGE_ACCOUNT)</ArtifactCloudDropAccountName>
<ArtifactCloudDropAccountName Condition="'$(ArtifactCloudDropAccountName)' == ''">dotnetcli</ArtifactCloudDropAccountName>
<DotnetBlobRootUrl>https://$(ArtifactCloudDropAccountName).blob.core.windows.net/$(ArtifactContainerName)</DotnetBlobRootUrl>
<ChecksumContainerName>$(CHECKSUM_STORAGE_CONTAINER)</ChecksumContainerName>
<ChecksumCloudDropAccessToken>$(CHECKSUM_STORAGE_KEY)</ChecksumCloudDropAccessToken>
<ChecksumCloudDropAccountName>$(CHECKSUM_STORAGE_ACCOUNT)</ChecksumCloudDropAccountName>
</PropertyGroup>
</Target>
<Target Name="GatherItemsForPattern"> <Target Name="GatherItemsForPattern">
<ItemGroup> <ItemGroup>
<ForPublishing Include="@(GeneratedInstallers)" /> <ForPublishing Include="@(GeneratedInstallers)" />
@ -59,24 +62,6 @@
<Error Condition="'$(REPO_PASS)' == ''" Text="REPO_PASS must be set as an environment variable for debian publishing." /> <Error Condition="'$(REPO_PASS)' == ''" Text="REPO_PASS must be set as an environment variable for debian publishing." />
<Error Condition="'$(REPO_SERVER)' == ''" Text="REPO_SERVER must be set as an environment variable for debian publishing." /> <Error Condition="'$(REPO_SERVER)' == ''" Text="REPO_SERVER must be set as an environment variable for debian publishing." />
<ItemGroup>
<SdkInstallerFileItemGroup Include="$(SdkInstallerFile)" />
</ItemGroup>
<PropertyGroup>
<SdkDebianUploadUrl>$(DotnetBlobRootUrl)/$(Product)/$(FullNugetVersion)/%(SdkInstallerFileItemGroup.Filename)%(SdkInstallerFileItemGroup.Extension)</SdkDebianUploadUrl>
<DebianUploadJsonFile>$(SdkDebianIntermediateDirectory)/package_upload.json</DebianUploadJsonFile>
<DebianRevisionNumber>1</DebianRevisionNumber>
<DebianUploadJsonContent>
{
"name":"$(SdkDebianPackageName)",
"version":"$(NugetVersion)-$(DebianRevisionNumber)",
"repositoryId":"$(REPO_ID)",
"sourceUrl": "$(SdkDebianUploadUrl)"
}
</DebianUploadJsonContent>
</PropertyGroup>
<Delete Files="$(DebianUploadJsonFile)" /> <Delete Files="$(DebianUploadJsonFile)" />
<WriteLinesToFile File="$(DebianUploadJsonFile)" Lines="$(DebianUploadJsonContent)" /> <WriteLinesToFile File="$(DebianUploadJsonFile)" Lines="$(DebianUploadJsonContent)" />

View file

@ -27,7 +27,6 @@
<Target Name="UploadNuGetPackagesArchiveToAzure" <Target Name="UploadNuGetPackagesArchiveToAzure"
DependsOnTargets="SetupNuGetPackagesArchiveInputsOutputs; DependsOnTargets="SetupNuGetPackagesArchiveInputsOutputs;
SetupAzureBlobInformation;
GenerateNuGetPackagesArchive" GenerateNuGetPackagesArchive"
Condition=" '$(UploadNuGetPackagesArchiveToAzure)' == 'true' And '$(PUBLISH_LZMA_TO_AZURE_BLOB)' != '' "> Condition=" '$(UploadNuGetPackagesArchiveToAzure)' == 'true' And '$(PUBLISH_LZMA_TO_AZURE_BLOB)' != '' ">
<ItemGroup> <ItemGroup>
@ -108,7 +107,7 @@
</Target> </Target>
<Target Name="SetupNuGetPackagesArchiveInputsOutputs" <Target Name="SetupNuGetPackagesArchiveInputsOutputs"
DependsOnTargets="Prepare;SetupAzureBlobInformation"> DependsOnTargets="Prepare">
<GenerateNuGetPackagesArchiveVersion ToolPath="$(Stage2Directory)"> <GenerateNuGetPackagesArchiveVersion ToolPath="$(Stage2Directory)">
<Output TaskParameter="Version" PropertyName="NuGetPackagesArchiveVersion"/> <Output TaskParameter="Version" PropertyName="NuGetPackagesArchiveVersion"/>
</GenerateNuGetPackagesArchiveVersion> </GenerateNuGetPackagesArchiveVersion>

View file

@ -33,8 +33,6 @@
<!-- Package Identities --> <!-- Package Identities -->
<PropertyGroup> <PropertyGroup>
<SdkDebianPackageVersion>$(SdkVersion)</SdkDebianPackageVersion>
<SdkDebianPackageName>dotnet-dev-$(SdkDebianPackageVersion)</SdkDebianPackageName>
<SharedFxDebianPackageVersion>$(SharedFrameworkVersion)</SharedFxDebianPackageVersion> <SharedFxDebianPackageVersion>$(SharedFrameworkVersion)</SharedFxDebianPackageVersion>
<SharedFxDebianPackageName>dotnet-sharedframework-$(SharedFrameworkName)-$(SharedFxDebianPackageVersion)</SharedFxDebianPackageName> <SharedFxDebianPackageName>dotnet-sharedframework-$(SharedFrameworkName)-$(SharedFxDebianPackageVersion)</SharedFxDebianPackageName>
<SharedFxDebianPackageName>$(SharedFxDebianPackageName.ToLower())</SharedFxDebianPackageName> <SharedFxDebianPackageName>$(SharedFxDebianPackageName.ToLower())</SharedFxDebianPackageName>
@ -65,10 +63,6 @@
<!-- Output Directories --> <!-- Output Directories -->
<PropertyGroup> <PropertyGroup>
<InstallerOutputDirectory>$(PackagesDirectory)</InstallerOutputDirectory>
<SdkInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionSdk)$(InstallerExtension)</SdkInstallerFile>
<SdkDebianIntermediateDirectory>$(IntermediateDirectory)/debian/sdk</SdkDebianIntermediateDirectory>
<DotNetDebToolOutputDirectory>$(SdkDebianIntermediateDirectory)/deb-tool-output</DotNetDebToolOutputDirectory> <DotNetDebToolOutputDirectory>$(SdkDebianIntermediateDirectory)/deb-tool-output</DotNetDebToolOutputDirectory>
<DebianTestResultsXmlFile>$(SdkDebianIntermediateDirectory)/debian-testResults.xml</DebianTestResultsXmlFile> <DebianTestResultsXmlFile>$(SdkDebianIntermediateDirectory)/debian-testResults.xml</DebianTestResultsXmlFile>
</PropertyGroup> </PropertyGroup>

View file

@ -12,15 +12,12 @@
<!-- Generate MSI/Bundle Properties --> <!-- Generate MSI/Bundle Properties -->
<PropertyGroup> <PropertyGroup>
<InstallerOutputDirectory>$(PackagesDirectory)</InstallerOutputDirectory>
<CombinedFrameworkSdkHostBundleEngineName>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)-engine.exe</CombinedFrameworkSdkHostBundleEngineName> <CombinedFrameworkSdkHostBundleEngineName>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)-engine.exe</CombinedFrameworkSdkHostBundleEngineName>
<SdkGenerateMsiPowershellScript>$(RepoRoot)/packaging/windows/clisdk/generatemsi.ps1</SdkGenerateMsiPowershellScript> <SdkGenerateMsiPowershellScript>$(RepoRoot)/packaging/windows/clisdk/generatemsi.ps1</SdkGenerateMsiPowershellScript>
<SdkGenerateBundlePowershellScript>$(RepoRoot)/packaging/windows/clisdk/generatebundle.ps1</SdkGenerateBundlePowershellScript> <SdkGenerateBundlePowershellScript>$(RepoRoot)/packaging/windows/clisdk/generatebundle.ps1</SdkGenerateBundlePowershellScript>
<SdkGenerateNupkgPowershellScript>$(RepoRoot)/packaging/windows/clisdk/generatenupkg.ps1</SdkGenerateNupkgPowershellScript> <SdkGenerateNupkgPowershellScript>$(RepoRoot)/packaging/windows/clisdk/generatenupkg.ps1</SdkGenerateNupkgPowershellScript>
<SdkInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionSdk)$(InstallerExtension)</SdkInstallerFile>
<CombinedFrameworkSdkHostInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(BundleExtension)</CombinedFrameworkSdkHostInstallerFile> <CombinedFrameworkSdkHostInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(BundleExtension)</CombinedFrameworkSdkHostInstallerFile>
<SdkInstallerNuspecFile>$(RepoRoot)/packaging/windows/clisdk/VS.Redist.Common.Net.Core.SDK.$(Architecture).nuspec</SdkInstallerNuspecFile> <SdkInstallerNuspecFile>$(RepoRoot)/packaging/windows/clisdk/VS.Redist.Common.Net.Core.SDK.$(Architecture).nuspec</SdkInstallerNuspecFile>
<SdkInstallerNupkgFile>$(InstallerOutputDirectory)/VS.Redist.Common.Net.Core.SDK.$(Architecture).$(FullNugetVersion).nupkg</SdkInstallerNupkgFile> <SdkInstallerNupkgFile>$(InstallerOutputDirectory)/VS.Redist.Common.Net.Core.SDK.$(Architecture).$(FullNugetVersion).nupkg</SdkInstallerNupkgFile>

View file

@ -2,10 +2,8 @@
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="SetupPkgInputsOutputs"> <Target Name="SetupPkgInputsOutputs">
<PropertyGroup> <PropertyGroup>
<InstallerOutputDirectory>$(PackagesDirectory)</InstallerOutputDirectory>
<PkgIntermediateDirectory>$(IntermediateDirectory)/pkgs/$(SdkVersion)</PkgIntermediateDirectory> <PkgIntermediateDirectory>$(IntermediateDirectory)/pkgs/$(SdkVersion)</PkgIntermediateDirectory>
<SdkInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionSdk)$(InstallerExtension)</SdkInstallerFile>
<CombinedFrameworkSdkHostInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(BundleExtension)</CombinedFrameworkSdkHostInstallerFile> <CombinedFrameworkSdkHostInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(BundleExtension)</CombinedFrameworkSdkHostInstallerFile>
<!-- Properties for pkg build --> <!-- Properties for pkg build -->

View file

@ -2,6 +2,15 @@
<PropertyGroup> <PropertyGroup>
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot> <RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
<NuGetPackagesDir>$(NUGET_PACKAGES)</NuGetPackagesDir>
<NuGetPackagesDir Condition=" '$(NuGetPackagesDir)' == '' ">$(RepoRoot)/.nuget/packages</NuGetPackagesDir>
<CLIBuildDll>$(RepoRoot)/build_projects/dotnet-cli-build/bin/dotnet-cli-build.dll</CLIBuildDll>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<CliTargetFramework>netcoreapp2.0</CliTargetFramework>
</PropertyGroup> </PropertyGroup>
<Import Project="build/InitRepo.props" /> <Import Project="build/InitRepo.props" />
@ -23,17 +32,8 @@
<Import Project="build/Stage0.props" /> <Import Project="build/Stage0.props" />
<Import Project="build/VersionBadge.props" /> <Import Project="build/VersionBadge.props" />
<Import Project="build/BundledRuntimes.props" /> <Import Project="build/BundledRuntimes.props" />
<PropertyGroup>
<NuGetPackagesDir>$(NUGET_PACKAGES)</NuGetPackagesDir>
<NuGetPackagesDir Condition=" '$(NuGetPackagesDir)' == '' ">$(RepoRoot)/.nuget/packages</NuGetPackagesDir>
<CLIBuildDll>$(RepoRoot)/build_projects/dotnet-cli-build/bin/dotnet-cli-build.dll</CLIBuildDll>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<CliTargetFramework>netcoreapp2.0</CliTargetFramework>
</PropertyGroup>
<Import Project="build/AzureInfo.props" />
<Import Project="build/CrossgenInfo.props" /> <Import Project="build/CrossgenInfo.props" />
<Import Project="build/InstallerInfo.props" />
</Project> </Project>