first stab at a client tsp /tspconfig scripts (#6101)
* first stab at a client tsp /tspconfig scripts * space
This commit is contained in:
parent
b5fb5b50f5
commit
4d51e6bc9a
@ -104,7 +104,12 @@ macro(GenerateCodeFromTSP TSP_DESTINATION TSP_REPO_PATH CODEGEN_DESTINATION CODE
|
||||
message("Will copy tsp generation scripts from ${SCRIPTS_FOLDER} to ${DOWNLOAD_CODEGEN_FOLDER}")
|
||||
file(COPY ${SCRIPTS_FOLDER}
|
||||
DESTINATION ${DOWNLOAD_CODEGEN_FOLDER})
|
||||
|
||||
message("Will copy ${CMAKE_CURRENT_SOURCE_DIR}/client.tsp to ${DOWNLOAD_CODEGEN_FOLDER}")
|
||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/client.tsp
|
||||
DESTINATION ${DOWNLOAD_CODEGEN_FOLDER})
|
||||
message("Will copy ${CMAKE_CURRENT_SOURCE_DIR}/tspconfig.yaml to ${DOWNLOAD_CODEGEN_FOLDER}")
|
||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/tspconfig.yaml
|
||||
DESTINATION ${DOWNLOAD_CODEGEN_FOLDER})
|
||||
#build codegen
|
||||
message("Building codegen in folder ${DOWNLOAD_CODEGEN_FOLDER}")
|
||||
execute_process(COMMAND pwsh Build-Codegen.ps1
|
||||
@ -127,5 +132,5 @@ macro(UpdateCodeFilesFromGenerated CODEGEN_DESTINATION INCLUDE_DESTINATION SOURC
|
||||
|
||||
message("Copying files from ${SOURCE_SRC} to ${SOURCE_DESTINATION}")
|
||||
file(COPY ${SOURCE_SRC} DESTINATION ${SOURCE_DESTINATION})
|
||||
|
||||
message("CMAKE_CURRENT_SOURCE_DIR = ${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
endmacro()
|
||||
|
||||
@ -7,6 +7,9 @@ param(
|
||||
[switch] $Reinstall = $false
|
||||
)
|
||||
|
||||
# install the global packages
|
||||
npm install -g @microsoft/rush typescript autorest @typespec/compiler @azure-tools/typespec-client-generator-cli @azure-tools/typespec-azure-rulesets
|
||||
|
||||
pushd
|
||||
cd ..\..\
|
||||
cd codegen.cpp
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
[CmdletBinding()]
|
||||
param()
|
||||
|
||||
Get-ChildItem -Exclude *.cpp,*.tsp,*.ps1,*.yaml,.clang-format,generated | Remove-Item -Recurse -Force
|
||||
@ -18,7 +18,7 @@ popd
|
||||
|
||||
pushd
|
||||
Write-Host "Invoking: tsp compile ."
|
||||
tsp compile --emit $typespecCppDir .
|
||||
tsp compile --emit $typespecCppDir client.tsp
|
||||
|
||||
if (-not (Test-Path ".clang-format")) {
|
||||
$oldProgressPreference = $ProgressPreference
|
||||
|
||||
7
sdk/keyvault/azure-security-keyvault-secrets/client.tsp
Normal file
7
sdk/keyvault/azure-security-keyvault-secrets/client.tsp
Normal file
@ -0,0 +1,7 @@
|
||||
// client.tsp
|
||||
import "./main.tsp";
|
||||
import "@azure-tools/typespec-client-generator-core";
|
||||
|
||||
using Azure.ClientGenerator.Core;
|
||||
|
||||
@@clientName(KeyVault, "SecretClient"); // This is the name of the client
|
||||
21
sdk/keyvault/azure-security-keyvault-secrets/tspconfig.yaml
Normal file
21
sdk/keyvault/azure-security-keyvault-secrets/tspconfig.yaml
Normal file
@ -0,0 +1,21 @@
|
||||
parameters:
|
||||
"service-dir":
|
||||
default: "sdk/keyvault"
|
||||
|
||||
emit:
|
||||
- "@azure-tools/typespec-autorest"
|
||||
|
||||
linter:
|
||||
extends:
|
||||
- "@azure-tools/typespec-azure-core/all"
|
||||
|
||||
options:
|
||||
"@azure-tools/typespec-autorest":
|
||||
azure-resource-provider-folder: "data-plane"
|
||||
emitter-output-dir: "{project-root}/.."
|
||||
examples-directory: "{project-root}/examples"
|
||||
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json"
|
||||
"@azure-tools/typespec-cpp":
|
||||
flavor: azure
|
||||
package-dir: "azure-security-keyvault-secrets"
|
||||
namespace: "Azure::Security::KeyVault::Secrets"
|
||||
Loading…
Reference in New Issue
Block a user