diff options
| author | ras0219 <533828+ras0219@users.noreply.github.com> | 2021-02-09 14:35:11 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-09 14:35:11 -0800 |
| commit | 643bbc75a96a90c7496c769c880a890f00178b7c (patch) | |
| tree | 1e9856748609f90d96a8f6b22289fb0ba78596e1 /ports/aws-sdk-cpp/generateFeatures.ps1 | |
| parent | 50651b1680a8de756ee9dd6496f0b27262c87878 (diff) | |
| download | vcpkg-643bbc75a96a90c7496c769c880a890f00178b7c.tar.gz vcpkg-643bbc75a96a90c7496c769c880a890f00178b7c.zip | |
[aws-sdk-cpp] Regenerate feature list (#16149)
Diffstat (limited to 'ports/aws-sdk-cpp/generateFeatures.ps1')
| -rw-r--r-- | ports/aws-sdk-cpp/generateFeatures.ps1 | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/ports/aws-sdk-cpp/generateFeatures.ps1 b/ports/aws-sdk-cpp/generateFeatures.ps1 index 8c8b1a342..7933e327e 100644 --- a/ports/aws-sdk-cpp/generateFeatures.ps1 +++ b/ports/aws-sdk-cpp/generateFeatures.ps1 @@ -1,15 +1,18 @@ [CmdletBinding()]
param(
[Parameter(Mandatory=$true)][string]$ExtractedSources,
- [Parameter(Mandatory=$true)][string]$ControlFileIn,
- [Parameter(Mandatory=$true)][string]$ControlFile,
- [Parameter(Mandatory=$true)][string]$CMakeFragmentFile
+ [Parameter(Mandatory=$true)][string]$ManifestIn,
+ [Parameter(Mandatory=$true)][string]$ManifestOut,
+ [Parameter(Mandatory=$true)][string]$CMakeFragmentFile,
+ [Parameter(Mandatory=$false)][string]$vcpkg = "vcpkg"
)
+$ErrorActionPreference = "Stop"
+
$subfolders = Get-Item $ExtractedSources\aws-cpp-sdk-*
-$controltext = gc $ControlFileIn
-$controltext += @("# Automatically generated by generateFeatures.ps1")
+$manifest = Get-Content $ManifestIn | ConvertFrom-Json
+$manifest | Add-Member -NotePropertyName 'features' -NotePropertyValue @{}
$cmakefragmenttext = @("# Automatically generated by generateFeatures.ps1")
@@ -20,32 +23,34 @@ function GetDescription($dir, $modulename) $descs = @(Select-String -Path "$dir\CMakeLists.txt" -Pattern "`"C\+\+ SDK for the AWS [^`"]*`"")
if ($descs.count -eq 1) {
$desc = $descs[0].Matches.Value -replace "`"",""
- "Description: $desc"
+ "$desc"
}
- else { "Description: C++ SDK for the AWS $modulename service" }
+ else { "C++ SDK for the AWS $modulename service" }
}
- else { "Description: C++ SDK for the AWS $modulename service" }
+ else { "C++ SDK for the AWS $modulename service" }
}
-$subfolders | % {
- $modulename = $_.name -replace "^aws-cpp-sdk-",""
- if ($modulename -match "-tests`$") { return }
- if ($modulename -match "-sample`$") { return }
- if ($modulename -eq "core") { return }
+foreach ($subfolder in $subfolders)
+{
+ $modulename = $subfolder.name -replace "^aws-cpp-sdk-",""
+ if ($modulename -match "-tests`$") { continue }
+ if ($modulename -match "-sample`$") { continue }
+ if ($modulename -eq "core") { continue }
+
+ $lowermodulename = $modulename.ToLower()
- $controltext += @("")
- $controltext += @("Feature: $modulename")
- $controltext += @(GetDescription $_ $modulename)
+ $manifest.features.Add("$lowermodulename", @{ description=(GetDescription $subfolder $modulename) })
$cmakefragmenttext += @(
- "if(`"$modulename`" IN_LIST FEATURES)",
+ "if(`"$lowermodulename`" IN_LIST FEATURES)",
" list(APPEND BUILD_ONLY $modulename)",
"endif()"
)
}
-Write-Verbose ($controltext -join "`n")
-[IO.File]::WriteAllText($ControlFile, ($controltext -join "`n")+"`n")
+[IO.File]::WriteAllText($ManifestOut, (ConvertTo-Json -Depth 5 -InputObject $manifest))
Write-Verbose ($cmakefragmenttext -join "`n")
[IO.File]::WriteAllText($CMakeFragmentFile, ($cmakefragmenttext -join "`n") +"`n")
+
+vcpkg format-manifest --feature-flags=-manifests $ManifestOut
|
