Skip to content

Commit

Permalink
fix: fix error in VSIX Module for AppVeyor
Browse files Browse the repository at this point in the history
  • Loading branch information
unchase committed Feb 27, 2021
1 parent eeeab04 commit 6f1e92e
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/Unchase.OData.ConnectedService.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
4 changes: 2 additions & 2 deletions src/Unchase.OData.ConnectedService/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]

5 changes: 4 additions & 1 deletion src/Unchase.OData.ConnectedService/Provider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Unchase.OData.ConnectedService
internal class Provider : ConnectedServiceProvider
{
#region Constructors

public Provider()
{
Category = Constants.ExtensionCategory;
Expand All @@ -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<Tuple<string, Uri>> GetSupportedTechnologyLinks()
{
yield return Tuple.Create("OData Website", new Uri("http://www.odata.org/"));
Expand All @@ -47,6 +49,7 @@ public override Task<ConnectedServiceConfigurator> CreateConfiguratorAsync(Conne
var wizard = new Wizard(context);
return Task.FromResult<ConnectedServiceConfigurator>(wizard);
}

#endregion
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" ?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="Unchase.OData.ConnectedService.afc46f39-8c64-4e14-85d0-af6c7c4291f3" Version="1.4.2" Language="en-US" Publisher="Unchase" />
<Identity Id="Unchase.OData.ConnectedService.afc46f39-8c64-4e14-85d0-af6c7c4291f3" Version="1.4.3" Language="en-US" Publisher="Unchase" />
<DisplayName>Unchase OData Connected Service</DisplayName>
<Description xml:space="preserve">OData V1-V4 connected service with extension methods for client-side proxy class.</Description>
<MoreInfo>https://github.com/unchase/Unchase.Odata.Connectedservice</MoreInfo>
Expand Down
27 changes: 17 additions & 10 deletions vsix.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[cmdletbinding()]
param()

$vsixUploadEndpoint = "http://vsixgallery.com/api/upload"
$vsixUploadEndpoint = "https://www.vsixgallery.com/api/upload"

function Vsix-PushArtifacts {
[cmdletbinding()]
Expand All @@ -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)
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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
Expand All @@ -257,7 +258,7 @@ function Vsix-CreateChocolatyPackage {
[string]$packageId
)
process {

if ([String]::IsNullOrEmpty($pacakgeId)){
$error = New-Object System.ArgumentNullException "packageID is null or empty"
}
Expand Down Expand Up @@ -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
Expand All @@ -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")
Expand All @@ -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
Expand All @@ -378,4 +385,4 @@ function Vsix-CreateChocolatyPackage {
}
}
}
}
}

0 comments on commit 6f1e92e

Please sign in to comment.