Skip to content

Commit

Permalink
sync code with 7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JoonghyunCho committed Dec 1, 2023
1 parent 4c8d8af commit b3e67a6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 20 deletions.
10 changes: 10 additions & 0 deletions workload/build/Samsung.NET.Sdk.Tizen.proj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ workload manifest pack containing information about the Tizen .NET workload.
<DotNetPreviewVersionBand Condition=" '$(DotNetPreviewVersionBand)' == '' ">$([System.Text.RegularExpressions.Regex]::Replace($(MicrosoftDotnetSdkInternalPackageVersion), `[-+].*$`, ""))</DotNetPreviewVersionBand>
</PropertyGroup>

<!-- Apply featured version band for net 7.0 or above -->
<PropertyGroup Condition=" '$(DotNetPreviewVersionBand.StartsWith(6))' == 'False' ">
<IsPreview Condition="$(MicrosoftDotnetSdkInternalPackageVersion.Contains('-preview'))">True</IsPreview>
<IsPreview Condition="$(MicrosoftDotnetSdkInternalPackageVersion.Contains('-rc'))">True</IsPreview>
<IsPreview Condition="$(MicrosoftDotnetSdkInternalPackageVersion.Contains('-alpha'))">True</IsPreview>
<PreviewTag Condition=" '$(IsPreview)' == 'True' ">$(MicrosoftDotnetSdkInternalPackageVersion.Replace(`-`, `.`).Split(`.`)[3])</PreviewTag>
<PreviewTagVersion Condition=" '$(IsPreview)' == 'True' ">$(MicrosoftDotnetSdkInternalPackageVersion.Replace(`-`, `.`).Split(`.`)[4])</PreviewTagVersion>
<DotNetPreviewVersionBand Condition=" '$(IsPreview)' == 'True' ">$(DotNetPreviewVersionBand)-$(PreviewTag).$(PreviewTagVersion)</DotNetPreviewVersionBand>
</PropertyGroup>

<PropertyGroup>
<PackageId>Samsung.NET.Sdk.Tizen.Manifest-$(DotNetPreviewVersionBand)</PackageId>
<Description>Tizen .NET workload manifest. Please do not reference directly.</Description>
Expand Down
36 changes: 18 additions & 18 deletions workload/scripts/workload-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -72,29 +72,29 @@ function Ensure-Directory([string]$TestDir) {
}

function Get-LatestVersion([string]$Id) {
$attempts=3
$sleepInSeconds=3
do
{
try
{
$Response = Invoke-WebRequest -Uri https://api.nuget.org/v3-flatcontainer/$Id/index.json -UseBasicParsing | ConvertFrom-Json
return $Response.versions | Select-Object -Last 1
}
catch {
Write-Host "Id: $Id"
Write-Host "An exception was caught: $($_.Exception.Message)"
}

$attempts--
if ($attempts -gt 0) { Start-Sleep $sleepInSeconds }
} while ($attempts -gt 0)

if ($LatestVersionMap.ContainsKey($Id))
{
Write-Host "Return cached latest version."
return $LatestVersionMap.$Id
} else {
$attempts=3
$sleepInSeconds=3
do
{
try
{
$Response = Invoke-WebRequest -Uri https://api.nuget.org/v3-flatcontainer/$Id/index.json -UseBasicParsing | ConvertFrom-Json
return $Response.versions | Select-Object -Last 1
}
catch {
Write-Host "Id: $Id"
Write-Host "An exception was caught: $($_.Exception.Message)"
}

$attempts--
if ($attempts -gt 0) { Start-Sleep $sleepInSeconds }
} while ($attempts -gt 0)

Write-Error "Wrong Id: $Id"
}
}
Expand Down
4 changes: 2 additions & 2 deletions workload/scripts/workload-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ function install_tizenworkload() {

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

0 comments on commit b3e67a6

Please sign in to comment.