Merge pull request #5804 from dotnet/dev/jgoshi/refactorPublishTarget
Refactor publish.target
This commit is contained in:
commit
9e4beca874
10 changed files with 77 additions and 72 deletions
|
@ -24,6 +24,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestPackages", "TestPackage
|
|||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4-BC0F-443B-8ADF-691321F10108}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
build\AzureInfo.props = build\AzureInfo.props
|
||||
build\Branding.props = build\Branding.props
|
||||
build\BranchInfo.props = build\BranchInfo.props
|
||||
build\BuildDefaults.props = build\BuildDefaults.props
|
||||
|
@ -44,6 +45,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4
|
|||
build\InitRepo.props = build\InitRepo.props
|
||||
build\InitRepo.targets = build\InitRepo.targets
|
||||
build\InputDirectories.props = build\InputDirectories.props
|
||||
build\InstallerInfo.props = build\InstallerInfo.props
|
||||
build\ProjectsToPublish.props = build\ProjectsToPublish.props
|
||||
build\OutputDirectories.props = build\OutputDirectories.props
|
||||
build\Package.targets = build\Package.targets
|
||||
|
@ -88,6 +90,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "publish", "publish", "{27B1
|
|||
build\publish\Badge.targets = build\publish\Badge.targets
|
||||
build\publish\Checksum.targets = build\publish\Checksum.targets
|
||||
build\publish\PublishContent.targets = build\publish\PublishContent.targets
|
||||
build\publish\PublishDebian.targets = build\publish\PublishDebian.targets
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dotnet-cli-build", "build_projects\dotnet-cli-build\dotnet-cli-build.csproj", "{8A2FA2D8-0DA1-4814-B5C1-2ECEAA613EB1}"
|
||||
|
|
14
build/AzureInfo.props
Normal file
14
build/AzureInfo.props
Normal 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>
|
6
build/InstallerInfo.props
Normal file
6
build/InstallerInfo.props
Normal file
|
@ -0,0 +1,6 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<InstallerOutputDirectory>$(PackagesDirectory)</InstallerOutputDirectory>
|
||||
<SdkInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionSdk)$(InstallerExtension)</SdkInstallerFile>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -2,6 +2,7 @@
|
|||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildThisFileDirectory)/publish/FinishBuild.targets" />
|
||||
<Import Project="$(MSBuildThisFileDirectory)/publish/PublishContent.targets" />
|
||||
<Import Project="$(MSBuildThisFileDirectory)/publish/PublishDebian.targets" />
|
||||
<Import Project="$(MSBuildThisFileDirectory)/publish/Badge.targets" />
|
||||
<Import Project="$(MSBuildThisFileDirectory)/publish/Checksum.targets" />
|
||||
|
||||
|
@ -15,8 +16,7 @@
|
|||
|
||||
<!-- UploadToAzure target comes from Build Tools -->
|
||||
<Target Name="PublishArtifacts"
|
||||
DependsOnTargets="SetupAzureBlobInformation;
|
||||
GenerateVersionBadge;
|
||||
DependsOnTargets="GenerateVersionBadge;
|
||||
GatherItemsForPattern;
|
||||
GenerateChecksums;
|
||||
UploadArtifactsToAzure;
|
||||
|
@ -24,21 +24,6 @@
|
|||
PublishDebFilesToDebianRepo;
|
||||
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">
|
||||
<ItemGroup>
|
||||
<ForPublishing Include="@(GeneratedInstallers)" />
|
||||
|
@ -53,36 +38,6 @@
|
|||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="PublishDebFilesToDebianRepo" Condition=" '$(OSName)' == 'ubuntu' AND '$(SkipPublishToDebianRepo)' != 'true' ">
|
||||
<Error Condition="'$(REPO_ID)' == ''" Text="REPO_ID must be set as an environment variable for debian publishing." />
|
||||
<Error Condition="'$(REPO_USER)' == ''" Text="REPO_USER 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." />
|
||||
|
||||
<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)" />
|
||||
<WriteLinesToFile File="$(DebianUploadJsonFile)" Lines="$(DebianUploadJsonContent)" />
|
||||
|
||||
<Exec Command="$(RepoRoot)/scripts/publish/repoapi_client.sh -addpkg $(DebianUploadJsonFile)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="PublishCliVersionBadge">
|
||||
<ItemGroup>
|
||||
<CliVersionBadgeToUpload Include="$(VersionBadge)" />
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
<Target Name="UploadNuGetPackagesArchiveToAzure"
|
||||
DependsOnTargets="SetupNuGetPackagesArchiveInputsOutputs;
|
||||
SetupAzureBlobInformation;
|
||||
GenerateNuGetPackagesArchive"
|
||||
Condition=" '$(UploadNuGetPackagesArchiveToAzure)' == 'true' And '$(PUBLISH_LZMA_TO_AZURE_BLOB)' != '' ">
|
||||
<ItemGroup>
|
||||
|
@ -108,7 +107,7 @@
|
|||
</Target>
|
||||
|
||||
<Target Name="SetupNuGetPackagesArchiveInputsOutputs"
|
||||
DependsOnTargets="Prepare;SetupAzureBlobInformation">
|
||||
DependsOnTargets="Prepare">
|
||||
<GenerateNuGetPackagesArchiveVersion ToolPath="$(Stage2Directory)">
|
||||
<Output TaskParameter="Version" PropertyName="NuGetPackagesArchiveVersion"/>
|
||||
</GenerateNuGetPackagesArchiveVersion>
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Target Name="SetupDebProps"
|
||||
<PropertyGroup>
|
||||
<SdkDebianPackageVersion>$(SdkVersion)</SdkDebianPackageVersion>
|
||||
<SdkDebianPackageName>dotnet-dev-$(SdkDebianPackageVersion)</SdkDebianPackageName>
|
||||
<SdkDebianIntermediateDirectory>$(IntermediateDirectory)/debian/sdk</SdkDebianIntermediateDirectory>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="SetupDebProps"
|
||||
DependsOnTargets="Init">
|
||||
<!-- dotnet deb-tool -->
|
||||
<PropertyGroup>
|
||||
|
@ -33,8 +39,6 @@
|
|||
|
||||
<!-- Package Identities -->
|
||||
<PropertyGroup>
|
||||
<SdkDebianPackageVersion>$(SdkVersion)</SdkDebianPackageVersion>
|
||||
<SdkDebianPackageName>dotnet-dev-$(SdkDebianPackageVersion)</SdkDebianPackageName>
|
||||
<SharedFxDebianPackageVersion>$(SharedFrameworkVersion)</SharedFxDebianPackageVersion>
|
||||
<SharedFxDebianPackageName>dotnet-sharedframework-$(SharedFrameworkName)-$(SharedFxDebianPackageVersion)</SharedFxDebianPackageName>
|
||||
<SharedFxDebianPackageName>$(SharedFxDebianPackageName.ToLower())</SharedFxDebianPackageName>
|
||||
|
@ -65,10 +69,6 @@
|
|||
|
||||
<!-- Output Directories -->
|
||||
<PropertyGroup>
|
||||
<InstallerOutputDirectory>$(PackagesDirectory)</InstallerOutputDirectory>
|
||||
<SdkInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionSdk)$(InstallerExtension)</SdkInstallerFile>
|
||||
|
||||
<SdkDebianIntermediateDirectory>$(IntermediateDirectory)/debian/sdk</SdkDebianIntermediateDirectory>
|
||||
<DotNetDebToolOutputDirectory>$(SdkDebianIntermediateDirectory)/deb-tool-output</DotNetDebToolOutputDirectory>
|
||||
<DebianTestResultsXmlFile>$(SdkDebianIntermediateDirectory)/debian-testResults.xml</DebianTestResultsXmlFile>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -12,15 +12,12 @@
|
|||
|
||||
<!-- Generate MSI/Bundle Properties -->
|
||||
<PropertyGroup>
|
||||
<InstallerOutputDirectory>$(PackagesDirectory)</InstallerOutputDirectory>
|
||||
|
||||
<CombinedFrameworkSdkHostBundleEngineName>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)-engine.exe</CombinedFrameworkSdkHostBundleEngineName>
|
||||
|
||||
<SdkGenerateMsiPowershellScript>$(RepoRoot)/packaging/windows/clisdk/generatemsi.ps1</SdkGenerateMsiPowershellScript>
|
||||
<SdkGenerateBundlePowershellScript>$(RepoRoot)/packaging/windows/clisdk/generatebundle.ps1</SdkGenerateBundlePowershellScript>
|
||||
<SdkGenerateNupkgPowershellScript>$(RepoRoot)/packaging/windows/clisdk/generatenupkg.ps1</SdkGenerateNupkgPowershellScript>
|
||||
|
||||
<SdkInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionSdk)$(InstallerExtension)</SdkInstallerFile>
|
||||
<CombinedFrameworkSdkHostInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(BundleExtension)</CombinedFrameworkSdkHostInstallerFile>
|
||||
<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>
|
||||
|
|
|
@ -2,10 +2,8 @@
|
|||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Target Name="SetupPkgInputsOutputs">
|
||||
<PropertyGroup>
|
||||
<InstallerOutputDirectory>$(PackagesDirectory)</InstallerOutputDirectory>
|
||||
<PkgIntermediateDirectory>$(IntermediateDirectory)/pkgs/$(SdkVersion)</PkgIntermediateDirectory>
|
||||
|
||||
<SdkInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionSdk)$(InstallerExtension)</SdkInstallerFile>
|
||||
<CombinedFrameworkSdkHostInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(BundleExtension)</CombinedFrameworkSdkHostInstallerFile>
|
||||
|
||||
<!-- Properties for pkg build -->
|
||||
|
|
33
build/publish/PublishDebian.targets
Normal file
33
build/publish/PublishDebian.targets
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<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>
|
||||
|
||||
<Target Name="PublishDebFilesToDebianRepo" Condition=" '$(OSName)' == 'ubuntu' AND '$(SkipPublishToDebianRepo)' != 'true' ">
|
||||
<Error Condition="'$(REPO_ID)' == ''" Text="REPO_ID must be set as an environment variable for debian publishing." />
|
||||
<Error Condition="'$(REPO_USER)' == ''" Text="REPO_USER 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." />
|
||||
|
||||
<Delete Files="$(DebianUploadJsonFile)" />
|
||||
<WriteLinesToFile File="$(DebianUploadJsonFile)" Lines="$(DebianUploadJsonContent)" />
|
||||
|
||||
<Exec Command="$(RepoRoot)/scripts/publish/repoapi_client.sh -addpkg $(DebianUploadJsonFile)" />
|
||||
</Target>
|
||||
</Project>
|
22
dir.props
22
dir.props
|
@ -2,6 +2,15 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<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>
|
||||
|
||||
<Import Project="build/InitRepo.props" />
|
||||
|
@ -25,17 +34,8 @@
|
|||
<Import Project="build/Stage0.props" />
|
||||
<Import Project="build/VersionBadge.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/InstallerInfo.props" />
|
||||
</Project>
|
||||
|
|
Loading…
Reference in a new issue