From 6f1e92e834879277131511892931fc96da0a38ed Mon Sep 17 00:00:00 2001 From: Chebotov Nikolay Date: Sat, 27 Feb 2021 19:57:47 +0300 Subject: [PATCH] fix: fix error in VSIX Module for AppVeyor --- src/Unchase.OData.ConnectedService.sln | 1 + .../Properties/AssemblyInfo.cs | 4 +-- .../Provider.cs | 5 +++- .../source.extension.vsixmanifest | 2 +- vsix.ps1 | 27 ++++++++++++------- 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/Unchase.OData.ConnectedService.sln b/src/Unchase.OData.ConnectedService.sln index d390995..69a88c1 100644 --- a/src/Unchase.OData.ConnectedService.sln +++ b/src/Unchase.OData.ConnectedService.sln @@ -11,6 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ..\CHANGELOG.md = ..\CHANGELOG.md ..\LICENSE.md = ..\LICENSE.md ..\README.md = ..\README.md + ..\vsix.ps1 = ..\vsix.ps1 EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "img", "img", "{AF7BF915-39B1-44DB-860A-EF92B0FBD6AD}" diff --git a/src/Unchase.OData.ConnectedService/Properties/AssemblyInfo.cs b/src/Unchase.OData.ConnectedService/Properties/AssemblyInfo.cs index a5a1d34..50d453b 100644 --- a/src/Unchase.OData.ConnectedService/Properties/AssemblyInfo.cs +++ b/src/Unchase.OData.ConnectedService/Properties/AssemblyInfo.cs @@ -30,7 +30,7 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.4.2.0")] -[assembly: AssemblyFileVersion("1.4.2.0")] +[assembly: AssemblyVersion("1.4.3.0")] +[assembly: AssemblyFileVersion("1.4.3.0")] [assembly: NeutralResourcesLanguage("en")] diff --git a/src/Unchase.OData.ConnectedService/Provider.cs b/src/Unchase.OData.ConnectedService/Provider.cs index 9779ce1..4298036 100644 --- a/src/Unchase.OData.ConnectedService/Provider.cs +++ b/src/Unchase.OData.ConnectedService/Provider.cs @@ -17,6 +17,7 @@ namespace Unchase.OData.ConnectedService internal class Provider : ConnectedServiceProvider { #region Constructors + public Provider() { Category = Constants.ExtensionCategory; @@ -29,13 +30,14 @@ public Provider() BitmapSizeOptions.FromWidthAndHeight(64, 64) ); CreatedBy = Constants.Author; - Version = new Version(1, 3, 11, 0); Version = typeof(Provider).Assembly.GetName().Version; MoreInfoUri = new Uri(Constants.Website); } + #endregion #region Methods + public override IEnumerable> GetSupportedTechnologyLinks() { yield return Tuple.Create("OData Website", new Uri("http://www.odata.org/")); @@ -47,6 +49,7 @@ public override Task CreateConfiguratorAsync(Conne var wizard = new Wizard(context); return Task.FromResult(wizard); } + #endregion } } diff --git a/src/Unchase.OData.ConnectedService/source.extension.vsixmanifest b/src/Unchase.OData.ConnectedService/source.extension.vsixmanifest index 4cab480..3c7fc21 100644 --- a/src/Unchase.OData.ConnectedService/source.extension.vsixmanifest +++ b/src/Unchase.OData.ConnectedService/source.extension.vsixmanifest @@ -1,7 +1,7 @@  - + Unchase OData Connected Service OData V1-V4 connected service with extension methods for client-side proxy class. https://github.com/unchase/Unchase.Odata.Connectedservice diff --git a/vsix.ps1 b/vsix.ps1 index b3db998..aa5ef68 100644 --- a/vsix.ps1 +++ b/vsix.ps1 @@ -2,7 +2,7 @@ [cmdletbinding()] param() -$vsixUploadEndpoint = "http://vsixgallery.com/api/upload" +$vsixUploadEndpoint = "https://www.vsixgallery.com/api/upload" function Vsix-PushArtifacts { [cmdletbinding()] @@ -15,7 +15,7 @@ function Vsix-PushArtifacts { process { foreach($filePath in $path) { $fileNames = (Get-ChildItem $filePath -Recurse) - + foreach($vsixFile in $fileNames) { if (Get-Command Update-AppveyorBuild -errorAction SilentlyContinue) @@ -78,7 +78,8 @@ function Vsix-PublishToGallery{ [byte[]]$bytes = [System.IO.File]::ReadAllBytes($vsixFile) try { - $response = Invoke-WebRequest $url -Method Post -Body $bytes -UseBasicParsing + $webclient = New-Object System.Net.WebClient + $webclient.UploadFile($url, $vsixFile) | Out-Null 'OK' | Write-Host -ForegroundColor Green } catch{ @@ -240,7 +241,7 @@ function Vsix-TokenReplacement { $content = [string]::join([environment]::newline, (get-content $FilePath)) $regex = New-Object System.Text.RegularExpressions.Regex $searchString - + $regex.Replace($content, $replacement) | Out-File $FilePath "OK" | Write-Host -ForegroundColor Green @@ -257,7 +258,7 @@ function Vsix-CreateChocolatyPackage { [string]$packageId ) process { - + if ([String]::IsNullOrEmpty($pacakgeId)){ $error = New-Object System.ArgumentNullException "packageID is null or empty" } @@ -307,8 +308,8 @@ function Vsix-CreateChocolatyPackage { $Icon = $vsixXml.SelectSingleNode("//ns:Tags", $ns).InnerText $PreviewImage = $vsixXml.SelectSingleNode("//ns:Tags", $ns).InnerText } - - + + [System.IO.DirectoryInfo]$folder = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), ".vsixbuild", "$id") [System.IO.Directory]::CreateDirectory($folder.FullName) | Out-Null @@ -333,6 +334,12 @@ function Vsix-CreateChocolatyPackage { $XmlWriter.WriteElementString("projectUrl", "http://vsixgallery.com/extension/" + $id + "/") $XmlWriter.WriteElementString("iconUrl", "http://vsixgallery.com/extensions/" + $id + "/icon.png") $XmlWriter.WriteElementString("packageSourceUrl", $repoUrl) + $XmlWriter.WriteStartElement("dependencies") + $XmlWriter.WriteStartElement("dependency") + $XmlWriter.WriteAttributeString("id", "chocolatey-visualstudio.extension") + $XmlWriter.WriteAttributeString("version", "1.6.0") + $XmlWriter.WriteEndElement() # dependency + $XmlWriter.WriteEndElement() # dependencies $XmlWriter.WriteEndElement() # metadata $XmlWriter.WriteStartElement("files") @@ -353,9 +360,9 @@ function Vsix-CreateChocolatyPackage { $sb.AppendLine("`$url = `'" + "https://vsixgallery.azurewebsites.net/extensions/" + $id + "/" + $displayName + ".vsix`'") | Out-Null $sb.AppendLine("`$checksum = `'" + $hash + "`'") | Out-Null $sb.AppendLine("`$checksumType = `'SHA256`'") | Out-Null - $sb.AppendLine("Install-ChocolateyVsixPackage `$name `$url -Checksum `$checksum -ChecksumType `$checksumType") | Out-Null + $sb.AppendLine("Install-VisualStudioVsixExtension `$name `$url -Checksum `$checksum -ChecksumType `$checksumType") | Out-Null + - New-Item ($folder.FullName + "\chocolateyInstall.ps1") -type file -force -value $sb.ToString() | Out-Null Push-Location $folder.FullName @@ -378,4 +385,4 @@ function Vsix-CreateChocolatyPackage { } } } -} +} \ No newline at end of file