-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix for localization errors and library versioning #6936
Changes from all commits
1a5b8b3
0f76f86
abb1495
e908e34
c6ecc6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,15 +43,16 @@ async function getJava(versionSpec: string) { | |
if (version) { //This version of Java JDK is already in the cache. Use it instead of downloading again. | ||
console.log(taskLib.loc('Info_ResolvedToolFromCache', version)); | ||
} else if (fromAzure) { //Download JDK from an Azure blob storage location and extract. | ||
console.log(taskLib.loc('RetrievingJdkFromAzure', version)); | ||
compressedFileExtension = getFileEnding(taskLib.getInput('azureCommonVirtualFile', true)); | ||
console.log(taskLib.loc('RetrievingJdkFromAzure')); | ||
const fileNameAndPath: string = taskLib.getInput('azureCommonVirtualFile', false); | ||
compressedFileExtension = getFileEnding(fileNameAndPath); | ||
|
||
const azureDownloader = new AzureStorageArtifactDownloader(taskLib.getInput('azureResourceManagerEndpoint', true), | ||
taskLib.getInput('azureStorageAccountName', true), taskLib.getInput('azureContainerName', true), taskLib.getInput('azureCommonVirtualFile', false)); | ||
await azureDownloader.downloadArtifacts(extractLocation, '*' + compressedFileExtension); | ||
taskLib.getInput('azureStorageAccountName', true), taskLib.getInput('azureContainerName', true), ""); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The download artifacts method now treats the path as being a folder and adds a '/' on the end. The work around is to pass the filename in as the itemPattern. |
||
await azureDownloader.downloadArtifacts(extractLocation, '*' + fileNameAndPath); | ||
await sleepFor(250); //Wait for the file to be released before extracting it. | ||
|
||
const extractSource = buildFilePath(extractLocation, compressedFileExtension); | ||
const extractSource = buildFilePath(extractLocation, compressedFileExtension, fileNameAndPath); | ||
jdkDirectory = new JavaFilesExtractor().unzipJavaDownload(extractSource, compressedFileExtension, extractLocation); | ||
} else { //JDK is in a local directory. Extract to specified target directory. | ||
console.log(taskLib.loc('RetrievingJdkFromLocalPath', version)); | ||
|
@@ -72,9 +73,8 @@ function sleepFor(sleepDurationInMillisecondsSeconds): Promise<any> { | |
}); | ||
} | ||
|
||
function buildFilePath(localPathRoot: string, fileEnding: string): string { | ||
const azureFileSource: string = taskLib.getInput('azureCommonVirtualFile', true); | ||
const fileName = azureFileSource.split(/[\\\/]/).pop(); | ||
function buildFilePath(localPathRoot: string, fileEnding: string, fileNameAndPath: string): string { | ||
const fileName = fileNameAndPath.split(/[\\\/]/).pop(); | ||
const extractSource = path.join(localPathRoot, fileName); | ||
|
||
return extractSource; | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "java-tool-installer", | ||
"version": "0.126.0", | ||
"version": "0.134.0", | ||
"description": "Java Tool Installer", | ||
"main": "javaToolInstaller.js", | ||
"scripts": { | ||
|
@@ -24,7 +24,7 @@ | |
"dependencies": { | ||
"azure-arm-rest": "file:../../_build/Tasks/Common/azure-arm-rest-1.0.2.tgz", | ||
"azure-blobstorage-artifactProvider": "file:../../_build/Tasks/Common/azure-blobstorage-artifactProvider-1.0.0.tgz", | ||
"vsts-task-lib": "2.1.0", | ||
"vsts-task-tool-lib": "^0.4.1" | ||
"vsts-task-lib": "2.4.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updating these libraries to include the fixes for localization bugs. |
||
"vsts-task-tool-lib": "0.8.1" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was an unused variable being passed into the localization message so I removed it.