Skip to content

Commit

Permalink
Merge pull request #2932 from jmyersmsft/users/jmyers/fixNuGetBundleCase
Browse files Browse the repository at this point in the history
fix NuGet bundle case and version typo
  • Loading branch information
zjrunner authored Oct 25, 2016
2 parents cb13e45 + 69b97da commit c9b4ec6
Show file tree
Hide file tree
Showing 29 changed files with 60 additions and 42 deletions.
34 changes: 31 additions & 3 deletions Tasks/Common/nuget-task-common/NuGetToolRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,24 @@ interface LocateOptions {

/** Array of filenames to use when searching for the tool. Defaults to the tool name. */
toolFilenames?: string[];

/** Array of paths to search under. Defaults to agent NuGet locations */
searchPath?: string[];

/** root that searchPaths are relative to. Defaults to the Agent.HomeDirectory build variable */
root?: string;
}

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

opts = opts || {};
opts.toolFilenames = opts.toolFilenames || [tool];

let searchPath = opts.searchPath || defaultSearchPath;
let agentRoot = opts.root || defaultAgentRoot;

tl.debug(`looking for tool ${tool}`);

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

export function locateCredentialProvider(): string {
return path.join(__dirname, 'NuGet/CredentialProvider');
return path.join(__dirname, "NuGet/CredentialProvider");
}

export function getBundledNuGetLocation(uxOption: string): string {
let nuGetDir;
if (uxOption === "3.5.0.1829") {
nuGetDir = "NuGet/3.5.0";
}
else if (uxOption === "3.3.0") {
nuGetDir = "NuGet/3.3.0";
}
else {
throw new Error(tl.loc("NGCommon_UnabletoDetectNuGetVersion"));
}

return locateTool("NuGet", {
root: __dirname,
searchPath: [nuGetDir],
toolFilenames: ["NuGet.exe", "nuget.exe"],
});
}
10 changes: 0 additions & 10 deletions Tasks/Common/nuget-task-common/Utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,4 @@ export function stripLeadingAndTrailingQuotes(path: string): string {

// substring returns a value *not* including the character at right
return path.substring(left, right + 1);
}

