-
Notifications
You must be signed in to change notification settings - Fork 771
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support decompiling templates with extensions that are not .json (#2201)
* Support decompile templates with extensions that are not .json * Address comment * Fix test errors * Fix an error and handle a special case * Simplify include paths * Avoid decompiling nested example templates twice
- Loading branch information
Showing
12 changed files
with
267 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 41 additions & 31 deletions
72
src/Bicep.Decompiler.IntegrationTests/Working/linkedtemplates/main.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,41 @@ | ||
param location string = resourceGroup().location | ||
|
||
@description('Base URL for the reference templates and scripts') | ||
param baseUrl string = 'https://my.base/url' | ||
|
||
var armBaseUrl = baseUrl | ||
var objectVar = { | ||
val1: 'a${location}b' | ||
} | ||
var arrayVar = [ | ||
'abc' | ||
location | ||
] | ||
|
||
module module1Deploy 'nested/module1.bicep' = { | ||
name: 'module1Deploy' | ||
params: { | ||
stringParam: location | ||
objectParam: objectVar | ||
arrayParam: arrayVar | ||
} | ||
} | ||
|
||
module module2Deploy 'nested/module2.bicep' = { | ||
name: 'module2Deploy' | ||
params: { | ||
stringParam: location | ||
objectParam: objectVar | ||
arrayParam: arrayVar | ||
} | ||
} | ||
param location string = resourceGroup().location | ||
|
||
@description('Base URL for the reference templates and scripts') | ||
param baseUrl string = 'https://my.base/url' | ||
|
||
var armBaseUrl = baseUrl | ||
var objectVar = { | ||
val1: 'a${location}b' | ||
} | ||
var arrayVar = [ | ||
'abc' | ||
location | ||
] | ||
var boolVar = true | ||
|
||
module module1Deploy 'nested/module1.bicep' = { | ||
name: 'module1Deploy' | ||
params: { | ||
stringParam: location | ||
objectParam: objectVar | ||
arrayParam: arrayVar | ||
} | ||
} | ||
|
||
module module1ArmDeploy 'nested/module1.arm.bicep' = { | ||
name: 'module1ArmDeploy' | ||
params: { | ||
stringParam: location | ||
objectParam: objectVar | ||
boolParam: boolVar | ||
} | ||
} | ||
|
||
module module2Deploy 'nested/module2.bicep' = { | ||
name: 'module2Deploy' | ||
params: { | ||
stringParam: location | ||
objectParam: objectVar | ||
arrayParam: arrayVar | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Bicep.Decompiler.IntegrationTests/Working/linkedtemplates/nested/module1.arm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"stringParam": { | ||
"type": "string" | ||
}, | ||
"objectParam": { | ||
"type": "object" | ||
}, | ||
"boolParam": { | ||
"type": "bool" | ||
} | ||
}, | ||
"variables": {}, | ||
"resources": [], | ||
"outputs": {} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/Bicep.Decompiler.IntegrationTests/Working/linkedtemplates/nested/module1.arm.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
param stringParam string | ||
param objectParam object | ||
param boolParam bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.