-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #893 from christianhelle/kiota-multiple-files-output
Add support for generating multiples using Microsoft Kiota
- Loading branch information
Showing
15 changed files
with
133 additions
and
32 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
7 changes: 7 additions & 0 deletions
7
src/Core/ApiClientCodeGen.Core/Options/Kiota/DefaultKiotaOptions.cs
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,7 @@ | ||
namespace Rapicgen.Core.Options.Kiota | ||
{ | ||
public class DefaultKiotaOptions : IKiotaOptions | ||
{ | ||
public bool GenerateMultipleFiles => false; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/Core/ApiClientCodeGen.Core/Options/Kiota/IKiotaOptions.cs
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,7 @@ | ||
namespace Rapicgen.Core.Options.Kiota | ||
{ | ||
public interface IKiotaOptions | ||
{ | ||
bool GenerateMultipleFiles { get; } | ||
} | ||
} |
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
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
31 changes: 31 additions & 0 deletions
31
src/VSIX/ApiClientCodeGen.VSIX.Shared/Options/Kiota/KiotaOptions.cs
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,31 @@ | ||
using System; | ||
using Rapicgen.Core.Logging; | ||
using Rapicgen.Core.Options.Kiota; | ||
|
||
namespace Rapicgen.Options.Kiota | ||
{ | ||
public class KiotaOptions | ||
: OptionsBase<IKiotaOptions, KiotaOptionsPage>, IKiotaOptions | ||
{ | ||
public KiotaOptions(IKiotaOptions? options = null) | ||
{ | ||
try | ||
{ | ||
options ??= GetFromDialogPage(); | ||
GenerateMultipleFiles = options.GenerateMultipleFiles; | ||
} | ||
catch (Exception e) | ||
{ | ||
Logger.Instance.TrackError(e); | ||
|
||
Logger.Instance.WriteLine(Environment.NewLine); | ||
Logger.Instance.WriteLine("Error reading user options. Reverting to default values"); | ||
Logger.Instance.WriteLine("GenerateMultipleFiles = false"); | ||
|
||
GenerateMultipleFiles = false; | ||
} | ||
} | ||
|
||
public bool GenerateMultipleFiles { get; } | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/VSIX/ApiClientCodeGen.VSIX.Shared/Options/Kiota/KiotaOptionsPage.cs
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,20 @@ | ||
using System.ComponentModel; | ||
using System.Diagnostics.CodeAnalysis; | ||
using Rapicgen.Core.Options.Kiota; | ||
using Microsoft.VisualStudio.Shell; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace Rapicgen.Options.Kiota | ||
{ | ||
[ExcludeFromCodeCoverage] | ||
[ComVisible(true)] | ||
public class KiotaOptionsPage : DialogPage, IKiotaOptions | ||
{ | ||
public const string Name = "Kiota"; | ||
|
||
[Category(Name)] | ||
[DisplayName("Generate Multiple Files")] | ||
[Description("Generate multiple files for each operation. This only works for SDK style projects")] | ||
public bool GenerateMultipleFiles { get; set; } | ||
} | ||
} |
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