mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
* seperate nuget package references to always update to latest * nit * nit comments
This commit is contained in:
@@ -196,13 +196,13 @@ export async function getSettingsFile(projectFolder: string): Promise<string | u
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the required nuget package to the project
|
* Adds the latest SQL nuget package to the project
|
||||||
* @param selectedProjectFile is the users selected project file path
|
* @param projectFolder is the folder containing the project file
|
||||||
*/
|
*/
|
||||||
export async function addSqlNugetReferenceToProjectFile(selectedProjectFile: string): Promise<void> {
|
export async function addSqlNugetReferenceToProjectFile(projectFolder: string): Promise<void> {
|
||||||
// clear the output channel prior to adding the nuget reference
|
// clear the output channel prior to adding the nuget reference
|
||||||
outputChannel.clear();
|
outputChannel.clear();
|
||||||
let addNugetCommmand = await utils.executeCommand(`dotnet add "${selectedProjectFile}" package ${constants.sqlExtensionPackageName} --prerelease`);
|
let addNugetCommmand = await utils.executeCommand(`dotnet add "${projectFolder}" package ${constants.sqlExtensionPackageName} --prerelease`);
|
||||||
outputChannel.appendLine(constants.dotnetResult(addNugetCommmand));
|
outputChannel.appendLine(constants.dotnetResult(addNugetCommmand));
|
||||||
outputChannel.show(true);
|
outputChannel.show(true);
|
||||||
TelemetryReporter.sendActionEvent(TelemetryViews.CreateAzureFunctionWithSqlBinding, TelemetryActions.addSQLNugetPackage);
|
TelemetryReporter.sendActionEvent(TelemetryViews.CreateAzureFunctionWithSqlBinding, TelemetryActions.addSQLNugetPackage);
|
||||||
@@ -477,8 +477,6 @@ export async function promptAndUpdateConnectionStringSetting(projectUri: vscode.
|
|||||||
connectionStringSettingName = selectedSetting?.label;
|
connectionStringSettingName = selectedSetting?.label;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Add sql extension package reference to project. If the reference is already there, it doesn't get added again
|
|
||||||
await addSqlNugetReferenceToProjectFile(projectUri.fsPath);
|
|
||||||
} else {
|
} else {
|
||||||
// if no AF project was found or there's more than one AF functions project in the workspace,
|
// if no AF project was found or there's more than one AF functions project in the workspace,
|
||||||
// ask for the user to input the setting name
|
// ask for the user to input the setting name
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import * as vscode from 'vscode';
|
|||||||
import * as uuid from 'uuid';
|
import * as uuid from 'uuid';
|
||||||
import * as constants from '../common/constants';
|
import * as constants from '../common/constants';
|
||||||
import * as utils from '../common/utils';
|
import * as utils from '../common/utils';
|
||||||
|
import * as path from 'path';
|
||||||
import * as azureFunctionsUtils from '../common/azureFunctionsUtils';
|
import * as azureFunctionsUtils from '../common/azureFunctionsUtils';
|
||||||
import { TelemetryActions, TelemetryReporter, TelemetryViews } from '../common/telemetry';
|
import { TelemetryActions, TelemetryReporter, TelemetryViews } from '../common/telemetry';
|
||||||
import { addSqlBinding, getAzureFunctions } from '../services/azureFunctionsService';
|
import { addSqlBinding, getAzureFunctions } from '../services/azureFunctionsService';
|
||||||
@@ -113,6 +114,13 @@ export async function launchAddSqlBindingQuickpick(uri: vscode.Uri | undefined):
|
|||||||
.withAdditionalProperties(propertyBag).send();
|
.withAdditionalProperties(propertyBag).send();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add latest sql extension package reference to project
|
||||||
|
// only add if AF project (.csproj) is found
|
||||||
|
if (projectUri?.fsPath) {
|
||||||
|
await azureFunctionsUtils.addSqlNugetReferenceToProjectFile(path.dirname(projectUri.fsPath));
|
||||||
|
}
|
||||||
|
|
||||||
exitReason = 'done';
|
exitReason = 'done';
|
||||||
TelemetryReporter.createActionEvent(TelemetryViews.SqlBindingsQuickPick, TelemetryActions.finishAddSqlBinding)
|
TelemetryReporter.createActionEvent(TelemetryViews.SqlBindingsQuickPick, TelemetryActions.finishAddSqlBinding)
|
||||||
.withAdditionalProperties(propertyBag).send();
|
.withAdditionalProperties(propertyBag).send();
|
||||||
|
|||||||
@@ -255,6 +255,10 @@ export async function createAzureFunction(node?: ITreeNodeInfo): Promise<void> {
|
|||||||
suppressCreateProjectPrompt: true,
|
suppressCreateProjectPrompt: true,
|
||||||
...(isCreateNewProject && { executeStep: connectionStringExecuteStep })
|
...(isCreateNewProject && { executeStep: connectionStringExecuteStep })
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Add latest sql extension package reference to project
|
||||||
|
await azureFunctionsUtils.addSqlNugetReferenceToProjectFile(projectFolder);
|
||||||
|
|
||||||
TelemetryReporter.createActionEvent(TelemetryViews.CreateAzureFunctionWithSqlBinding, telemetryStep)
|
TelemetryReporter.createActionEvent(TelemetryViews.CreateAzureFunctionWithSqlBinding, telemetryStep)
|
||||||
.withAdditionalProperties(propertyBag)
|
.withAdditionalProperties(propertyBag)
|
||||||
.withConnectionInfo(connectionInfo).send();
|
.withConnectionInfo(connectionInfo).send();
|
||||||
|
|||||||
Reference in New Issue
Block a user