Skip to content

Commit b3e67a6

Browse files
committed
sync code with 7.0
1 parent 4c8d8af commit b3e67a6

File tree

3 files changed

+30
-20
lines changed

3 files changed

+30
-20
lines changed

workload/build/Samsung.NET.Sdk.Tizen.proj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ workload manifest pack containing information about the Tizen .NET workload.
1313
<DotNetPreviewVersionBand Condition=" '$(DotNetPreviewVersionBand)' == '' ">$([System.Text.RegularExpressions.Regex]::Replace($(MicrosoftDotnetSdkInternalPackageVersion), `[-+].*$`, ""))</DotNetPreviewVersionBand>
1414
</PropertyGroup>
1515

16+
<!-- Apply featured version band for net 7.0 or above -->
17+
<PropertyGroup Condition=" '$(DotNetPreviewVersionBand.StartsWith(6))' == 'False' ">
18+
<IsPreview Condition="$(MicrosoftDotnetSdkInternalPackageVersion.Contains('-preview'))">True</IsPreview>
19+
<IsPreview Condition="$(MicrosoftDotnetSdkInternalPackageVersion.Contains('-rc'))">True</IsPreview>
20+
<IsPreview Condition="$(MicrosoftDotnetSdkInternalPackageVersion.Contains('-alpha'))">True</IsPreview>
21+
<PreviewTag Condition=" '$(IsPreview)' == 'True' ">$(MicrosoftDotnetSdkInternalPackageVersion.Replace(`-`, `.`).Split(`.`)[3])</PreviewTag>
22+
<PreviewTagVersion Condition=" '$(IsPreview)' == 'True' ">$(MicrosoftDotnetSdkInternalPackageVersion.Replace(`-`, `.`).Split(`.`)[4])</PreviewTagVersion>
23+
<DotNetPreviewVersionBand Condition=" '$(IsPreview)' == 'True' ">$(DotNetPreviewVersionBand)-$(PreviewTag).$(PreviewTagVersion)</DotNetPreviewVersionBand>
24+
</PropertyGroup>
25+
1626
<PropertyGroup>
1727
<PackageId>Samsung.NET.Sdk.Tizen.Manifest-$(DotNetPreviewVersionBand)</PackageId>
1828
<Description>Tizen .NET workload manifest. Please do not reference directly.</Description>

workload/scripts/workload-install.ps1

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -72,29 +72,29 @@ function Ensure-Directory([string]$TestDir) {
7272
}
7373

7474
function Get-LatestVersion([string]$Id) {
75+
$attempts=3
76+
$sleepInSeconds=3
77+
do
78+
{
79+
try
80+
{
81+
$Response = Invoke-WebRequest -Uri https://api.nuget.org/v3-flatcontainer/$Id/index.json -UseBasicParsing | ConvertFrom-Json
82+
return $Response.versions | Select-Object -Last 1
83+
}
84+
catch {
85+
Write-Host "Id: $Id"
86+
Write-Host "An exception was caught: $($_.Exception.Message)"
87+
}
88+
89+
$attempts--
90+
if ($attempts -gt 0) { Start-Sleep $sleepInSeconds }
91+
} while ($attempts -gt 0)
92+
7593
if ($LatestVersionMap.ContainsKey($Id))
7694
{
7795
Write-Host "Return cached latest version."
7896
return $LatestVersionMap.$Id
7997
} else {
80-
$attempts=3
81-
$sleepInSeconds=3
82-
do
83-
{
84-
try
85-
{
86-
$Response = Invoke-WebRequest -Uri https://api.nuget.org/v3-flatcontainer/$Id/index.json -UseBasicParsing | ConvertFrom-Json
87-
return $Response.versions | Select-Object -Last 1
88-
}
89-
catch {
90-
Write-Host "Id: $Id"
91-
Write-Host "An exception was caught: $($_.Exception.Message)"
92-
}
93-
94-
$attempts--
95-
if ($attempts -gt 0) { Start-Sleep $sleepInSeconds }
96-
} while ($attempts -gt 0)
97-
9898
Write-Error "Wrong Id: $Id"
9999
}
100100
}

workload/scripts/workload-install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ function install_tizenworkload() {
168168

169169
# Check latest version of manifest.
170170
if [[ "$MANIFEST_VERSION" == "<latest>" ]]; then
171-
MANIFEST_VERSION=$(getLatestVersion "$MANIFEST_NAME")
171+
MANIFEST_VERSION=$(curl -s https://api.nuget.org/v3-flatcontainer/$MANIFEST_NAME/index.json | grep \" | tail -n 1 | tr -d '\r' | xargs)
172172
if [ ! "$MANIFEST_VERSION" ]; then
173-
MANIFEST_VERSION=$(curl -s https://api.nuget.org/v3-flatcontainer/$MANIFEST_NAME/index.json | grep \" | tail -n 1 | tr -d '\r' | xargs)
173+
MANIFEST_VERSION=$(getLatestVersion "$MANIFEST_NAME")
174174
if [[ -n $MANIFEST_VERSION ]]; then
175175
echo "Return cached latest version: $MANIFEST_VERSION"
176176
else

0 commit comments

Comments
 (0)