diff --git a/Tasks/AndroidSigning/AndroidSigning.ps1 b/Tasks/AndroidSigning/AndroidSigning.ps1 deleted file mode 100644 index d1527898c71f..000000000000 --- a/Tasks/AndroidSigning/AndroidSigning.ps1 +++ /dev/null @@ -1,156 +0,0 @@ -param( - [string]$files, - [string]$jarsign, - [string]$keystoreFile, - [string]$keystorePass, - [string]$keystoreAlias, - [string]$keyPass, - [string]$jarsignerArguments, - [string]$zipalign, - [string]$zipalignLocation -) - -Write-Verbose "Entering script AndroidSigning.ps1" -Write-Verbose "files = $files" -Write-Verbose "jarsign = $jarsign" -Write-Verbose "keystoreFile = $keystoreFile" -Write-Verbose "keystoreAlias = $keystoreAlias" -Write-Verbose "jarsignerArguments = $jarsignerArguments" -Write-Verbose "zipalign = $zipalign" -Write-Verbose "zipalignLocation = $zipalignLocation" - -# Import the Task.Common and Task.Internal dll that has all the cmdlets we need for Build -import-module "Microsoft.TeamFoundation.DistributedTask.Task.Internal" -import-module "Microsoft.TeamFoundation.DistributedTask.Task.Common" - -$jarsignApk = Convert-String $jarsign Boolean -Write-Verbose "jarsign (converted) = $jarsignApk" - -$zipalignApk = Convert-String $zipalign Boolean -Write-Verbose "zipalign (converted) = $zipalignApk" - -function RenameExtension($path, $newExtension) -{ - if (!(Test-Path -Path $path -PathType Leaf)) - { - throw "Cannot rename directories or non-existent file $path." - } - - $file = Get-ChildItem $path - - $newName = $file.Name + $newExtension - $newFullPath = $file.DirectoryName + "\" + $newName - if (Test-Path -Path $newFullPath -PathType Leaf) - { - Remove-Item -Path $newFullPath - } - Rename-Item -Path $file -NewName $newName - - return $newFullPath -} - -if (!$files) -{ - throw "Files parameter not set on script." -} - -# check for files pattern -if ($files.Contains("*") -or $files.Contains("?")) -{ - Write-Verbose "Pattern found in files parameter. Calling Find-Files." - Write-Verbose "Find-Files -SearchPattern $files" - $filesToSign = Find-Files -SearchPattern $files - Write-Verbose "filesToSign = $filesToSign" -} -else -{ - Write-Verbose "No Pattern found in project parameter." - $filesToSign = ,$files -} - -if (!$filesToSign) -{ - throw "No file with search pattern '$files' was found." -} - -if ($jarsignApk) -{ - # verify parameters required for signing apk - $jarsigner = $env:JAVA_HOME + "\bin\jarsigner.exe" - if (!(Test-Path -Path $jarsigner -PathType Leaf)) - { - throw "Can not locate jarsigner.exe, please verify JAVA_HOME is properly configured on the build machine." - } - - if (!$keystoreFile -or !(Test-Path -Path $keystoreFile -PathType Leaf)) - { - throw "Please specify the keystore for signing APK and make sure it exists." - } - - if (!$keystoreAlias) - { - throw "Please specify the keystore alias." - } - - if ($keystorePass) - { - $jarsignerArguments = "$jarsignerArguments -storepass $keystorePass" - } - - if ($keyPass) - { - $jarsignerArguments = "$jarsignerArguments -keypass $keyPass" - } -} - -if ($zipalignApk) -{ - # verify parameters required for zipaligning apk - if (!$zipalignLocation) - { - $zipalignPattern = $env:ANDROID_HOME + "\build-tools\**\zipalign.exe" - $zipalignExecutables = Find-Files -SearchPattern $zipalignPattern - if ($zipalignExecutables) - { - foreach ($executable in $zipalignExecutables) - { - $zipaligner = $executable - break; - } - } - } - else { - $zipaligner = $zipalignLocation - } - - if (!(Test-Path -Path $zipaligner -PathType Leaf)) - { - throw "Can not locate zipalign.exe, please verify ANDROID_HOME is properly configured on the build machine." - } -} - - -foreach ($file in $filesToSign) -{ - if ($jarsignApk) - { - # move the apk file so we do not pollute the work direcotry with multiple apks - $unsignedApk = RenameExtension $file ".unsigned" - - $jarsignerArgs = "$jarsignerArguments -keystore `"$keystoreFile`" -signedjar $file $unsignedApk $keystoreAlias" - - Invoke-Tool -Path $jarsigner -Arguments $jarsignerArgs - } - - if ($zipalignApk) - { - $unalignedApk = RenameExtension $file ".unaligned" - - # alignment must be 4 or play store will reject, hard code this to avoid user errors - $zipalignArgs = "-v 4 $unalignedApk $file" - - Invoke-Tool -Path $zipaligner -Arguments $zipalignArgs - } -} - -Write-Verbose "Leaving script AndroidSigning.ps1" diff --git a/Tasks/AndroidSigning/task.json b/Tasks/AndroidSigning/task.json index 59299f7ab463..1ff245bfb6ee 100644 --- a/Tasks/AndroidSigning/task.json +++ b/Tasks/AndroidSigning/task.json @@ -12,7 +12,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 20 + "Patch": 21 }, "demands": [ "JDK", @@ -115,11 +115,6 @@ ], "instanceNameFormat": "Signing and aligning APK file(s) $(files)", "execution": { - "PowerShell": { - "target": "$(currentDirectory)\\AndroidSigning.ps1", - "argumentFormat": "", - "workingDirectory": "$(currentDirectory)" - }, "Node": { "target": "androidsigning.js", "argumentFormat": "" diff --git a/Tasks/AndroidSigning/task.loc.json b/Tasks/AndroidSigning/task.loc.json index 1d41a5c80536..eb7f7fd3f338 100644 --- a/Tasks/AndroidSigning/task.loc.json +++ b/Tasks/AndroidSigning/task.loc.json @@ -12,7 +12,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 20 + "Patch": 21 }, "demands": [ "JDK", @@ -115,11 +115,6 @@ ], "instanceNameFormat": "ms-resource:loc.instanceNameFormat", "execution": { - "PowerShell": { - "target": "$(currentDirectory)\\AndroidSigning.ps1", - "argumentFormat": "", - "workingDirectory": "$(currentDirectory)" - }, "Node": { "target": "androidsigning.js", "argumentFormat": "" diff --git a/Tasks/XamarinLicense/XamarinLicense.ps1 b/Tasks/XamarinLicense/XamarinLicense.ps1 deleted file mode 100644 index 06eb260566df..000000000000 --- a/Tasks/XamarinLicense/XamarinLicense.ps1 +++ /dev/null @@ -1,71 +0,0 @@ -param( - [string]$action, - [string]$email, - [string]$password, - [string]$product, - [string]$activateAndroid, - [string]$timeout -) - -Write-Verbose "Entering script XamarinLicense.ps1" -Write-Verbose "action = $action" -Write-Verbose "email = $email" -Write-Verbose "product = $product" -Write-Verbose "activateAndroid = $activateAndroid" -Write-Verbose "timeout = $timeout" - -# Import the Task.Common and Task.Internal dll that has all the cmdlets we need for Build -import-module "Microsoft.TeamFoundation.DistributedTask.Task.Internal" -import-module "Microsoft.TeamFoundation.DistributedTask.Task.Common" - -$activateAndroidLicense = Convert-String $activateAndroid Boolean -Write-Verbose "activateAndroid (converted) = $activateAndroidLicense" - -if (!$action) -{ - throw "Action parameter not set on script" -} - -if (!$email) -{ - throw "Email parameter not set on script" -} - -if (!$password) -{ - throw "Password parameter not set on script" -} - -$timeoutInSec = $null -if (!$timeout) -{ - Write-Verbose "Use default timeout of 30 seconds" - $timeoutInSec = 30 -} -elseif (![Int32]::TryParse($timeout, [ref] $timeoutInSec)) -{ - Write-Verbose "Could not parse timeout input, timeout default to 30 seconds." - $timeoutInSec = 30 -} -Write-Verbose "timeout: $timeoutInSec" - -if ($action -eq "Activate") -{ - $xamarinProducts = @() - if ($product -eq "MA" -or $activateAndroidLicense) - { - $xamarinProducts += [Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.XamarinProductType]::Android - } - - foreach ($p in $xamarinProducts) - { - Write-Verbose "Activating license for product type $p" - Register-XamarinLicense -Email $email -Password $password -Product $p -TimeoutInSec $timeoutInSec - } -} -elseif ($action -eq "Deactivate") -{ - Unregister-XamarinLicense -Email $email -Password $password -TimeoutInSec $timeoutInSec -} - -Write-Verbose "Leaving script XamarinLicense.ps1" diff --git a/Tasks/XamarinLicense/task.json b/Tasks/XamarinLicense/task.json index b024a80f8210..019f41348b2d 100644 --- a/Tasks/XamarinLicense/task.json +++ b/Tasks/XamarinLicense/task.json @@ -12,7 +12,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 15 + "Patch": 16 }, "demands": [], "minimumAgentVersion": "1.83.0", @@ -75,11 +75,6 @@ ], "instanceNameFormat": "$(action) Xamarin license", "execution": { - "PowerShell": { - "target": "$(currentDirectory)\\XamarinLicense.ps1", - "argumentFormat": "", - "workingDirectory": "$(currentDirectory)" - }, "Node": { "target": "xamarinlicense.js", "argumentFormat": "" diff --git a/Tasks/XamarinLicense/task.loc.json b/Tasks/XamarinLicense/task.loc.json index 18c656d6fed3..df313c2fa6fe 100644 --- a/Tasks/XamarinLicense/task.loc.json +++ b/Tasks/XamarinLicense/task.loc.json @@ -12,7 +12,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 15 + "Patch": 16 }, "demands": [], "minimumAgentVersion": "1.83.0", @@ -75,11 +75,6 @@ ], "instanceNameFormat": "ms-resource:loc.instanceNameFormat", "execution": { - "PowerShell": { - "target": "$(currentDirectory)\\XamarinLicense.ps1", - "argumentFormat": "", - "workingDirectory": "$(currentDirectory)" - }, "Node": { "target": "xamarinlicense.js", "argumentFormat": "" diff --git a/Tasks/cURLUploader/cURLUploader.ps1 b/Tasks/cURLUploader/cURLUploader.ps1 deleted file mode 100644 index 6a2add0926fb..000000000000 --- a/Tasks/cURLUploader/cURLUploader.ps1 +++ /dev/null @@ -1,83 +0,0 @@ -param( - [string]$files, - [string]$username, - [string]$password, - [string]$url, - [string]$redirectStderr, - [string]$options -) - -Write-Verbose "Entering script cURLUploader.ps1" -Write-Verbose "files = $files" -Write-Verbose "username = $username" -Write-Verbose "url = $url" -Write-Verbose "redirectStderr = $redirectStderr" -Write-Verbose "options = $options" - -# Import the Task dll that has all the cmdlets we need for Build -import-module "Microsoft.TeamFoundation.DistributedTask.Task.Common" -import-module "Microsoft.TeamFoundation.DistributedTask.Task.Internal" - -$redirectStderrChecked = Convert-String $redirectStderr Boolean -Write-Verbose "redirectStderrChecked (converted) = $redirectStderrChecked" - -#Verify curl is installed correctly -try -{ - $curl = Get-Command curl.exe - $curlPath = $curl.Path - Write-Verbose "Found curl at $curlPath" -} -catch -{ - throw 'Unable to find cURL. Verify it is installed correctly on the build agent: http://curl.haxx.se.' -} - -if (!$files) -{ - throw "Files parameter not set on script" -} - -if (!$url) -{ - throw "URL parameter not set on script" -} - -# check for files pattern -if ($files.Contains("*") -or $files.Contains("?")) -{ - Write-Verbose "Pattern found in files parameter. Calling Find-Files." - Write-Verbose "Find-Files -SearchPattern $files" - $foundFiles = Find-Files -SearchPattern $files - Write-Verbose "foundFiles = $foundFiles" - - $uploadFiles = '{"' + [System.String]::Join('","', $foundFiles) + '"}' -} -else -{ - Write-Verbose "No Pattern found in files parameter." - $uploadFiles = $files -} -Write-Verbose "uploadFiles = $uploadFiles" -# cURL even on Windows expects forward slash as path separator. -$updatedSlashes = $uploadFiles -replace "\\","/" -Write-Verbose "updatedSlashes = $updatedSlashes" - -if ($redirectStderrChecked) -{ - $args = "--stderr -" -} - -$args = "$args $options" - -if ($username -or $password) -{ - $args = "$args -u `"$username`"" + ":" + "`"$password`"" -} - -$args = "$args -T $updatedSlashes $url" - -Write-Verbose "Running curl..." -Invoke-Tool -Path $curlPath -Arguments $args - -Write-Verbose "Leaving script cURLUploader.ps1" diff --git a/Tasks/cURLUploader/task.json b/Tasks/cURLUploader/task.json index 90a67d72c97f..e43a8f8f900e 100644 --- a/Tasks/cURLUploader/task.json +++ b/Tasks/cURLUploader/task.json @@ -9,7 +9,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 14 + "Patch": 15 }, "demands": [ "curl" @@ -74,14 +74,9 @@ ], "instanceNameFormat": "Upload $(files) with cURL", "execution": { - "PowerShell": { - "target": "$(currentDirectory)\\cURLUploader.ps1", - "argumentFormat": "", - "workingDirectory": "$(currentDirectory)" - }, "Node": { "target": "curluploader.js", "argumentFormat": "" } } -} \ No newline at end of file +} diff --git a/Tasks/cURLUploader/task.loc.json b/Tasks/cURLUploader/task.loc.json index 912fd9a66ae1..9dcf9394cf51 100644 --- a/Tasks/cURLUploader/task.loc.json +++ b/Tasks/cURLUploader/task.loc.json @@ -9,7 +9,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 14 + "Patch": 15 }, "demands": [ "curl" @@ -74,11 +74,6 @@ ], "instanceNameFormat": "ms-resource:loc.instanceNameFormat", "execution": { - "PowerShell": { - "target": "$(currentDirectory)\\cURLUploader.ps1", - "argumentFormat": "", - "workingDirectory": "$(currentDirectory)" - }, "Node": { "target": "curluploader.js", "argumentFormat": ""