export function getBundledNuGetLocation(uxOption: string): string {
if (uxOption === "3.5.0.1829"){
return path.join(__dirname, 'NuGet/3.5.0/NuGet.exe')
}
else if (uxOption === "3.3.0"){
return path.join(__dirname, 'NuGet/3.3.0/NuGet.exe');
}
throw new Error(tl.loc("NGCommon_UnabletoDetectNuGetVersion"));
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"loc.input.label.verbosity": "Ausführlichkeit",
"loc.input.help.verbosity": "Ausführlichkeitsgrad von NuGet",
"loc.input.label.nuGetVersion": "NuGet Version",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external verson.",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external version.",
"loc.input.label.nuGetPath": "Pfad zu NuGet.exe",
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
"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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"loc.input.label.verbosity": "Verbosity",
"loc.input.help.verbosity": "NuGet's verbosity level",
"loc.input.label.nuGetVersion": "NuGet Version",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external verson.",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external version.",
"loc.input.label.nuGetPath": "Path to NuGet.exe",
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
"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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"loc.input.label.verbosity": "Nivel de detalle",
"loc.input.help.verbosity": "Nivel de detalle de NuGet",
"loc.input.label.nuGetVersion": "NuGet Version",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external verson.",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external version.",
"loc.input.label.nuGetPath": "Ruta de acceso de NuGet.exe",
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
"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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"loc.input.label.verbosity": "Commentaires",
"loc.input.help.verbosity": "Niveau de détail de NuGet",
"loc.input.label.nuGetVersion": "NuGet Version",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external verson.",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external version.",
"loc.input.label.nuGetPath": "Chemin de NuGet.exe",
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
"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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"loc.input.label.verbosity": "Livello di dettaglio",
"loc.input.help.verbosity": "Livello di dettaglio di NuGet",
"loc.input.label.nuGetVersion": "NuGet Version",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external verson.",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external version.",
"loc.input.label.nuGetPath": "Percorso di NuGet.exe",
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
"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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"loc.input.label.verbosity": "詳細",
"loc.input.help.verbosity": "NuGet の詳細レベル",
"loc.input.label.nuGetVersion": "NuGet Version",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external verson.",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external version.",
"loc.input.label.nuGetPath": "NuGet.exe へのパス",
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
"loc.messages.Warning_NoConfigForOldNuGet": "NuGet 3.1 以前で Team Services アカウント/TFS プロジェクト コレクションでホストされている NuGet フィードに接続するには、ビルド定義を編集して、使用するパッケージ ソースを含む NuGet.config へのパスを指定します。",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"loc.input.label.verbosity": "자세한 정도",
"loc.input.help.verbosity": "NuGet의 세부 정보 표시 수준",
"loc.input.label.nuGetVersion": "NuGet Version",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external verson.",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external version.",
"loc.input.label.nuGetPath": "NuGet.exe 경로",
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
"loc.messages.Warning_NoConfigForOldNuGet": "NuGet 3.1 이하에서 Team Services 계정/TFS 프로젝트 컬렉션에서 호스트되는 NuGet 피드에 연결하려면 빌드 정의를 편집하여 사용하려는 패키지 소스를 포함하는 NuGet.config의 경로를 지정하세요.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"loc.input.label.verbosity": "Уровень детализации",
"loc.input.help.verbosity": "Уровень детализации NuGet",
"loc.input.label.nuGetVersion": "NuGet Version",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external verson.",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external version.",
"loc.input.label.nuGetPath": "Путь к NuGet.exe",
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
"loc.messages.Warning_NoConfigForOldNuGet": "Чтобы подключиться к каналам NuGet, размещенным в вашей учетной записи Team Services или коллекции проектов TFS, используя NuGet 3.1 или предшествующую версию, измените определение сборки и укажите путь к файлу NuGet.config, в котором содержатся нужные вам источники пакетов.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"loc.input.label.verbosity": "详细信息",
"loc.input.help.verbosity": "NuGet 的详细级别",
"loc.input.label.nuGetVersion": "NuGet Version",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external verson.",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external version.",
"loc.input.label.nuGetPath": "NuGet.exe 的路径",
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
"loc.messages.Warning_NoConfigForOldNuGet": "若要连接到在 Team Services 帐户/TFS 项目集合中托管且版本为 NuGet 3.1 或更低的 NuGet 源,请编辑生成定义,以指定其中包含想要使用的包源的 NuGet.config 的路径。",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"loc.input.label.verbosity": "詳細資訊",
"loc.input.help.verbosity": "NuGet 的詳細資訊層級",
"loc.input.label.nuGetVersion": "NuGet Version",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external verson.",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or external version.",
"loc.input.label.nuGetPath": "NuGet.exe 的路徑",
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
"loc.messages.Warning_NoConfigForOldNuGet": "若要連線到使用 NuGet 3.1 或更低版本裝載於 Team Services 帳戶/TFS 專案集合中的 NuGet 摘要,請編輯您的組建定義以指定路徑,連到包含您要使用之套件來源的 NuGet.config。",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/NuGetInstaller/nugetinstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ async function main(): Promise<void> {
throw new Error(tl.loc("NoNuGetSpecified"))
}
// Pull the pre-installed path for NuGet.
nuGetPath = nutil.getBundledNuGetLocation(nugetUxOption);
nuGetPath = ngToolRunner.getBundledNuGetLocation(nugetUxOption);
}

