Skip to content

Commit 48e9589

Browse files
merge: resolve conflicts with main (take Generate.ps1 from main, temp resolve tspCodeModel.json)
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
2 parents 60c655a + e5c6b09 commit 48e9589

81 files changed

Lines changed: 1478 additions & 1499 deletions

File tree

Some content is hidden

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

docs/samples/client/csharp/SampleService/main.tsp

Lines changed: 1 addition & 852 deletions
Large diffs are not rendered by default.

packages/http-client-csharp/eng/scripts/Generate.ps1

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,6 @@ if (-not $LaunchOnly) {
1919

2020
if ($null -eq $filter -or $filter -eq "Sample-TypeSpec") {
2121

22-
# TODO: Re-enable SampleService plugin generation once a compatible emitter version is published
23-
# Write-Host "Building logging plugin" -ForegroundColor Cyan
24-
# $pluginDir = Join-Path $packageRoot '..' '..' 'docs' 'samples' 'client' 'csharp' 'plugins' 'logging' 'Logging.Plugin' 'src'
25-
# Invoke "dotnet build" $pluginDir
26-
27-
# $sampleDir = Join-Path $packageRoot '..' '..' 'docs' 'samples' 'client' 'csharp' 'SampleService'
28-
29-
# Write-Host "Installing SampleTypeSpec plugins" -ForegroundColor Cyan
30-
31-
# Invoke "npm install --no-package-lock" $sampleDir
32-
33-
# Write-Host "Generating SampleTypeSpec using plugins" -ForegroundColor Cyan
34-
35-
# Invoke "npx tsp compile . --trace @typespec/http-client-csharp" $sampleDir
36-
37-
# # exit if the generation failed
38-
# if ($LASTEXITCODE -ne 0) {
39-
# exit $LASTEXITCODE
40-
# }
41-
42-
# Write-Host "Building SampleTypeSpec plugin library" -ForegroundColor Cyan
43-
# Invoke "dotnet build $sampleDir/SampleClient/src/SampleTypeSpec.csproj"
44-
45-
# # exit if the generation failed
46-
# if ($LASTEXITCODE -ne 0) {
47-
# exit $LASTEXITCODE
48-
# }
49-
5022
Write-Host "Generating SampleTypeSpec" -ForegroundColor Cyan
5123
$testProjectsLocalDir = Join-Path $packageRoot 'generator' 'TestProjects' 'Local'
5224

packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Primitives/NewProjectScaffolding.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ protected virtual string GetSolutionFileContent()
111111
{
112112
return string.Format(
113113
@"<Solution>
114-
<Project Path=""src\{0}.csproj"" />
114+
<Project Path=""src/{0}.csproj"" />
115115
</Solution>
116116
", CodeModelGenerator.Instance.Configuration.PackageName);
117117
}

packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Primitives/NewProjectScaffoldingTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,18 @@ public async Task Execute_CleansUpOldSlnxFiles()
7070
Assert.IsFalse(File.Exists(oldSlnxPath));
7171
}
7272

73+
[Test]
74+
public async Task Execute_SlnxUsesForwardSlashes()
75+
{
76+
var scaffolding = new NewProjectScaffolding();
77+
await scaffolding.Execute();
78+
79+
var slnxPath = Path.Combine(_outputDir, "TestPackage.slnx");
80+
var content = await File.ReadAllTextAsync(slnxPath);
81+
Assert.That(content, Does.Contain("src/TestPackage.csproj"));
82+
Assert.That(content, Does.Not.Contain("src\\TestPackage.csproj"));
83+
}
84+
7385
[Test]
7486
public async Task Execute_CallsWriteAdditionalFiles()
7587
{

packages/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/Generated/schema/ConfigurationSchema.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
"Clients": {
55
"type": "object",
66
"properties": {
7-
"Notebooks": {
7+
"Metrics": {
88
"type": "object",
9-
"description": "Configuration for Notebooks.",
9+
"description": "Configuration for Metrics.",
1010
"properties": {
1111
"SampleTypeSpecUrl": {
1212
"type": "string",
1313
"format": "uri",
1414
"description": "Gets or sets the SampleTypeSpecUrl."
1515
},
16-
"Notebook": {
16+
"MetricsNamespace": {
1717
"type": "string"
1818
},
1919
"Credential": {
@@ -24,16 +24,16 @@
2424
}
2525
}
2626
},
27-
"Metrics": {
27+
"Notebooks": {
2828
"type": "object",
29-
"description": "Configuration for Metrics.",
29+
"description": "Configuration for Notebooks.",
3030
"properties": {
3131
"SampleTypeSpecUrl": {
3232
"type": "string",
3333
"format": "uri",
3434
"description": "Gets or sets the SampleTypeSpecUrl."
3535
},
36-
"MetricsNamespace": {
36+
"Notebook": {
3737
"type": "string"
3838
},
3939
"Credential": {

0 commit comments

Comments
 (0)