Got basic file writing working.

This commit is contained in:
Michael Yanni 2019-09-16 11:29:40 -07:00
Родитель c3ae27f4eb
Коммит 689ae03ddf
5 изменённых файлов: 45 добавлений и 7 удалений

4
package-lock.json сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,4 @@
{
"name": "@autorest/csharp-v3",
"lockfileVersion": 1
}

Просмотреть файл

@ -6,4 +6,4 @@
"scripts": {
"start": "dotnet ./bin/AutoRest.CSharp.V3.dll --server"
}
}
}

Просмотреть файл

@ -3,16 +3,34 @@
## Configuration
```yaml
clear-output-folder: false
azure-track2-csharp: true
use-extension:
"@autorest/remodeler" : "~2.0.4"
pipeline:
remodeler:
input: openapi-document/multi-api/identity
csharp-v3:
input: remodeler
csharp-v3/emitter:
input: csharp-v3
scope: output-info
output-artifact:
- source-file-csharp
output-info:
output-artifact: source-file-csharp
# emitter:
# input: csharp-v3
# scope: output-info
# # output-artifact: source-file-csharp
# output-info:
# # is-object: false
# output-artifact: source-file-csharp
# # output-artifact:
# # - source-file-csharp
# # - source-file-csproj
# # - source-file-powershell
# # - source-file-other
# # - binary-file
# # - preserved-files
```

Просмотреть файл

@ -18,6 +18,22 @@ namespace AutoRest.CSharp.V3
}
var codeModel = await ReadFile(files.First());
var file = new Message
{
Channel = "file",
Details = new
{
content = codeModel,
type = "source-file-csharp",
uri = "CodeModel.yaml"
},
//Text = codeModel,
//Key = new[] { "source-file-csharp", "CodeModel.yaml" }
};
//Message(new Message {Text = codeModel, Channel = "fatal"});
Message(file);
//WriteFile("CodeModel.yaml", codeModel, null);
//Console.WriteLine("Got here");
return true;
}
}

Просмотреть файл

@ -15,7 +15,7 @@ namespace AutoRest.CSharp.V3
return 1;
}
using var connection = new Connection(Console.OpenStandardOutput(), Console.OpenStandardInput());
var connection = new Connection(Console.OpenStandardOutput(), Console.OpenStandardInput());
connection.Dispatch<IEnumerable<string>>("GetPluginNames", async () => new[] { "csharp-v3" });
connection.Dispatch<string, string, bool>("Process", (plugin, sessionId) => new Dispatcher(connection, plugin, sessionId).Process());
connection.DispatchNotification("Shutdown", connection.Stop);