Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Commit 68c71d2

Browse files
author
William Li
committed
Stop produce duplicated package for VSTS build definition
Currently VSTS is producing duplicate package and they are running into each other will producing Today: Linux x64 build definition: both .deb and .tar.gz Ubuntu 16.04 build definition: both .deb and .tar.gz (ex. dotnet-sdk-2.0.0-preview3-006477-linux-x64.tar.gz, dotnet-sdk-debug-2.0.0-preview3-006477-linux-x64.tar.gz, dotnet-sdk-internal-2.0.0-preview3-006477-linux-x64.tar.gz) After this change: Linux x64: .tar.gz Ubuntu 16.04: .deb No change for windows and macOS Tested on Ubuntu with and without --linux-portable and windows
1 parent 30ef374 commit 68c71d2

File tree

6 files changed

+20
-11
lines changed

6 files changed

+20
-11
lines changed

Microsoft.DotNet.Cli.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4
5959
build\Test.targets = build\Test.targets
6060
build\Version.props = build\Version.props
6161
build\VersionBadge.props = build\VersionBadge.props
62+
build\DerivedHostMachineInfo.props = build\DerivedHostMachineInfo.props
6263
EndProjectSection
6364
EndProject
6465
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "package", "package", "{FD7D515A-D10F-4F49-B8AE-21CF7ED071AE}"

build/DerivedHostMachineInfo.props

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<Project>
2+
<PropertyGroup>
3+
<IsDebianBaseDistro Condition=" '$(HostOSName)' == 'ubuntu' OR '$(HostOSName)' == 'debian' ">true</IsDebianBaseDistro>
4+
<IsRPMBasedDistro Condition=" $(HostRid.StartsWith('rhel')) ">true</IsRPMBasedDistro>
5+
<IsLinuxDistroSpecific Condition=" ('$(IsDebianBaseDistro)' == 'true' OR '$(IsRPMBasedDistro)' == 'true') AND '$(IslinuxPortable)' != 'true' ">true</IsLinuxDistroSpecific>
6+
</PropertyGroup>
7+
</Project>

build/FileExtensions.props

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
<Project>
22
<PropertyGroup>
3-
<IsDebianBaseDistro Condition=" '$(HostOSName)' == 'ubuntu' OR '$(HostOSName)' == 'debian' ">True</IsDebianBaseDistro>
4-
<IsRPMBasedDistro Condition=" $(HostRid.StartsWith('rhel')) ">True</IsRPMBasedDistro>
5-
63
<ArchiveExtension Condition=" '$(HostOSName)' == 'win' ">.zip</ArchiveExtension>
74
<ArchiveExtension Condition=" '$(HostOSName)' != 'win' ">.tar.gz</ArchiveExtension>
85

96
<InstallerExtension Condition=" '$(HostOSName)' == 'win' ">.msi</InstallerExtension>
107
<InstallerExtension Condition=" '$(HostOSName)' == 'osx' ">.pkg</InstallerExtension>
11-
<InstallerExtension Condition=" '$(IsDebianBaseDistro)' == 'True' ">.deb</InstallerExtension>
12-
<InstallerExtension Condition=" '$(IsRPMBasedDistro)' == True ">.rpm</InstallerExtension>
8+
<InstallerExtension Condition=" '$(IsDebianBaseDistro)' == 'true' ">.deb</InstallerExtension>
9+
<InstallerExtension Condition=" '$(IsRPMBasedDistro)' == true ">.rpm</InstallerExtension>
1310

1411
<BundleExtension Condition=" '$(HostOSName)' == 'win' ">.exe</BundleExtension>
1512
<BundleExtension Condition=" '$(HostOSName)' == 'osx' ">$(InstallerExtension)</BundleExtension>
16-
<BundleExtension Condition=" '$(IsDebianBaseDistro)' == 'True' ">$(InstallerExtension)</BundleExtension>
17-
<BundleExtension Condition=" '$(IsRPMBasedDistro)' == True ">$(InstallerExtension)</BundleExtension>
13+
<BundleExtension Condition=" '$(IsDebianBaseDistro)' == 'true' ">$(InstallerExtension)</BundleExtension>
14+
<BundleExtension Condition=" '$(IsRPMBasedDistro)' == true ">$(InstallerExtension)</BundleExtension>
1815

1916
<DynamicLibPrefix>lib</DynamicLibPrefix>
2017
<DynamicLibPrefix Condition=" '$(HostOSName)' == 'win' "></DynamicLibPrefix>

build/Publish.targets

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@
2626

2727
<Target Name="GatherItemsForPattern">
2828
<ItemGroup>
29-
<ForPublishing Include="@(GeneratedInstallers)" />
30-
<ForPublishing Include="%(GenerateArchivesInputsOutputs.Outputs)" />
31-
<ForPublishing Include="$(PackagesDirectory)/Microsoft*.nupkg" Condition=" '$(PUBLISH_NUPKG_TO_AZURE_BLOB)' != '' " />
29+
<ForPublishing Include="@(GeneratedInstallers)"
30+
Condition=" '$(IslinuxPortable)' != 'true' "/>
31+
<ForPublishing Include="%(GenerateArchivesInputsOutputs.Outputs)"
32+
Condition=" '$(IsLinuxDistroSpecific)' != 'true' "/>
33+
<ForPublishing Include="$(PackagesDirectory)/Microsoft*.nupkg"
34+
Condition=" '$(PUBLISH_NUPKG_TO_AZURE_BLOB)' != '' AND '$(IsLinuxDistroSpecific)' != 'true'"/>
3235
</ItemGroup>
3336

3437
<ItemGroup>

dir.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<Import Project="build/Version.props" />
2929
<Import Project="build/Branding.props" />
3030

31+
<Import Project="build/DerivedHostMachineInfo.props" />
3132
<Import Project="build/FileExtensions.props" />
3233
<Import Project="build/InputDirectories.props" />
3334
<Import Project="build/MSBuildExtensions.props" />

run-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ while [[ $# > 0 ]]; do
104104
;;
105105
--linux-portable)
106106
LINUX_PORTABLE_INSTALL_ARGS="--runtime-id linux-x64"
107-
CUSTOM_BUILD_ARGS="/p:Rid=\"linux-x64\" /p:OSName=\"linux\""
107+
CUSTOM_BUILD_ARGS="/p:Rid=\"linux-x64\" /p:OSName=\"linux\" /p:IslinuxPortable=\"true\""
108108
args=( "${args[@]/$1}" )
109109
;;
110110
--help)

0 commit comments

Comments
 (0)