Skip to content

Commit acce1e3

Browse files
authored
Update for 0.1.4-preview release (#86)
* Update for 0.1.4-preview release * cleanup * Add back submodule update
1 parent 272701b commit acce1e3

File tree

8 files changed

+66
-19
lines changed

8 files changed

+66
-19
lines changed

generated/microsoftgraph/microsoft.graph/beta/types.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,14 +1979,14 @@
19791979
"$ref": "#/0"
19801980
},
19811981
"flags": 0,
1982-
"description": "Contains the name of the field that a value is associated with."
1982+
"description": "Key."
19831983
},
19841984
"value": {
19851985
"type": {
19861986
"$ref": "#/0"
19871987
},
19881988
"flags": 0,
1989-
"description": "Contains the corresponding value for the specified key."
1989+
"description": "Value."
19901990
}
19911991
}
19921992
},

generated/microsoftgraph/microsoft.graph/beta/types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@
240240

241241
## MicrosoftGraphKeyValue
242242
### Properties
243-
* **key**: string: Contains the name of the field that a value is associated with.
244-
* **value**: string: Contains the corresponding value for the specified key.
243+
* **key**: string: Key.
244+
* **value**: string: Value.
245245

246246
## MicrosoftGraphOnPremisesProvisioningError
247247
### Properties

msgraph-metadata

pipelines/common-templates/common-steps.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ parameters:
88
default: false
99

1010
steps:
11-
- template: ./generate-types.yml
11+
# Official release takes existing generated types
12+
- ${{ if eq(parameters.Official, false) }}:
13+
- template: ./generate-types.yml
1214

1315
# Build the solution
1416
- task: DotNetCoreCLI@2
@@ -29,14 +31,14 @@ steps:
2931
displayName: "Run BinSkim - Product Binaries"
3032
inputs:
3133
InputType: Basic
32-
AnalyzeTarget: '$(ProductBinPath)/**/Microsoft.Graph.Bicep.Types.dll'
34+
AnalyzeTarget: "$(ProductBinPath)/**/Microsoft.Graph.Bicep.Types.dll"
3335
AnalyzeSymPath: "$(ProductBinPath)"
3436
AnalyzeVerbose: true
3537
AnalyzeHashes: true
3638
AnalyzeEnvironment: true
3739

3840
- ${{ if eq(parameters.Official, true) }}:
39-
- template: ./esrp/codesign.yml
41+
- template: ./esrp/codesign.yml
4042

4143
- task: DotNetCoreCLI@2
4244
displayName: "Pack Typeloader"
@@ -55,13 +57,13 @@ steps:
5557
pwsh: true
5658

5759
- ${{ if eq(parameters.Official, true) }}:
58-
- template: ./esrp/codesign-nuget.yml
60+
- template: ./esrp/codesign-nuget.yml
5961

6062
- task: CopyFiles@2
6163
displayName: "Copy Product Binaries"
6264
inputs:
6365
SourceFolder: "$(ProductBinPath)"
64-
Contents: '**/Microsoft.Graph.Bicep.Types.dll'
66+
Contents: "**/Microsoft.Graph.Bicep.Types.dll"
6567
TargetFolder: "$(Build.ArtifactStagingDirectory)/ProductBinaries"
6668

6769
- task: CopyFiles@2
@@ -70,7 +72,7 @@ steps:
7072
SourceFolder: "$(Build.SourcesDirectory)/swagger"
7173
Contents: "**"
7274
TargetFolder: "$(Build.ArtifactStagingDirectory)/swagger"
73-
75+
7476
- task: CopyFiles@2
7577
displayName: "Copy generated Dir"
7678
inputs:
@@ -79,7 +81,7 @@ steps:
7981
TargetFolder: "$(Build.ArtifactStagingDirectory)/generated"
8082

8183
- task: PublishBuildArtifacts@1
82-
displayName: 'Publish Files: $(ArtifactName)'
84+
displayName: "Publish Files: $(ArtifactName)"
8385
inputs:
84-
ArtifactName: '$(ArtifactName)'
85-
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
86+
ArtifactName: "$(ArtifactName)"
87+
PathtoPublish: "$(Build.ArtifactStagingDirectory)"

scripts/UpdateGeneratedTypes.ps1

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
<#
5+
.Synopsis
6+
Update the generated Bicep types and Swagger spec.
7+
.Description
8+
Update the generated Bicep types and Swagger spec by updating the latest msgraph metadata
9+
and running the generation scripts.
10+
#>
11+
12+
$SwaggerGenerationPrefix = "./src/swagger-generation"
13+
$GeneratorPrefix = "./src/generator"
14+
$AutoRestPrefix = "./src/autorest"
15+
16+
# Build bicep-types
17+
Write-Host "Building bicep-types"
18+
Push-Location bicep-types/src/bicep-types
19+
npm ci
20+
npm run build
21+
Pop-Location
22+
Write-Host "bicep-types successfully built"
23+
24+
# Update msgraph-metadata submodule
25+
Write-Host "Updating msgraph-metadata submodule"
26+
git submodule update --recursive --remote msgraph-metadata
27+
Write-Host "msgraph-metadata submodule successfully updated"
28+
29+
# Build auto-rest
30+
Write-Host "Building Autorest"
31+
npm ci --prefix $AutoRestPrefix
32+
npm run --prefix $AutoRestPrefix build
33+
Write-Host "Autorest successfully built"
34+
35+
# Generate Swagger spec
36+
Write-Host "Generating Swagger spec"
37+
npm ci --prefix $SwaggerGenerationPrefix
38+
npm run --prefix $SwaggerGenerationPrefix start -- --output=C:\Git\msgraph-bicep-types\swagger\specification\microsoftgraph\resource-manager\microsoftgraph\preview
39+
Write-Host "Swagger spec successfully generated"
40+
41+
# Generate Bicep types
42+
Write-Host "Generating Bicep types"
43+
npm ci --prefix $GeneratorPrefix
44+
npm run --prefix $GeneratorPrefix generate -- --specs-dir ..\..\swagger\ --single-path microsoftgraph
45+
write-Host "Bicep types successfully generated"

src/Microsoft.Graph.Bicep.Types/Microsoft.Graph.Bicep.Types.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<DelaySign>true</DelaySign>
1515
<AssemblyOriginatorKeyFile>35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
1616
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
17-
<VersionPrefix>0.1.3</VersionPrefix>
17+
<VersionPrefix>0.1.4</VersionPrefix>
1818
<VersionSuffix>preview</VersionSuffix>
1919
</PropertyGroup>
2020
<ItemGroup>

src/swagger-generation/output/microsoftgraph-beta.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,11 +1333,11 @@
13331333
"properties": {
13341334
"key": {
13351335
"type": "string",
1336-
"description": "Contains the name of the field that a value is associated with."
1336+
"description": "Key."
13371337
},
13381338
"value": {
13391339
"type": "string",
1340-
"description": "Contains the corresponding value for the specified key."
1340+
"description": "Value."
13411341
}
13421342
}
13431343
},

swagger/specification/microsoftgraph/resource-manager/microsoftgraph/preview/beta/microsoftgraph-beta.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,11 +1333,11 @@
13331333
"properties": {
13341334
"key": {
13351335
"type": "string",
1336-
"description": "Contains the name of the field that a value is associated with."
1336+
"description": "Key."
13371337
},
13381338
"value": {
13391339
"type": "string",
1340-
"description": "Contains the corresponding value for the specified key."
1340+
"description": "Value."
13411341
}
13421342
}
13431343
},

0 commit comments

Comments
 (0)