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

Update download package v0 and v1 to use preview common npm package #14003

Merged
merged 5 commits into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions Tasks/DownloadPackageV0/connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { BearerCredentialHandler } from "azure-devops-node-api/handlers/bearerto
import { WebApi } from "azure-devops-node-api";
import { IRequestOptions } from "azure-devops-node-api/interfaces/common/VsoBaseInterfaces";

import * as tl from 'vsts-task-lib/task';
import * as locationUtility from "packaging-common/locationUtilities";
import * as tl from 'azure-pipelines-task-lib/task';
import * as locationUtility from "azure-pipelines-tasks-packaging-common/locationUtilities";

export function getConnection(areaId: string, collectionUrl: string, accessToken: string): Promise<WebApi> {
var presignedUrlPatterns: RegExp[] = [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DownloadPackageV0/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var path = require('path')
import * as corem from 'azure-devops-node-api/CoreApi';
import * as tl from 'azure-pipelines-task-lib/task';
import * as vsom from 'azure-devops-node-api/VsoClient';
import { getProjectAndFeedIdFromInputParam } from "packaging-common/util"
import { getProjectAndFeedIdFromInputParam } from "azure-pipelines-tasks-packaging-common/util"
import stream = require('stream');
import { getConnection } from './connections';
import { WebApi } from 'azure-devops-node-api';
Expand Down
28 changes: 0 additions & 28 deletions Tasks/DownloadPackageV0/make.json

This file was deleted.

15 changes: 9 additions & 6 deletions Tasks/DownloadPackageV0/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "downloadpackage",
"version": "1.0.0",
"version": "1.0.1",
"description": "Download Package Task",
"main": "downloadPackages.js",
"scripts": {
Expand All @@ -17,11 +17,14 @@
},
"homepage": "https://github.com/Microsoft/azure-pipelines-tasks#readme",
"dependencies": {
"@types/node": "^6.14.2",
"azure-devops-node-api": "9.0.1",
"azure-pipelines-task-lib": "2.8.0",
"@types/node": "^10.17.0",
"azure-devops-node-api": "10.1.2",
"azure-pipelines-task-lib": "3.0.6-preview.0",
"decompress-zip": "0.3.0",
"packaging-common": "file:../../_build/Tasks/Common/packaging-common-1.0.1.tgz",
"utility-common": "file:../../_build/Tasks/Common/utility-common-1.0.2.tgz"
"azure-pipelines-tasks-packaging-common": "2.0.0-preview.0",
zhenghao104 marked this conversation as resolved.
Show resolved Hide resolved
"azure-pipelines-tasks-utility-common": "3.0.0-preview.0"
},
"devDependencies": {
"typescript": "4.0.2"
}
}
4 changes: 2 additions & 2 deletions Tasks/DownloadPackageV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"version": {
"Major": 0,
"Minor": 179,
zhenghao104 marked this conversation as resolved.
Show resolved Hide resolved
"Patch": 0
"Patch": 1
},
"demands": [],
"minimumAgentVersion": "1.99.0",
Expand Down Expand Up @@ -89,7 +89,7 @@
],
"instanceNameFormat": "Download Package",
"execution": {
"Node": {
"Node10": {
"target": "download.js",
"argumentFormat": ""
}
Expand Down
6 changes: 3 additions & 3 deletions Tasks/DownloadPackageV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"version": {
"Major": 0,
"Minor": 179,
"Patch": 0
"Patch": 1
},
"demands": [],
"minimumAgentVersion": "1.99.0",
Expand Down Expand Up @@ -89,7 +89,7 @@
],
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
"execution": {
"Node": {
"Node10": {
"target": "download.js",
"argumentFormat": ""
}
Expand All @@ -108,4 +108,4 @@
"Info_ResolvedToolFromCache": "ms-resource:loc.messages.Info_ResolvedToolFromCache",
"UnsupportedProjectScopedFeeds": "ms-resource:loc.messages.UnsupportedProjectScopedFeeds"
}
}
}
4 changes: 2 additions & 2 deletions Tasks/DownloadPackageV1/connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { BearerCredentialHandler } from "azure-devops-node-api/handlers/bearerto
import { WebApi } from "azure-devops-node-api";
import { IRequestOptions } from "azure-devops-node-api/interfaces/common/VsoBaseInterfaces";

import * as tl from 'vsts-task-lib/task';
import * as locationUtility from "packaging-common/locationUtilities";
import * as tl from 'azure-pipelines-task-lib/task';
import * as locationUtility from "azure-pipelines-tasks-packaging-common/locationUtilities";

