Skip to content

Commit 77e8a05

Browse files
authored
Restruct cadl ranch projects to honor its initial structure (#3066)
1 parent c8252d7 commit 77e8a05

File tree

124 files changed

+25
-29
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+25
-29
lines changed

eng/Generate.ps1

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,8 @@ function Add-TestServer-Swagger ([string]$testName, [string]$projectSuffix, [str
5555

5656
function Add-CadlRanch-Cadl([string]$testName, [string]$projectPrefix, [string]$cadlRanchProjectsDirectory) {
5757
$projectDirectory = Join-Path $cadlRanchProjectsDirectory $testName
58-
$cadlFolders = Get-ChildItem -Path $cadlRanchFilePath -Depth 2 -Directory $testName
59-
if ($cadlFolders) {
60-
$cadlFolder = $cadlFolders[0]
61-
$cadlMain = Join-Path $cadlFolder "main.cadl"
62-
Add-Cadl "$projectPrefix$testName" $projectDirectory $cadlMain "--option @azure-tools/cadl-csharp.generateConvenienceAPI=true --option @azure-tools/cadl-csharp.unreferenced-types-handling=keepAll"
63-
}
58+
$cadlMain = Join-Path $cadlRanchFilePath $testName "main.cadl"
59+
Add-Cadl "$projectPrefix$testName" $projectDirectory $cadlMain "--option @azure-tools/cadl-csharp.generateConvenienceAPI=true --option @azure-tools/cadl-csharp.unreferenced-types-handling=keepAll"
6460
}
6561

6662
$testNames =
@@ -256,17 +252,17 @@ if (!($Exclude -contains "Samples"))
256252

257253
# Cadl projects
258254
$cadlRanchProjectDirectory = Join-Path $repoRoot 'test' 'CadlRanchProjects'
259-
$cadlRanchProjectNames =
260-
'api-key',
261-
'oauth2',
262-
'property-optional',
263-
'property-types'
255+
$cadlRanchProjectPaths =
256+
'authentication/api-key',
257+
'authentication/oauth2',
258+
'models/property-optional',
259+
'models/property-types'
264260

265261
if (!($Exclude -contains "CadlRanchProjects"))
266262
{
267-
foreach ($testName in $cadlRanchProjectNames)
263+
foreach ($testPath in $cadlRanchProjectPaths)
268264
{
269-
Add-CadlRanch-Cadl $testName "cadl-" $cadlRanchProjectDirectory
265+
Add-CadlRanch-Cadl $testPath "cadl-" $cadlRanchProjectDirectory
270266
}
271267
}
272268

src/AutoRest.CSharp/Properties/launchSettings.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,21 +164,21 @@
164164
"commandName": "Project",
165165
"commandLineArgs": "--standalone $(SolutionDir)\\test\\TestProjects\\BodyAndPath-LowLevel\\Generated"
166166
},
167-
"cadl-api-key": {
167+
"cadl-authentication/api-key": {
168168
"commandName": "Project",
169-
"commandLineArgs": "--standalone $(SolutionDir)\\test\\CadlRanchProjects\\api-key\\Generated"
169+
"commandLineArgs": "--standalone $(SolutionDir)\\test\\CadlRanchProjects\\authentication\\api-key\\Generated"
170170
},
171-
"cadl-oauth2": {
171+
"cadl-authentication/oauth2": {
172172
"commandName": "Project",
173-
"commandLineArgs": "--standalone $(SolutionDir)\\test\\CadlRanchProjects\\oauth2\\Generated"
173+
"commandLineArgs": "--standalone $(SolutionDir)\\test\\CadlRanchProjects\\authentication\\oauth2\\Generated"
174174
},
175-
"cadl-property-optional": {
175+
"cadl-models/property-optional": {
176176
"commandName": "Project",
177-
"commandLineArgs": "--standalone $(SolutionDir)\\test\\CadlRanchProjects\\property-optional\\Generated"
177+
"commandLineArgs": "--standalone $(SolutionDir)\\test\\CadlRanchProjects\\models\\property-optional\\Generated"
178178
},
179-
"cadl-property-types": {
179+
"cadl-models/property-types": {
180180
"commandName": "Project",
181-
"commandLineArgs": "--standalone $(SolutionDir)\\test\\CadlRanchProjects\\property-types\\Generated"
181+
"commandLineArgs": "--standalone $(SolutionDir)\\test\\CadlRanchProjects\\models\\property-types\\Generated"
182182
},
183183
"ClientAndOperationGroup-Cadl": {
184184
"commandName": "Project",

test/CadlRanchProjects/api-key/Generated/Configuration.json renamed to test/CadlRanchProjects/authentication/api-key/Generated/Configuration.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)