@@ -22,6 +22,15 @@ 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 : ' /../scripts/copy-annotations-to-csdl.ps1'
2534
2635steps :
2736
@@ -39,6 +48,23 @@ steps:
3948- template : checkout-metadata.yml
4049- template : set-user-config.yml
4150
51+ # required for TypeSpec
52+ - task : UseNode@1
53+ inputs :
54+ version : ' 22.x'
55+ checkLatest : true
56+
57+ - pwsh : ' npm install -g @typespec/compiler typescript'
58+ displayName : ' install TypeSpec and TypeScript globally'
59+
60+ - pwsh : ' npm ci'
61+ displayName : ' install TypeSpec dependencies'
62+ workingDirectory : ' $(metadataTypeSpecAnnotationsSource)'
63+
64+ - pwsh : ' tsp compile .'
65+ displayName : ' compile TypeSpec annotations'
66+ workingDirectory : ' $(metadataTypeSpecAnnotationsSource)'
67+
4268# Results in a raw metadata file written to microsoftgraph/msgraph-metadata if there are changes.
4369# An error will cancel this step if there are no changes.
4470- pwsh : ' $(scriptsDirectory)/download-diff-metadata.ps1'
@@ -70,6 +96,12 @@ steps:
7096 endpointVersion : ${{ parameters.endpoint }}
7197 displayName : ' run Typewriter to clean ${{ parameters.endpoint }} metadata'
7298
99+ - pwsh : ' . $(metadataTypeSpecAnnotationsSource)/$Env:ScriptPath -targetCsdlPath "$(Build.SourcesDirectory)/msgraph-metadata/clean_$($Env:Endpoint.Replace('' .'' , '''' ))_metadata/cleanMetadataWithDescriptions${{ parameters.endpoint }}.xml" -sourceCsdlDirectoryPath "$(metadataTypeSpecAnnotationsSource)/${{ parameters.metadataTypeSpecAnnotationsOutputDir }}"'
100+ env :
101+ ScriptPath : ${{ parameters.metadataAnnotationsCopyScriptPath }}
102+ Endpoint : ${{ parameters.endpoint }}
103+ displayName : ' copy TypeSpec annotations to cleaned metadata'
104+
73105 # # Only run if the previous step was successful
74106- pwsh : ' $(scriptsDirectory)/run-typewriter-clean-metadata.ps1'
75107 env :
@@ -85,6 +117,12 @@ steps:
85117 OutputMetadataFileName : ' cleanMetadataWithDescriptionsAndAnnotations'
86118 displayName : ' run Typewriter to clean ${{ parameters.endpoint }} metadata and keep capability annotations'
87119
120+ - pwsh : ' . $(metadataTypeSpecAnnotationsSource)/$Env:ScriptPath -targetCsdlPath "$(Build.SourcesDirectory)/msgraph-metadata/clean_$($Env:Endpoint.Replace('' .'' , '''' ))_metadata/cleanMetadataWithDescriptionsAndAnnotations${{ parameters.endpoint }}.xml" -sourceCsdlDirectoryPath "$(metadataTypeSpecAnnotationsSource)/${{ parameters.metadataTypeSpecAnnotationsOutputDir }}"'
121+ env :
122+ ScriptPath : ${{ parameters.metadataAnnotationsCopyScriptPath }}
123+ Endpoint : ${{ parameters.endpoint }}
124+ displayName : ' copy TypeSpec annotations to cleaned metadata'
125+
88126 # # Only run if the previous step was successful
89127- pwsh : ' $(scriptsDirectory)/run-typewriter-clean-metadata.ps1'
90128 env :
@@ -101,6 +139,13 @@ steps:
101139 OutputMetadataFileName : ' cleanMetadataWithDescriptionsAndAnnotationsAndErrors'
102140 displayName : ' run Typewriter to clean ${{ parameters.endpoint }} metadata and keep capability annotations and include error information'
103141
142+ - pwsh : ' . $(metadataTypeSpecAnnotationsSource)/$Env:ScriptPath -targetCsdlPath "$(Build.SourcesDirectory)/msgraph-metadata/clean_$($Env:Endpoint.Replace('' .'' , '''' ))_metadata/cleanMetadataWithDescriptionsAndAnnotationsAndErrors${{ parameters.endpoint }}.xml" -sourceCsdlDirectoryPath "$(metadataTypeSpecAnnotationsSource)/${{ parameters.metadataTypeSpecAnnotationsOutputDir }}"'
143+ env :
144+ ScriptPath : ${{ parameters.metadataAnnotationsCopyScriptPath }}
145+ Endpoint : ${{ parameters.endpoint }}
146+ displayName : ' copy TypeSpec annotations to cleaned metadata'
147+
148+
104149# publish metadata as an artifact
105150- task : CopyFiles@2
106151 inputs :
0 commit comments