export function getConnection(areaId: string, collectionUrl: string): Promise<WebApi> {
var accessToken = locationUtility.getSystemAccessToken();
Expand Down
6 changes: 3 additions & 3 deletions Tasks/DownloadPackageV1/main.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
var path = require("path");

import * as tl from "azure-pipelines-task-lib/task";
import * as nutil from "packaging-common/nuget/Utility";
import * as telemetry from "utility-common/telemetry";
import * as nutil from "azure-pipelines-tasks-packaging-common/nuget/Utility";
import * as telemetry from "azure-pipelines-tasks-utility-common/telemetry";

import { PackageUrlsBuilder } from "./packagebuilder";
import { PackageFile } from "./packagefile";
import { getConnection } from "./connections";
import { Retry } from "./retry";
import { downloadUniversalPackage } from "./universal";
import { getProjectAndFeedIdFromInputParam } from "packaging-common/util"
import { getProjectAndFeedIdFromInputParam } from "azure-pipelines-tasks-packaging-common/util"

tl.setResourcePath(path.join(__dirname, "task.json"));

Expand Down
15 changes: 10 additions & 5 deletions Tasks/DownloadPackageV1/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "downloadpackage",
"version": "1.0.0",
"version": "1.0.1",
"description": "Download Package Task",
"main": "downloadPackages.js",
"scripts": {
Expand All @@ -17,13 +17,18 @@
},
"homepage": "https://github.com/Microsoft/vsts-tasks#readme",
"dependencies": {
"@types/mocha": "^2.2.5",
"@types/node": "^6.14.2",
"azure-devops-node-api": "9.0.1",
"azure-pipelines-task-lib": "2.8.0",
"@types/mocha": "^5.2.7",
"@types/node": "^10.17.0",
"azure-devops-node-api": "10.1.2",
"azure-pipelines-task-lib": "3.0.6-preview.0",
"azure-pipelines-tasks-packaging-common": "2.0.0-preview.0",
"azure-pipelines-tasks-utility-common": "3.0.0-preview.0",
"decompress-zip": "0.3.0",
"packaging-common": "file:../../_build/Tasks/Common/packaging-common-1.0.1.tgz",
zhenghao104 marked this conversation as resolved.
Show resolved Hide resolved
"tar-fs": "1.16.3",
"utility-common": "file:../../_build/Tasks/Common/utility-common-1.0.2.tgz"
zhenghao104 marked this conversation as resolved.
Show resolved Hide resolved
},
"devDependencies": {
"typescript": "4.0.2"
}
}
4 changes: 2 additions & 2 deletions Tasks/DownloadPackageV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"version": {
"Major": 1,
"Minor": 179,
zhenghao104 marked this conversation as resolved.
Show resolved Hide resolved
"Patch": 0
"Patch": 1
},
"demands": [],
"releaseNotes": "Adds support to download Maven, Python, Universal and Npm packages.",
Expand Down Expand Up @@ -164,7 +164,7 @@
],
"instanceNameFormat": "Download Package $(definition)",
"execution": {
"Node": {
"Node10": {
"target": "main.js",
"argumentFormat": ""
}
Expand Down
6 changes: 3 additions & 3 deletions Tasks/DownloadPackageV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"version": {
"Major": 1,
"Minor": 179,
"Patch": 0
"Patch": 1
},
"demands": [],
"releaseNotes": "ms-resource:loc.releaseNotes",
Expand Down Expand Up @@ -164,7 +164,7 @@
],
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
"execution": {
"Node": {
"Node10": {
"target": "main.js",
"argumentFormat": ""
}
Expand All @@ -187,4 +187,4 @@
"Info_Downloading": "ms-resource:loc.messages.Info_Downloading",
"Info_UsingArtifactToolDownload": "ms-resource:loc.messages.Info_UsingArtifactToolDownload"
}
}
}
8 changes: 4 additions & 4 deletions Tasks/DownloadPackageV1/universal.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { IExecSyncResult, IExecOptions } from "azure-pipelines-task-lib/toolrunner";
import * as artifactToolRunner from "packaging-common/universal/ArtifactToolRunner";
import * as artifactToolRunner from "azure-pipelines-tasks-packaging-common/universal/ArtifactToolRunner";
import * as tl from "azure-pipelines-task-lib";
zhenghao104 marked this conversation as resolved.
Show resolved Hide resolved
import * as telemetry from "utility-common/telemetry";
import * as artifactToolUtilities from "packaging-common/universal/ArtifactToolUtilities";
import * as pkgLocationUtils from "packaging-common/locationUtilities";
import * as telemetry from "azure-pipelines-tasks-utility-common/telemetry";
import * as artifactToolUtilities from "azure-pipelines-tasks-packaging-common/universal/ArtifactToolUtilities";
import * as pkgLocationUtils from "azure-pipelines-tasks-packaging-common/locationUtilities";

export async function downloadUniversalPackage(
downloadPath: string,
Expand Down