This content is part of a third party extension that is not supported by the Cake project.
For more information about this extension see Cake.AutoRest.
Summary
Get an AutoRestRunner for controlling AutoRest
- Assembly
- Cake
.AutoRest .dll - Namespace
- Cake
.AutoRest - Containing Type
- AutoRestAliases
Syntax
public static AutoRestRunner AutoRest(this ICakeContext ctx)
Examples
Run with all the defaults:
Task("Use-Defaults")
.Does(() => {
AutoRest.Generate("./sample.json");
});
Configure using AutoRestSettings object
Task("Settings-Object")
.Does(() => {
var settings = new AutoRestSettings {
Namespace = "Cake",
Generator = CodeGenerator.AzureCSharp,
ClientName = "Cake.AutoRest",
HeaderComment = "Generated by Cake.AutoRest",
OutputDirectory = "./dist/client"
};
AutoRest.Generate("./sample.json", settings);
});
Configure using fluent interface (equivalent to above)
Task("Fluent-Interface")
.Does(() => {
AutoRest.Generate("./sample.json", settings =>
settings.UseNamespace("Cake")
.UseClientName("Cake.AutoRest")
.AddHeaderComment("Generated by Cake.AutoRest")
.WithGenerator(CodeGenerator.AzureCSharp)
.OutputToDirectory("./dist/client"));
});
Attributes
Type | Description |
---|---|
Cake |
Parameters
Name | Type | Description |
---|---|---|
ctx | ICakeContext | The script context |
Return Value
Type | Description |
---|---|
AutoRestRunner |