diff --git a/extension-manifest.json b/extension-manifest.json index a36fe29..9aee524 100644 --- a/extension-manifest.json +++ b/extension-manifest.json @@ -1,10 +1,10 @@ { "manifestVersion": 1, - "id": "jessehouwing-vsts-tfvc-tasks-TEST", + "id": "jessehouwing-vsts-tfvc-tasks", "name": "TFVC Build Tasks", - "version": "1.0.29", + "version": "1.0.35", "publisher": "jessehouwing", - "public": false, + "public": true, "targets": [ { "id": "Microsoft.VisualStudio.Services" diff --git a/vsts-tfvc-add/TfvcAdd.ps1 b/vsts-tfvc-add/TfvcAdd.ps1 index b3cb80a..27dfebc 100644 --- a/vsts-tfvc-add/TfvcAdd.ps1 +++ b/vsts-tfvc-add/TfvcAdd.ps1 @@ -198,9 +198,14 @@ Try $OnNonFatalError = [Microsoft.TeamFoundation.VersionControl.Client.ExceptionEventHandler] { param($sender, $e) - Write-Warning "NonFatalError" - Write-Warning $e.Exception.Message - Write-Warning $e.Failure + if ($e.Exception -ne $null -and $e.Exception.Message -ne $null) + { + Write-Warning $e.Exception.Message + } + if ($e.Faulure -ne $null) + { + Write-Warning $e.Failure.ToString() + } } $provider.VersionControlServer.add_NonFatalError($OnNonFatalError) diff --git a/vsts-tfvc-add/task.json b/vsts-tfvc-add/task.json index 6aa18ee..44130b4 100644 --- a/vsts-tfvc-add/task.json +++ b/vsts-tfvc-add/task.json @@ -9,7 +9,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 97 + "Patch": 103 }, "minimumAgentVersion": "1.83.0", "groups": [ diff --git a/vsts-tfvc-checkin/TfvcCheckin.ps1 b/vsts-tfvc-checkin/TfvcCheckin.ps1 index 5bbfa5a..380b257 100644 --- a/vsts-tfvc-checkin/TfvcCheckin.ps1 +++ b/vsts-tfvc-checkin/TfvcCheckin.ps1 @@ -116,14 +116,6 @@ function Get-SourceProvider { } $success = $false try { - if ($provider.Name -eq 'TfsGit') { - $provider.CollectionUrl = "$env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI".TrimEnd('/') - $provider.RepoId = $env:BUILD_REPOSITORY_ID - $provider.CommitId = $env:BUILD_SOURCEVERSION - $success = $true - return New-Object psobject -Property $provider - } - if ($provider.Name -eq 'TfsVersionControl') { $serviceEndpoint = Get-ServiceEndpoint -Context $distributedTaskContext -Name $env:BUILD_REPOSITORY_NAME $tfsClientCredentials = Get-TfsClientCredentials -ServiceEndpoint $serviceEndpoint @@ -132,6 +124,7 @@ function Get-SourceProvider { $serviceEndpoint.Url, $tfsClientCredentials) $versionControlServer = $provider.TfsTeamProjectCollection.GetService([Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer]) + $provider.VersionControlServer = $versionControlServer; $provider.Workspace = $versionControlServer.TryGetWorkspace($provider.SourcesRootPath) if (!$provider.Workspace) { Write-Verbose "Unable to determine workspace from source folder: $($provider.SourcesRootPath)" @@ -170,8 +163,7 @@ function Get-SourceProvider { return New-Object psobject -Property $provider } - Write-Warning ("Only TfsVersionControl source providers are supported for TFVC tasks. Repository type: $provider") - return + Write-Warning ("Only TfsVersionControl source providers are supported for TFVC tasks. Repository type: $provider") return } finally { if (!$success) { Invoke-DisposeSourceProvider -Provider $provider @@ -315,9 +307,21 @@ Try } } + $provider = Get-SourceProvider + $OnNonFatalError = [Microsoft.TeamFoundation.VersionControl.Client.ExceptionEventHandler] { + param($sender, $e) - $provider = Get-SourceProvider + if ($e.Exception -ne $null -and $e.Exception.Message -ne $null) + { + Write-Warning $e.Exception.Message + } + if ($e.Faulure -ne $null) + { + Write-Warning $e.Failure.ToString() + } + } + $provider.VersionControlServer.add_NonFatalError($OnNonFatalError) if ($Recursion -ne "") { @@ -375,8 +379,8 @@ Try } Finally { + $provider.VersionControlServer.remove_NonFatalError($OnNonFatalError) Invoke-DisposeSourceProvider -Provider $provider - [System.AppDomain]::CurrentDomain.remove_AssemblyResolve($OnAssemblyResolve) } diff --git a/vsts-tfvc-checkin/task.json b/vsts-tfvc-checkin/task.json index b1fbc64..4e3c146 100644 --- a/vsts-tfvc-checkin/task.json +++ b/vsts-tfvc-checkin/task.json @@ -9,7 +9,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 128 + "Patch": 134 }, "visibility": [ "Build"