@@ -22,6 +22,18 @@ parameters:
2222- name : ' cleanMetadataFileWithAnnotations'
2323 type : string
2424 default : $(cleanMetadataFileWithAnnotationsV1)
25+ - name : ' metadataTypeSpecAnnotationsSource'
26+ type : string
27+ default : $(metadataTypeSpecAnnotationsSource)
28+ - name : ' metadataTypeSpecAnnotationsOutputDir'
29+ type : string
30+ default : ' tsp-output'
31+ - name : metadataAnnotationsCopyScriptPath
32+ type : string
33+ default : ' $(metadataTypeSpecAnnotationsSource)/../scripts/copy-annotations-to-csdl.ps1'
34+
35+ variables :
36+ sanitizedEndpoint : $[replace(parameters['endpoint'], '/', ''))]
2537
2638steps :
2739
@@ -57,6 +69,23 @@ steps:
5769 parameters :
5870 version : ' 8.x'
5971
72+ # required for TypeSpec
73+ - task : UseNode@1
74+ inputs :
75+ versionSpec : ' 22.x'
76+ checkLatest : true
77+
78+ - pwsh : ' npm install -g @typespec/compiler typescript'
79+ displayName : ' install TypeSpec and TypeScript globally'
80+
81+ - pwsh : ' npm ci'
82+ displayName : ' install TypeSpec dependencies'
83+ workingDirectory : ' $(metadataTypeSpecAnnotationsSource)'
84+
85+ - pwsh : ' tsc compile .'
86+ displayName : ' compile TypeSpec annotations'
87+ workingDirectory : ' $(metadataTypeSpecAnnotationsSource)'
88+
6089# # Only run if the previous step was successful
6190- pwsh : ' $(scriptsDirectory)/run-typewriter-clean-metadata.ps1'
6291 env :
7099 endpointVersion : ${{ parameters.endpoint }}
71100 displayName : ' run Typewriter to clean ${{ parameters.endpoint }} metadata'
72101
102+ - pwsh : ' $(metadataAnnotationsCopyScriptPath) -targetCsdlPath "$(Build.SourcesDirectory)/msgraph-metadata/clean_$(sanitizedEndpoint)_metadata/cleanMetadataWithDescriptions${{ parameters.endpoint }}.xml" -sourceCsdlDirectoryPath "$(metadataTypeSpecAnnotationsSource)/$(metadataTypeSpecAnnotationsOutputDir)"'
103+
73104 # # Only run if the previous step was successful
74105- pwsh : ' $(scriptsDirectory)/run-typewriter-clean-metadata.ps1'
75106 env :
@@ -85,6 +116,8 @@ steps:
85116 OutputMetadataFileName : ' cleanMetadataWithDescriptionsAndAnnotations'
86117 displayName : ' run Typewriter to clean ${{ parameters.endpoint }} metadata and keep capability annotations'
87118
119+ - pwsh : ' $(metadataAnnotationsCopyScriptPath) -targetCsdlPath "$(Build.SourcesDirectory)/msgraph-metadata/clean_$(sanitizedEndpoint)_metadata/cleanMetadataWithDescriptionsAndAnnotations${{ parameters.endpoint }}.xml" -sourceCsdlDirectoryPath "$(metadataTypeSpecAnnotationsSource)/$(metadataTypeSpecAnnotationsOutputDir)"'
120+
88121 # # Only run if the previous step was successful
89122- pwsh : ' $(scriptsDirectory)/run-typewriter-clean-metadata.ps1'
90123 env :
@@ -101,6 +134,9 @@ steps:
101134 OutputMetadataFileName : ' cleanMetadataWithDescriptionsAndAnnotationsAndErrors'
102135 displayName : ' run Typewriter to clean ${{ parameters.endpoint }} metadata and keep capability annotations and include error information'
103136
137+ - pwsh : ' $(metadataAnnotationsCopyScriptPath) -targetCsdlPath "$(Build.SourcesDirectory)/msgraph-metadata/clean_$(sanitizedEndpoint)_metadata/cleanMetadataWithDescriptionsAndAnnotationsAndErrors${{ parameters.endpoint }}.xml" -sourceCsdlDirectoryPath "$(metadataTypeSpecAnnotationsSource)/$(metadataTypeSpecAnnotationsOutputDir)"'
138+
139+
104140# publish metadata as an artifact
105141- task : CopyFiles@2
106142 inputs :
0 commit comments