@@ -22,6 +22,15 @@ parameters:
22
22
- name : ' cleanMetadataFileWithAnnotations'
23
23
type : string
24
24
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'
25
34
26
35
steps :
27
36
@@ -39,6 +48,23 @@ steps:
39
48
- template : checkout-metadata.yml
40
49
- template : set-user-config.yml
41
50
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
+
42
68
# Results in a raw metadata file written to microsoftgraph/msgraph-metadata if there are changes.
43
69
# An error will cancel this step if there are no changes.
44
70
- pwsh : ' $(scriptsDirectory)/download-diff-metadata.ps1'
@@ -70,6 +96,12 @@ steps:
70
96
endpointVersion : ${{ parameters.endpoint }}
71
97
displayName : ' run Typewriter to clean ${{ parameters.endpoint }} metadata'
72
98
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
+
73
105
# # Only run if the previous step was successful
74
106
- pwsh : ' $(scriptsDirectory)/run-typewriter-clean-metadata.ps1'
75
107
env :
@@ -85,6 +117,12 @@ steps:
85
117
OutputMetadataFileName : ' cleanMetadataWithDescriptionsAndAnnotations'
86
118
displayName : ' run Typewriter to clean ${{ parameters.endpoint }} metadata and keep capability annotations'
87
119
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
+
88
126
# # Only run if the previous step was successful
89
127
- pwsh : ' $(scriptsDirectory)/run-typewriter-clean-metadata.ps1'
90
128
env :
@@ -101,6 +139,13 @@ steps:
101
139
OutputMetadataFileName : ' cleanMetadataWithDescriptionsAndAnnotationsAndErrors'
102
140
displayName : ' run Typewriter to clean ${{ parameters.endpoint }} metadata and keep capability annotations and include error information'
103
141
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
+
104
149
# publish metadata as an artifact
105
150
- task : CopyFiles@2
106
151
inputs :
0 commit comments