diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index 21d76e933..5715a6e2b 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -241,40 +241,25 @@ jobs: Write-Host "##vso[task.setvariable variable=AZURE_SDK_VERSION]$version" displayName: Create package info JSON file - # Building from the root of the repo at this point because of the - # nature of the CMake build system. The SoureDirectory should probably - # change. - - task: PowerShell@2 - inputs: - targetType: filePath - filePath: eng/scripts/New-ReleaseArtifact.ps1 - arguments: >- - -SourceDirectory ./ - -PackageSpecPath $(Build.ArtifactStagingDirectory)/packages/${{ artifact.Name }}/package-info.json - -Destination $(Build.ArtifactStagingDirectory)/packages/${{ artifact.Name }}/vcpkg - -Workspace $(Agent.TempDirectory)/vcpkg-${{ artifact.Name }} - pwsh: true - displayName: Compress publish artifact and stage for publishing - - task: Powershell@2 inputs: targetType: inline script: | # If there is no vcpkg directory skip staging the vcpkg port artifacts - if (!(Test-Path sdk/${{ parameters.ServiceDirectory }}/${{ artifact.Name }}/vcpkg/)) { + if (!(Test-Path build/vcpkg/ports/${{ artifact.VcpkgPortName }})) { + Write-Host "No vcpkg port directory at build/vcpkg/ports/${{ artifact.VcpkgPortName }}" exit } New-Item ` -ItemType Directory ` - $(Build.ArtifactStagingDirectory)/packages/${{ artifact.Name }}/vcpkg/port -Force + $(Build.ArtifactStagingDirectory)/packages/${{ artifact.Name }}/vcpkg -Force - Copy-Item ` - sdk/${{ parameters.ServiceDirectory }}/${{ artifact.Name }}/vcpkg/* ` - $(Build.ArtifactStagingDirectory)/packages/${{ artifact.Name }}/vcpkg/port ` - -Exclude README.md + Copy-Item -Recurse ` + build/vcpkg/ports/${{ artifact.VcpkgPortName }}/. ` + $(Build.ArtifactStagingDirectory)/packages/${{ artifact.Name }}/vcpkg/port pwsh: true - displayName: Copy vcpkg port template files and remove .template extension + displayName: Copy vcpkg port files from build - pwsh: | $outputPath = Join-Path -Path $(Build.ArtifactStagingDirectory) packages/${{ artifact.Name }} diff --git a/eng/pipelines/templates/stages/archetype-cpp-release.yml b/eng/pipelines/templates/stages/archetype-cpp-release.yml index 9dfef676e..1cb4a720e 100644 --- a/eng/pipelines/templates/stages/archetype-cpp-release.yml +++ b/eng/pipelines/templates/stages/archetype-cpp-release.yml @@ -86,11 +86,19 @@ stages: steps: - checkout: self + - pwsh: | + $branchName = "azure-sdk-for-cpp-${{ artifact.Name }}-$(Build.BuildId)" + if ('$(VcpkgForkBranchName)') { + Write-Host "Using queue time branch name" + $branchName = '$(VcpkgForkBranchName)' + } + Write-Host "##vso[task.setvariable variable=PrBranchName]$branchName" + displayName: Set fork branch name + - task: Powershell@2 inputs: filePath: eng/scripts/Initialize-VcpkgRelease.ps1 arguments: >- - -GitHubPat $(azuresdk-github-pat) -GitHubRepo "$(Build.Repository.Name)" -PackageSpecPath $(Pipeline.Workspace)/packages/${{artifact.Name}}/package-info.json -SourceDirectory $(Pipeline.Workspace)/packages/${{artifact.Name}}/vcpkg @@ -98,41 +106,49 @@ stages: pwsh: true displayName: Initialize vcpkg release + # There are potential race conditions if this script runs + # in parallel against the same branch name. Release only + # one package at a time. - pwsh: | + Write-Host "git clone https://github.com/microsoft/vcpkg $(Pipeline.Workspace)/vcpkg" git clone https://github.com/microsoft/vcpkg $(Pipeline.Workspace)/vcpkg if ($LASTEXITCODE -ne 0) { Write-Error "Unable to check out vcpkg repo" exit $LASTEXITCODE } + + Write-Host "cd $(Pipeline.Workspace)/vcpkg" cd $(Pipeline.Workspace)/vcpkg - # There is no need to check out a branch, the - # create-pull-request.yml template creates the branch - # Clean out the folder so that template files removed # are not inadvertently re-added - if (Test-Path "ports/${{ artifact.Name }}") { - Remove-Item -v -r "ports/${{ artifact.Name }}" + if (Test-Path "ports/${{ artifact.VcpkgPortName }}") { + Remove-Item -v -r "ports/${{ artifact.VcpkgPortName }}" } - New-Item -Type Directory ports/${{ artifact.Name }} - Copy-Item -Verbose $(Pipeline.Workspace)/packages/${{artifact.Name}}/vcpkg/port/* ports/${{ artifact.Name }} + New-Item -Type Directory ports/${{ artifact.VcpkgPortName }} + Copy-Item -Verbose $(Pipeline.Workspace)/packages/${{artifact.Name}}/vcpkg/port/* ports/${{ artifact.VcpkgPortName }} # Show artifacts copied into ports folder for PR - Get-ChildItem -Recurse ports/${{ artifact.Name }} + Get-ChildItem -Recurse ports/${{ artifact.VcpkgPortName }} + + Write-Host "git status" + git status displayName: Copy updated files into vcpkg fork for PR condition: ne(variables['SkipVcpkgUpdate'], 'true') + # This template does not need to check the + # SkipVcpkgUpdate variable, it will stop if there are no + # changes in the git repo. - template: /eng/common/pipelines/templates/steps/create-pull-request.yml parameters: RepoOwner: Microsoft RepoName: vcpkg WorkingDirectory: $(Pipeline.Workspace)/vcpkg - PrBranchName: azure-sdk-for-cpp-${{ artifact.Name }}-$(Build.BuildId) - CommitMsg: "Update port for ${{ artifact.Name }}" - PRTitle: "Update port for ${{ artifact.Name }}" + PrBranchName: $(PrBranchName) + CommitMsg: "Update port for ${{ artifact.VcpkgPortName }}" + PRTitle: "Update port for ${{ artifact.VcpkgPortName }}" BaseBranchName: master - PushArgs: -f - ${{if ne(artifact.skipUpdatePackageVersion, 'true')}}: - deployment: UpdatePackageVersion diff --git a/eng/scripts/Initialize-VcpkgRelease.ps1 b/eng/scripts/Initialize-VcpkgRelease.ps1 index 6e01f0443..e726be932 100644 --- a/eng/scripts/Initialize-VcpkgRelease.ps1 +++ b/eng/scripts/Initialize-VcpkgRelease.ps1 @@ -1,7 +1,7 @@ <# .SYNOPSIS -Uploads the release asset and mutates files in $SourceDirectory/port to point to -the uploaded GitHub release asset. +Downloads the release asset and mutates the portfile.cmake file to use the +SHA512 hash of the release asset. .PARAMETER SourceDirectory Location of vcpkg assets (usually `/packages//vcpkg`) @@ -9,9 +9,6 @@ Location of vcpkg assets (usually `/packages//vcpkg .PARAMETER PackageSpecPath Location of the relevant package-info.json file -.PARAMETER GitHubPat -PAT for uploading asset to GitHub release and creating PR - .PARAMETER GitHubRepo Name of the GitHub repo (of the form Azure/azure-sdk-for-cpp) @@ -26,10 +23,6 @@ param ( [ValidateNotNullOrEmpty()] [string] $PackageSpecPath, - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [string] $GitHubPat, - [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $GitHubRepo @@ -38,29 +31,29 @@ param ( # If there's nothing in the "port" folder to upload set SkipVcpkgUpdate to true # and exit. Other steps will check SkipVcpkgUpdate to decide whether to move # forward. -if (!(Get-ChildItem -Path "$SourceDirectory/port")) { +if (!(Get-ChildItem -Path "$SourceDirectory/port/CONTROL")) { Write-Host "###vso[task.setvariable variable=SkipVcpkgUpdate]true" exit } $packageSpec = Get-Content -Raw -Path $PackageSpecPath | ConvertFrom-Json -$assetFilename = "$($packageSpec.packageName).tar.gz" +$tarGzUri = "https://github.com/$GitHubRepo/archive/$($packageSpec.packageName).tar.gz" -# Upload the asset to the release -Write-Verbose "Uploading asset: $assetFilename..." -$assetInfo = & $PSScriptRoot/../common/scripts/New-ReleaseAsset.ps1 ` - -ReleaseTag $packageSpec.packageName ` - -AssetPath $SourceDirectory/$assetFilename ` - -GitHubRepo $GitHubRepo ` - -GitHubPat $GitHubPat +Write-Host "Downloading tarball to compute hash from $tarGzUri" +$localTarGzPath = New-TemporaryFile +Invoke-WebRequest -Uri $tarGzUri -OutFile $localTarGzPath -$sha512 = (Get-FileHash -Path "$SourceDirectory/$assetFilename" -Algorithm SHA512).Hash +$sha512 = (Get-FileHash -Path $localTarGzPath -Algorithm SHA512).Hash.ToLower() +Write-Host "SHA512: $sha512" -Write-Verbose "Mutating files with release info and creating PR" -# Use asset URL to fill in vcpkg port tokens -& $PSScriptRoot/New-VcpkgPortDefinition.ps1 ` - -SourceDirectory "$SourceDirectory/port" ` - -Version $packageSpec.Version ` - -Url $assetInfo.browser_download_url ` - -Filename $assetFilename ` - -Sha512 $sha512 +Write-Verbose "Writing the SHA512 hash" +$portfileLocation = "$SourceDirectory/port/portfile.cmake" + +# Regex replace SHA512 preserving spaces. The placeholder "SHA512 1" is +# recommended in vcpkg documentation +# Before: " SHA512 1" +# After: " SHA512 f6cf1c16c52" +$newContent = Get-Content -Raw -Path $portfileLocation ` + | ForEach-Object { $_ -replace '(SHA512\s+)1', "`${1}$sha512" } + +$newContent | Set-Content $portfileLocation diff --git a/eng/scripts/Language-Settings.ps1 b/eng/scripts/Language-Settings.ps1 index 616c1094e..f05e2c125 100644 --- a/eng/scripts/Language-Settings.ps1 +++ b/eng/scripts/Language-Settings.ps1 @@ -4,7 +4,15 @@ $packagePattern = "*.json" $MetadataUri = "https://raw.githubusercontent.com/Azure/azure-sdk/master/_data/releases/latest/cpp-packages.csv" $BlobStorageUrl = "https://azuresdkdocs.blob.core.windows.net/%24web?restype=container&comp=list&prefix=cpp%2F&delimiter=%2F" -# Parse out package publishing information given a nupkg ZIP format. + + +function Get-cpp-PackageInfoFromRepo($pkgPath, $serviceDirectory, $pkgName) +{ + $packageVersion = & $PSScriptRoot/Get-PkgVersion.ps1 -ServiceDirectory $serviceDirectory -PackageName $pkgName + return [PackageProps]::new($pkgName, $packageVersion, $pkgPath, $serviceDirectory) +} + +# Parse out package publishing information from a package-info.json file. function Get-cpp-PackageInfoFromPackageFile($pkg, $workingDirectory) { $packageInfo = Get-Content -Raw -Path $pkg | ConvertFrom-Json diff --git a/eng/scripts/New-ReleaseArtifact.ps1 b/eng/scripts/New-ReleaseArtifact.ps1 deleted file mode 100644 index 8ec174ce5..000000000 --- a/eng/scripts/New-ReleaseArtifact.ps1 +++ /dev/null @@ -1,85 +0,0 @@ -<# -.SYNOPSIS -Creates a .tar.gz archive of files in a given folder. - -.DESCRIPTION -This is supposed to help zip up any location where artifacts are properly staged -for placement in an archive. It does this by reading in the package information -from the package.json file, then creating an archive named for the package and -version, and copying the package to an artifact location. - -.PARAMETER SourceDirectory -Source directory to compress. Files and folders in that source directory -(except .git) will be compressed. - -.PARAMETER PackageSpecPath -Location of the package.json file. - -.PARAMETER Destination -Location to copy the artifact file to. - -.PARAMETER Destination -Name of the destination to which the archive should be copied. - -.PARAMETER Workspace -Workspace folder where assets are staged before creating. - -#> - - -param ( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [string] $SourceDirectory, - - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [string] $PackageSpecPath, - - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [string] $Destination, - - [Parameter()] - [ValidateNotNullOrEmpty()] - [string] $Workspace = "$env:TEMP/vcpkg-workspace" -) - -$initialLocation = Get-Location - -try { - $packageSpec = Get-Content -Raw -Path $PackageSpecPath | ConvertFrom-Json - $archiveName = $packageSpec.packageName - - Write-Verbose "Archive Name: $archiveName" - - # Set up workspace, copy source to workspace - Remove-Item -Path $Workspace -Force -Recurse -ErrorAction Ignore - New-Item -ItemType directory -Path "$Workspace/$archiveName" -Force - Copy-Item ` - -Path $SourceDirectory/* ` - -Destination "$Workspace/$archiveName/" ` - -Recurse ` - -Exclude ".git" - - # Move outside of workspace so the archive root contains a folder named - # after the package and its contents are the package contents. For example: - # azure-template-1.2.3/ - # CMakeLists.txt - # ... - Set-Location $Workspace - - # Create the tar.gz file - tar -cvz --exclude .git -f "$archiveName.tar.gz" $archiveName - - New-Item -ItemType Directory $Destination -Force - - # Copy release archive to the appropriate destination location - Copy-Item ` - -Path "$archiveName.tar.gz" ` - -Destination $Destination ` - -Verbose - -} finally { - Set-Location $initialLocation -} diff --git a/eng/scripts/New-VcpkgPortDefinition.ps1 b/eng/scripts/New-VcpkgPortDefinition.ps1 deleted file mode 100644 index cdde8e81a..000000000 --- a/eng/scripts/New-VcpkgPortDefinition.ps1 +++ /dev/null @@ -1,61 +0,0 @@ -<# -.SYNOPSIS -Replaces token content in each file of the SourceDirectory (assumes no subfolders) - -.PARAMETER SourceDirectory -Location of vcpkg port files -(usually `/packages//vcpkg/port`) - -.PARAMETER Version -Replaces %VERSION% token in files with the value of this parameter - -.PARAMETER Url -Replaces %URL% token in files with the value of this parameter - -.PARAMETER Filename -Replaces %FILENAME% token in files with the value of this parameter - -.PARAMETER Sha512 -Replaces %SHA512% token in files with the value of this parameter - -#> - - -param ( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [string] $SourceDirectory, - - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [string] $Version, - - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [string] $Url, - - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [string] $Filename, - - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [string] $Sha512 -) - -$files = Get-ChildItem -Path $SourceDirectory -Include *.template -Recurse - -Write-Host $files - -foreach ($file in $files) { - Write-Host "Updating file contents: $file" - $content = Get-Content -Raw -Path $file - $newContent = $content ` - -replace '%VERSION%', $Version ` - -replace '%URL%', $Url ` - -replace '%FILENAME%', $Filename ` - -replace '%SHA512%', $Sha512 - - $newContent | Set-Content $file - $file | Rename-Item -NewName { $_.Name -replace '.template', '' } -} diff --git a/eng/scripts/Update-PkgVersion.ps1 b/eng/scripts/Update-PkgVersion.ps1 index 1818fc166..11421cb7e 100644 --- a/eng/scripts/Update-PkgVersion.ps1 +++ b/eng/scripts/Update-PkgVersion.ps1 @@ -40,7 +40,7 @@ function Update-Version( [AzureEngSemanticVersion]$SemVer, $VersionHppLocation, $Unreleased=$True, - $ReplaceVersion=$False) + $ReplaceLatestEntryTitle=$False) { Write-Verbose "New Version: $SemVer" if ($SemVer.HasValidPrereleaseLabel() -ne $true){ @@ -57,15 +57,15 @@ function Update-Version( $newContent = $versionHppContent -replace $VersionRegex, "`${1}$($SemVer.Major)`${2}$($SemVer.Minor)`${3}$($SemVer.Patch)`${4}`"`"" } - $newContent | Set-Content $VersionHppLocation + $newContent | Set-Content $VersionHppLocation -NoNewline # Set Version in ChangeLog file - $ChangelogPath = Join-Path $RepoRoot "sdk" $ServiceDirectory $PackageName "CHANGELOG.md" - & "${RepoRoot}/eng/common/Update-Change-Log.ps1" ` + & "${RepoRoot}/eng/common/scripts/Update-ChangeLog.ps1" ` -Version $SemVer.ToString() ` - -ChangeLogPath $ChangelogPath ` + -ServiceDirectory $ServiceDirectory ` + -PackageName $PackageName ` -Unreleased $Unreleased ` - -ReplaceVersion $ReplaceVersion + -ReplaceLatestEntryTitle $ReplaceLatestEntryTitle } $versionHppLocation = Get-VersionHppLocaiton ` @@ -94,6 +94,6 @@ else -SemVer $SemVer ` -VersionHppLocation $versionHppLocation ` -Unreleased $False ` - -ReplaceVersion $True + -ReplaceLatestEntryTitle $True } diff --git a/sdk/core/azure-core/vcpkg/README.md b/sdk/core/azure-core/vcpkg/README.md new file mode 100644 index 000000000..75c513be1 --- /dev/null +++ b/sdk/core/azure-core/vcpkg/README.md @@ -0,0 +1,4 @@ +# Vcpkg Publish Automation Assets + +These files are used by the engineering system to publish to vcpkg. They are not +required to build the library. \ No newline at end of file diff --git a/sdk/core/ci.yml b/sdk/core/ci.yml index 23bf082c0..f74770b27 100644 --- a/sdk/core/ci.yml +++ b/sdk/core/ci.yml @@ -35,3 +35,4 @@ stages: Artifacts: - Name: azure-core Path: azure-core + VcpkgPortName: azure-core-cpp diff --git a/sdk/identity/azure-identity/vcpkg/README.md b/sdk/identity/azure-identity/vcpkg/README.md new file mode 100644 index 000000000..75c513be1 --- /dev/null +++ b/sdk/identity/azure-identity/vcpkg/README.md @@ -0,0 +1,4 @@ +# Vcpkg Publish Automation Assets + +These files are used by the engineering system to publish to vcpkg. They are not +required to build the library. \ No newline at end of file diff --git a/sdk/identity/ci.yml b/sdk/identity/ci.yml index fb60f8b24..a693e1b90 100644 --- a/sdk/identity/ci.yml +++ b/sdk/identity/ci.yml @@ -36,3 +36,4 @@ stages: Artifacts: - Name: azure-identity Path: azure-identity + VcpkgPortName: azure-identity-cpp diff --git a/sdk/storage/azure-storage-blobs/vcpkg/README.md b/sdk/storage/azure-storage-blobs/vcpkg/README.md new file mode 100644 index 000000000..75c513be1 --- /dev/null +++ b/sdk/storage/azure-storage-blobs/vcpkg/README.md @@ -0,0 +1,4 @@ +# Vcpkg Publish Automation Assets + +These files are used by the engineering system to publish to vcpkg. They are not +required to build the library. \ No newline at end of file diff --git a/sdk/storage/azure-storage-common/vcpkg/README.md b/sdk/storage/azure-storage-common/vcpkg/README.md new file mode 100644 index 000000000..75c513be1 --- /dev/null +++ b/sdk/storage/azure-storage-common/vcpkg/README.md @@ -0,0 +1,4 @@ +# Vcpkg Publish Automation Assets + +These files are used by the engineering system to publish to vcpkg. They are not +required to build the library. \ No newline at end of file diff --git a/sdk/storage/azure-storage-files-datalake/vcpkg/README.md b/sdk/storage/azure-storage-files-datalake/vcpkg/README.md new file mode 100644 index 000000000..75c513be1 --- /dev/null +++ b/sdk/storage/azure-storage-files-datalake/vcpkg/README.md @@ -0,0 +1,4 @@ +# Vcpkg Publish Automation Assets + +These files are used by the engineering system to publish to vcpkg. They are not +required to build the library. \ No newline at end of file diff --git a/sdk/storage/azure-storage-files-shares/vcpkg/README.md b/sdk/storage/azure-storage-files-shares/vcpkg/README.md new file mode 100644 index 000000000..75c513be1 --- /dev/null +++ b/sdk/storage/azure-storage-files-shares/vcpkg/README.md @@ -0,0 +1,4 @@ +# Vcpkg Publish Automation Assets + +These files are used by the engineering system to publish to vcpkg. They are not +required to build the library. \ No newline at end of file diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 30683250b..4635b66da 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -43,9 +43,13 @@ stages: Artifacts: - Name: azure-storage-common Path: azure-storage-common + VcpkgPortName: azure-storage-common-cpp - Name: azure-storage-blobs Path: azure-storage-blobs + VcpkgPortName: azure-storage-blobs-cpp - Name: azure-storage-files-datalake Path: azure-storage-files-datalake + VcpkgPortName: azure-storage-files-datalake-cpp - Name: azure-storage-files-shares Path: azure-storage-files-shares + VcpkgPortName: azure-storage-files-shares-cpp diff --git a/sdk/template/azure-template/CHANGELOG.md b/sdk/template/azure-template/CHANGELOG.md index 37387818f..81f44e16d 100644 --- a/sdk/template/azure-template/CHANGELOG.md +++ b/sdk/template/azure-template/CHANGELOG.md @@ -1,6 +1,76 @@ # Release History -## 1.0.0-beta.8 (Unreleased) +## 1.0.0-beta.25 (2020-01-12) + +* Validate vcpkg publishing automation (part 20) + +## 1.0.0-beta.24 (2020-01-11) + +* Validate vcpkg publishing automation (part 19) + +## 1.0.0-beta.23 (2020-01-11) + +* Validate vcpkg publishing automation (part 18) + +## 1.0.0-beta.22 (2020-01-08) + +* Validate vcpkg publishing automation (part 17) + +## 1.0.0-beta.21 (2020-01-08) + +* Validate vcpkg publishing automation (part 17) + +## 1.0.0-beta.20 (2020-01-08) + + +* Validate vcpkg publishing automation (part 16) + +## 1.0.0-beta.19 (2020-01-08) + +* Validate vcpkg publishing automation (part 15) + +## 1.0.0-beta.18 (2021-01-08) + +* Validate vcpkg publishing automation (part 14) + + +## 1.0.0-beta.17 (2021-01-08) + +* Validate vcpkg publishing automation (part 13) + +## 1.0.0-beta.16 (2021-01-07) + +* Validate vcpkg publishing automation (part 13) +## 1.0.0-beta.15 (2021-01-07) + +* Validate vcpkg publishing automation (part 12) + +## 1.0.0-beta.14 (2021-01-07) + +* Validate vcpkg publishing automation (part 11) +## 1.0.0-beta.13 (2021-01-07) + +* Validate vcpkg publishing automation (part 10) + +## 1.0.0-beta.12 (2021-01-07) + +* Validate vcpkg publishing automation (part 9) + +## 1.0.0-beta.11 (2021-01-07) + +* Validate vcpkg publishing automation (part 8) + +## 1.0.0-beta.10 (2021-01-07) + +* Validate vcpkg publishing automation (part 7) + +## 1.0.0-beta.9 (2021-01-07) + +* Validate vcpkg publishing automation (part 6) + +## 1.0.0-beta.8 (2021-01-07) + +* Validate vcpkg publishing automation ## 1.0.0-beta.7 (2020-09-15) diff --git a/sdk/template/azure-template/CMakeLists.txt b/sdk/template/azure-template/CMakeLists.txt index 12618600e..89347caf7 100644 --- a/sdk/template/azure-template/CMakeLists.txt +++ b/sdk/template/azure-template/CMakeLists.txt @@ -19,12 +19,13 @@ include(global_compile_options) az_vcpkg_integrate() -if(NOT AZ_ALL_LIBRARIES) - find_package(azure-core-cpp CONFIG QUIET) - if(NOT azure-core-cpp_FOUND) - find_package(azure-core-cpp REQUIRED) - endif() -endif() +# Disable dependency on azure-core until azure-core has released to vcpkg +# if(NOT AZ_ALL_LIBRARIES) +# find_package(azure-core-cpp CONFIG QUIET) +# if(NOT azure-core-cpp_FOUND) +# find_package(azure-core-cpp REQUIRED) +# endif() +# endif() set( AZURE_TEMPLATE_HEADER @@ -46,10 +47,12 @@ target_include_directories( PUBLIC $ $ - ${azure-core-cpp_INCLUDE_DIRS} + # Disable dependency on azure-core until azure-core has released to vcpkg + # ${azure-core-cpp_INCLUDE_DIRS} ) -target_link_libraries(azure-template PUBLIC Azure::azure-core) +# Disable dependency on azure-core until azure-core has released to vcpkg +# target_link_libraries(azure-template PUBLIC Azure::azure-core) # make sure that users can consume the project as a library. add_library(Azure::azure-template ALIAS azure-template) diff --git a/sdk/template/azure-template/inc/azure/template/version.hpp b/sdk/template/azure-template/inc/azure/template/version.hpp index 2763c660e..59afbc16a 100644 --- a/sdk/template/azure-template/inc/azure/template/version.hpp +++ b/sdk/template/azure-template/inc/azure/template/version.hpp @@ -8,7 +8,7 @@ #define AZURE_TEMPLATE_VERSION_MAJOR 1 #define AZURE_TEMPLATE_VERSION_MINOR 0 #define AZURE_TEMPLATE_VERSION_PATCH 0 -#define AZURE_TEMPLATE_VERSION_PRERELEASE "beta.8" +#define AZURE_TEMPLATE_VERSION_PRERELEASE "beta.25" namespace Azure { namespace Template { namespace Details { diff --git a/sdk/template/azure-template/vcpkg/CONTROL b/sdk/template/azure-template/vcpkg/CONTROL index 1867b24e2..17f3dbd26 100644 --- a/sdk/template/azure-template/vcpkg/CONTROL +++ b/sdk/template/azure-template/vcpkg/CONTROL @@ -3,7 +3,6 @@ # Source: azure-template-cpp Version: @AZ_LIBRARY_VERSION@ -Build-Depends: azure-core-cpp Description: Microsoft Azure Template SDK for C++ This is a template library meant to illustrate initial client library development process for Azure SDK. It is not meant to be published to vcpkg. diff --git a/sdk/template/azure-template/vcpkg/CONTROL.template b/sdk/template/azure-template/vcpkg/CONTROL.template deleted file mode 100644 index 6efbbad1e..000000000 --- a/sdk/template/azure-template/vcpkg/CONTROL.template +++ /dev/null @@ -1,4 +0,0 @@ -Source: azure-template -Version: %VERSION% -Homepage: https://github.com/Azure/azure-sdk-for-cpp/tree/master/sdk/template/azure-template -Description: Azure C++ SDK Template diff --git a/sdk/template/azure-template/vcpkg/portfile.cmake.template b/sdk/template/azure-template/vcpkg/portfile.cmake.template deleted file mode 100644 index 3564e626b..000000000 --- a/sdk/template/azure-template/vcpkg/portfile.cmake.template +++ /dev/null @@ -1,80 +0,0 @@ -# Common Ambient Variables: -# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} -# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} -# CURRENT_PORT_DIR = ${VCPKG_ROOT_DIR}\ports\${PORT} -# CURRENT_INSTALLED_DIR = ${VCPKG_ROOT_DIR}\installed\${TRIPLET} -# DOWNLOADS = ${VCPKG_ROOT_DIR}\downloads -# PORT = current port name (zlib, etc) -# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc) -# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic) -# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic) -# VCPKG_ROOT_DIR = -# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm) -# VCPKG_TOOLCHAIN = ON OFF -# TRIPLET_SYSTEM_ARCH = arm x86 x64 -# BUILD_ARCH = "Win32" "x64" "ARM" -# MSBUILD_PLATFORM = "Win32"/"x64"/${TRIPLET_SYSTEM_ARCH} -# DEBUG_CONFIG = "Debug Static" "Debug Dll" -# RELEASE_CONFIG = "Release Static"" "Release DLL" -# VCPKG_TARGET_IS_WINDOWS -# VCPKG_TARGET_IS_UWP -# VCPKG_TARGET_IS_LINUX -# VCPKG_TARGET_IS_OSX -# VCPKG_TARGET_IS_FREEBSD -# VCPKG_TARGET_IS_ANDROID -# VCPKG_TARGET_IS_MINGW -# VCPKG_TARGET_EXECUTABLE_SUFFIX -# VCPKG_TARGET_STATIC_LIBRARY_SUFFIX -# VCPKG_TARGET_SHARED_LIBRARY_SUFFIX -# -# See additional helpful variables in /docs/maintainers/vcpkg_common_definitions.md - -# # Specifies if the port install should fail immediately given a condition -# vcpkg_fail_port_install(MESSAGE "azure-template currently only supports Linux and Mac platforms" ON_TARGET "Windows") - -vcpkg_download_distfile(ARCHIVE - URLS "%URL%" - FILENAME "%FILENAME%" - SHA512 %SHA512% -) - -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - # (Optional) A friendly name to use instead of the filename of the archive (e.g.: a version number or tag). - # REF 1.0.0 - # (Optional) Read the docs for how to generate patches at: - # https://github.com/Microsoft/vcpkg/blob/master/docs/examples/patching.md - # PATCHES - # 001_port_fixes.patch - # 002_more_port_fixes.patch -) - -# # Check if one or more features are a part of a package installation. -# # See /docs/maintainers/vcpkg_check_features.md for more details -# vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS -# FEATURES # <- Keyword FEATURES is required because INVERTED_FEATURES are being used -# tbb WITH_TBB -# INVERTED_FEATURES -# tbb ROCKSDB_IGNORE_PACKAGE_TBB -# ) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA # Disable this option if project cannot be built with Ninja - OPTIONS -DWARNINGS_AS_ERRORS=OFF - # OPTIONS_RELEASE -DOPTIMIZE=1 - # OPTIONS_DEBUG -DDEBUGGABLE=1 -) - -vcpkg_install_cmake() - -# # Moves all .cmake files from /debug/share/azure-template/ to /share/azure-template/ -# # See /docs/maintainers/vcpkg_fixup_cmake_targets.md for more details -# vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/azure-template) - -# # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/azure-template RENAME copyright) - -# # Post-build test for cmake libraries -# vcpkg_test_cmake(PACKAGE_NAME azure-template) diff --git a/sdk/template/ci.yml b/sdk/template/ci.yml index 09aa05410..f1a34b7c0 100644 --- a/sdk/template/ci.yml +++ b/sdk/template/ci.yml @@ -37,3 +37,4 @@ stages: Artifacts: - Name: azure-template Path: azure-template + VcpkgPortName: azure-template-cpp