Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task: support .kiota folder in ttk integration #5612

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ export class GenerateClientCommand extends Command {
private _openApiTreeProvider: OpenApiTreeProvider;
private _context: vscode.ExtensionContext;
private _dependenciesViewProvider: DependenciesViewProvider;
private _setWorkspaceGenerationContext: (params: Partial<WorkspaceGenerationContext>) => void;
private _setWorkspaceGenerationContext: (params: Partial<WorkspaceGenerationContext>) => void;

constructor(
openApiTreeProvider: OpenApiTreeProvider,
context: vscode.ExtensionContext,
dependenciesViewProvider: DependenciesViewProvider,
setWorkspaceGenerationContext: (params: Partial<WorkspaceGenerationContext>) => void
setWorkspaceGenerationContext: (params: Partial<WorkspaceGenerationContext>) => void
) {
super();
this._openApiTreeProvider = openApiTreeProvider;
this._context = context;
this._dependenciesViewProvider = dependenciesViewProvider;
this._setWorkspaceGenerationContext = setWorkspaceGenerationContext;
this._setWorkspaceGenerationContext = setWorkspaceGenerationContext;
}

public getName(): string {
Expand Down Expand Up @@ -80,9 +80,16 @@ export class GenerateClientCommand extends Command {
);
setGenerationConfiguration(config);
const generationType = parseGenerationType(config.generationType);
const outputPath = typeof config.outputPath === "string"
? config.outputPath
: "./output";

let outputPath = "./output";
if (typeof config.outputPath === "string") {
if (deepLinkParams.source?.toLowerCase() === 'ttk') {
outputPath = path.join(config.outputPath, "appPackage");
} else {
outputPath = config.outputPath;
}
}

let manifestKey = null;
switch (config.generationType) {
case "client":
Expand Down Expand Up @@ -131,6 +138,8 @@ export class GenerateClientCommand extends Command {

const pathOfSpec = path.join(outputPath, `${outputState.clientClassName?.toLowerCase()}-openapi.yml`);
const pathPluginManifest = path.join(outputPath, `${outputState.clientClassName?.toLowerCase()}-apiplugin.json`);
const apiManifestPath = path.join(outputPath, ".kiota", API_MANIFEST_FILE);
const worksPacePath = path.join(outputPath, ".kiota", "workspace.json");
if (deepLinkParams.source?.toLowerCase() === 'ttk') {
try {
await vscode.commands.executeCommand(
Expand Down
Loading