let serviceUri = tl.getEndpointUrl("SYSTEMVSSCONNECTION", false);
Expand Down
4 changes: 2 additions & 2 deletions Tasks/NuGetInstaller/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"version": {
"Major": 0,
"Minor": 2,
"Patch": 20
"Patch": 21
},
"minimumAgentVersion": "1.83.0",
"groups": [
Expand Down Expand Up @@ -85,7 +85,7 @@
"type": "radio",
"label": "NuGet Version",
"defaultValue": "3.3.0",
"helpMarkDown": "The version of NuGet to use, or external verson.",
"helpMarkDown": "The version of NuGet to use, or external version.",
"required": "true",
"groupName": "advanced",
"options": {
Expand Down
2 changes: 1 addition & 1 deletion Tasks/NuGetInstaller/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"version": {
"Major": 0,
"Minor": 2,
"Patch": 20
"Patch": 21
},
"minimumAgentVersion": "1.83.0",
"groups": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"loc.input.label.verbosity": "Ausführlichkeit",
"loc.input.help.verbosity": "Ausführlichkeitsgrad von NuGet",
"loc.input.label.nuGetVersion": "NuGet Version",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or custom verson.",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or custom version.",
"loc.input.label.nuGetPath": "Pfad zu \"NuGet.exe\"",
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
"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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"loc.input.label.verbosity": "Verbosity",
"loc.input.help.verbosity": "NuGet's verbosity level",
"loc.input.label.nuGetVersion": "NuGet Version",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or custom verson.",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or custom version.",
"loc.input.label.nuGetPath": "Path to NuGet.exe",
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
"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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"loc.input.label.verbosity": "Nivel de detalle",
"loc.input.help.verbosity": "Nivel de detalle de NuGet",
"loc.input.label.nuGetVersion": "NuGet Version",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or custom verson.",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or custom version.",
"loc.input.label.nuGetPath": "Ruta de acceso a NuGet.exe",
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
"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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"loc.input.label.verbosity": "Commentaires",
"loc.input.help.verbosity": "Niveau de détail de NuGet",
"loc.input.label.nuGetVersion": "NuGet Version",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or custom verson.",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or custom version.",
"loc.input.label.nuGetPath": "Chemin de NuGet.exe",
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
"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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"loc.input.label.verbosity": "Livello di dettaglio",
"loc.input.help.verbosity": "Livello di dettaglio di NuGet",
"loc.input.label.nuGetVersion": "NuGet Version",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or custom verson.",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or custom version.",
"loc.input.label.nuGetPath": "Percorso di NuGet.exe",
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
"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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"loc.input.label.verbosity": "詳細",
"loc.input.help.verbosity": "NuGet の詳細レベル",
"loc.input.label.nuGetVersion": "NuGet Version",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or custom verson.",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or custom version.",
"loc.input.label.nuGetPath": "NuGet.exe へのパス",
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
"loc.messages.Warning_NoConfigForOldNuGet": "NuGet 3.1 以前で Team Services アカウント/TFS プロジェクト コレクションでホストされている NuGet フィードに接続するには、ビルド定義を編集して、使用するパッケージ ソースを含む NuGet.config へのパスを指定します。",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"loc.input.label.verbosity": "자세한 정도",
"loc.input.help.verbosity": "NuGet의 세부 정보 표시 수준",
"loc.input.label.nuGetVersion": "NuGet Version",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or custom verson.",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or custom version.",
"loc.input.label.nuGetPath": "NuGet.exe 경로",
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
"loc.messages.Warning_NoConfigForOldNuGet": "NuGet 3.1 이하에서 Team Services 계정/TFS 프로젝트 컬렉션에서 호스트되는 NuGet 피드에 연결하려면 빌드 정의를 편집하여 사용하려는 패키지 소스를 포함하는 NuGet.config의 경로를 지정하세요.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"loc.input.label.verbosity": "Уровень детализации",
"loc.input.help.verbosity": "Уровень детализации NuGet",
"loc.input.label.nuGetVersion": "NuGet Version",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or custom verson.",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or custom version.",
"loc.input.label.nuGetPath": "Путь к NuGet.exe",
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
"loc.messages.Warning_NoConfigForOldNuGet": "Чтобы подключиться к каналам NuGet, размещенным в вашей учетной записи Team Services или коллекции проектов TFS, используя NuGet 3.1 или предшествующую версию, измените определение сборки и укажите путь к файлу NuGet.config, в котором содержатся нужные вам источники пакетов.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"loc.input.label.verbosity": "详细信息",
"loc.input.help.verbosity": "NuGet 的详细级别",
"loc.input.label.nuGetVersion": "NuGet Version",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or custom verson.",
"loc.input.help.nuGetVersion": "The version of NuGet to use, or custom version.",
"loc.input.label.nuGetPath": "NuGet.exe 的路径",
"loc.input.help.nuGetPath": "Optionally supply the path to NuGet.exe. Will override version selection.",
"loc.messages.Warning_NoConfigForOldNuGet": "若要连接到在 Team Services 帐户/TFS 项目集合中托管且版本为 NuGet 3.1 或更低的 NuGet 源,请编辑生成定义,以指定其中包含想要使用的包源的 NuGet.config 的路径。",
Expand Down
Loading

0 comments on commit c9b4ec6

Please sign in to comment.