Skip to content

Commit

Permalink
Make SonarLint an automatic package
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Nov 14, 2016
1 parent 5d185e6 commit d704881
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 6 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ branches:

environment:
# Set au version to use or omit to use the latest. Specify branch name to use development version from Github
au_version:
au_version: master
au_push: true

# Github token to commit pushed packages to repository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>sonarlint-vs2015</id>
<id>sonarlint</id>
<title>SonarLint VSIX Extension</title>
<version>2.7.0</version>
<authors>SonarSource (SonarSource SA)</authors>
<owners>Pascal Berger</owners>
<projectSourceUrl>https://github.com/SonarSource-VisualStudio/sonaranalyzer-csharp</projectSourceUrl>
<iconUrl>https://cdn.rawgit.com/pascalberger/chocolatey-packages/master/sonarlint/SonarLint.png</iconUrl>
<iconUrl>https://cdn.rawgit.com/pascalberger/chocolatey-packages/master/icons/SonarLint.png</iconUrl>
<projectUrl>http://www.sonarlint.org/visualstudio/</projectUrl>
<packageSourceUrl>https://github.com/pascalberger/chocolatey-packages/tree/master/sonarlint</packageSourceUrl>
<packageSourceUrl>https://github.com/pascalberger/chocolatey-packages/tree/master/automatic/sonarlint</packageSourceUrl>
<licenseUrl>https://github.com/SonarSource-VisualStudio/sonaranalyzer-csharp/blob/master/LICENSE</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<summary>SonarLint provides on-the-fly feedback to developers on new bugs and quality issues injected into C# and VB.Net code. In addition the connected mode allows to enforce governance policies by reporting the same issues in Visual Studio and in SonarQube server.</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ $parameters = @{
ChecksumType = "sha256"
}

Install-ChocolateyVsixPackage @parameters
Install-ChocolateyVsixPackage @parameters
35 changes: 35 additions & 0 deletions automatic/sonarlint/update.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import-module au

$releases = 'https://visualstudiogallery.msdn.microsoft.com/47d1049d-bb27-454e-aab8-24566c85e548'

function global:au_SearchReplace {
@{
'tools\chocolateyInstall.ps1' = @{
"(VsixUrl\s*=\s*)`"([^*]+)`"" = "`$1`"$($Latest.URL32)`""
"(Checksum\s*=\s*)`"([^*]+)`"" = "`$1`"$($Latest.Checksum)`""
}
}
}

function global:au_GetLatest {
$download_page = Invoke-WebRequest -Uri $releases

#https://visualstudiogallery.msdn.microsoft.com/47d1049d-bb27-454e-aab8-24566c85e548/file/169863/20/SonarLint.VSIX-2.8.0.214.vsix
$re = "SonarLint.VSIX-.+.vsix"
$url = $download_page.links | ? href -match $re | select -First 1 -expand href
$url = ($url -split ':/')[1]

$url32 = 'https://visualstudiogallery.msdn.microsoft.com/' + $url

$filename = $url -split '-' | select -Last 1
$version = [IO.Path]::GetFileNameWithoutExtension($filename)
$checksum = Get-RemoteChecksum $url32

@{
URL32 = $url32
Version = $version
Checksum = $checksum
}
}

update -ChecksumFor none
Binary file added icons/SonarLint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d704881

Please sign in to comment.