Skip to content

Commit c9b4ec6

Browse files
authored
Merge pull request #2932 from jmyersmsft/users/jmyers/fixNuGetBundleCase
fix NuGet bundle case and version typo
2 parents cb13e45 + 69b97da commit c9b4ec6

File tree

29 files changed

+60
-42
lines changed

29 files changed

+60
-42
lines changed

Tasks/Common/nuget-task-common/NuGetToolRunner.ts

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,24 @@ interface LocateOptions {
106106

107107
/** Array of filenames to use when searching for the tool. Defaults to the tool name. */
108108
toolFilenames?: string[];
109+
110+
/** Array of paths to search under. Defaults to agent NuGet locations */
111+
searchPath?: string[];
112+
113+
/** root that searchPaths are relative to. Defaults to the Agent.HomeDirectory build variable */
114+
root?: string;
109115
}
110116

111117
function locateTool(tool: string, opts?: LocateOptions) {
112-
let searchPath = ["externals/nuget", "agent/Worker/Tools/NuGetCredentialProvider", "agent/Worker/Tools"];
113-
let agentRoot = tl.getVariable("Agent.HomeDirectory");
118+
const defaultSearchPath = ["externals/nuget", "agent/Worker/Tools/NuGetCredentialProvider", "agent/Worker/Tools"];
119+
const defaultAgentRoot = tl.getVariable("Agent.HomeDirectory");
114120

115121
opts = opts || {};
116122
opts.toolFilenames = opts.toolFilenames || [tool];
117123

124+
let searchPath = opts.searchPath || defaultSearchPath;
125+
let agentRoot = opts.root || defaultAgentRoot;
126+
118127
tl.debug(`looking for tool ${tool}`);
119128

120129
for (let thisVariant of opts.toolFilenames) {
@@ -271,5 +280,24 @@ export function isCredentialConfigEnabled(quirks: NuGetQuirks): boolean {
271280
}
272281

273282
export function locateCredentialProvider(): string {
274-
return path.join(__dirname, 'NuGet/CredentialProvider');
283+
return path.join(__dirname, "NuGet/CredentialProvider");
275284
}
285+
286+
export function getBundledNuGetLocation(uxOption: string): string {
287+
let nuGetDir;
288+
if (uxOption === "3.5.0.1829") {
289+
nuGetDir = "NuGet/3.5.0";
290+
}
291+
else if (uxOption === "3.3.0") {
292+
nuGetDir = "NuGet/3.3.0";
293+
}
294+
else {
295+
throw new Error(tl.loc("NGCommon_UnabletoDetectNuGetVersion"));
296+
}
297+
298+
return locateTool("NuGet", {
299+
root: __dirname,
300+
searchPath: [nuGetDir],
301+
toolFilenames: ["NuGet.exe", "nuget.exe"],
302+
});
303+
}

Tasks/Common/nuget-task-common/Utility.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,4 @@ export function stripLeadingAndTrailingQuotes(path: string): string {
137137

138138
// substring returns a value *not* including the character at right
139139
return path.substring(left, right + 1);
140-
}
141-
142-
export function getBundledNuGetLocation(uxOption: string): string {
143-
if (uxOption === "3.5.0.1829"){
144-
return path.join(__dirname, 'NuGet/3.5.0/NuGet.exe')
145-
}
146-
else if (uxOption === "3.3.0"){
147-
return path.join(__dirname, 'NuGet/3.3.0/NuGet.exe');
148-
}
149-
throw new Error(tl.loc("NGCommon_UnabletoDetectNuGetVersion"));
150140
}

Tasks/NuGetInstaller/Strings/resources.resjson/de-de/resources.resjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"loc.input.label.verbosity": "Ausführlichkeit",
1818
"loc.input.help.verbosity": "Ausführlichkeitsgrad von NuGet",
1919
"loc.input.label.nuGetVersion": "NuGet Version",
20-
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external verson.",
20+
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external version.",
2121
"loc.input.label.nuGetPath": "Pfad zu NuGet.exe",
2222
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
2323
"loc.messages.Warning_NoConfigForOldNuGet": "Bearbeiten Sie zum Herstellen einer Verbindung mit NuGet-Feeds, die in Ihrem Team Services-Konto bzw. Ihrer TFS-Projektsammlung mit NuGet 3.1 oder niedriger gehostet werden, die Builddefinition so, dass ein Pfad zu einer Datei \"NuGet.config\" angegeben wird, die die Paketquellen enthält, die Sie verwenden möchten.",

Tasks/NuGetInstaller/Strings/resources.resjson/en-US/resources.resjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"loc.input.label.verbosity": "Verbosity",
1818
"loc.input.help.verbosity": "NuGet's verbosity level",
1919
"loc.input.label.nuGetVersion": "NuGet Version",
20-
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external verson.",
20+
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external version.",
2121
"loc.input.label.nuGetPath": "Path to NuGet.exe",
2222
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
2323
"loc.messages.Warning_NoConfigForOldNuGet": "To connect to NuGet feeds hosted in your Team Services account/TFS project collection with NuGet 3.1 or below, edit your build definition to specify a path to a NuGet.config containing the package sources you wish to use.",

Tasks/NuGetInstaller/Strings/resources.resjson/es-es/resources.resjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"loc.input.label.verbosity": "Nivel de detalle",
1818
"loc.input.help.verbosity": "Nivel de detalle de NuGet",
1919
"loc.input.label.nuGetVersion": "NuGet Version",
20-
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external verson.",
20+
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external version.",
2121
"loc.input.label.nuGetPath": "Ruta de acceso de NuGet.exe",
2222
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
2323
"loc.messages.Warning_NoConfigForOldNuGet": "Para conectarse a las fuentes NuGet hospedadas en la cuenta de Team Services o la colección de proyectos de TFS con NuGet 3.1 o versiones anteriores, edite la definición de compilación para especificar una ruta de acceso a un archivo NuGet.config que contenga los orígenes del paquete que desea usar.",

Tasks/NuGetInstaller/Strings/resources.resjson/fr-fr/resources.resjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"loc.input.label.verbosity": "Commentaires",
1818
"loc.input.help.verbosity": "Niveau de détail de NuGet",
1919
"loc.input.label.nuGetVersion": "NuGet Version",
20-
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external verson.",
20+
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external version.",
2121
"loc.input.label.nuGetPath": "Chemin de NuGet.exe",
2222
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
2323
"loc.messages.Warning_NoConfigForOldNuGet": "Pour vous connecter aux flux NuGet hébergés dans votre compte Team Services/collection de projets TFS avec NuGet 3.1 ou une version antérieure, modifiez votre définition de build et spécifiez le chemin de NuGet.config contenant les sources de package à utiliser.",

Tasks/NuGetInstaller/Strings/resources.resjson/it-IT/resources.resjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"loc.input.label.verbosity": "Livello di dettaglio",
1818
"loc.input.help.verbosity": "Livello di dettaglio di NuGet",
1919
"loc.input.label.nuGetVersion": "NuGet Version",
20-
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external verson.",
20+
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external version.",
2121
"loc.input.label.nuGetPath": "Percorso di NuGet.exe",
2222
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
2323
"loc.messages.Warning_NoConfigForOldNuGet": "Per connettersi ai feed NuGet ospitati nell'account di Team Services e/o nella raccolta di progetti TFS con NuGet 3.1 o versione precedente, modificare la definizione di compilazione in modo che specifichi il percorso di un file NuGet.config contenente le origini pacchetto che si vogliono usare.",

Tasks/NuGetInstaller/Strings/resources.resjson/ja-jp/resources.resjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"loc.input.label.verbosity": "詳細",
1818
"loc.input.help.verbosity": "NuGet の詳細レベル",
1919
"loc.input.label.nuGetVersion": "NuGet Version",
20-
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external verson.",
20+
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external version.",
2121
"loc.input.label.nuGetPath": "NuGet.exe へのパス",
2222
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
2323
"loc.messages.Warning_NoConfigForOldNuGet": "NuGet 3.1 以前で Team Services アカウント/TFS プロジェクト コレクションでホストされている NuGet フィードに接続するには、ビルド定義を編集して、使用するパッケージ ソースを含む NuGet.config へのパスを指定します。",

Tasks/NuGetInstaller/Strings/resources.resjson/ko-KR/resources.resjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"loc.input.label.verbosity": "자세한 정도",
1818
"loc.input.help.verbosity": "NuGet의 세부 정보 표시 수준",
1919
"loc.input.label.nuGetVersion": "NuGet Version",
20-
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external verson.",
20+
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external version.",
2121
"loc.input.label.nuGetPath": "NuGet.exe 경로",
2222
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
2323
"loc.messages.Warning_NoConfigForOldNuGet": "NuGet 3.1 이하에서 Team Services 계정/TFS 프로젝트 컬렉션에서 호스트되는 NuGet 피드에 연결하려면 빌드 정의를 편집하여 사용하려는 패키지 소스를 포함하는 NuGet.config의 경로를 지정하세요.",

Tasks/NuGetInstaller/Strings/resources.resjson/ru-RU/resources.resjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"loc.input.label.verbosity": "Уровень детализации",
1818
"loc.input.help.verbosity": "Уровень детализации NuGet",
1919
"loc.input.label.nuGetVersion": "NuGet Version",
20-
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external verson.",
20+
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external version.",
2121
"loc.input.label.nuGetPath": "Путь к NuGet.exe",
2222
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
2323
"loc.messages.Warning_NoConfigForOldNuGet": "Чтобы подключиться к каналам NuGet, размещенным в вашей учетной записи Team Services или коллекции проектов TFS, используя NuGet 3.1 или предшествующую версию, измените определение сборки и укажите путь к файлу NuGet.config, в котором содержатся нужные вам источники пакетов.",

0 commit comments

Comments
 (0)