Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable nerdbank #267

Merged
merged 13 commits into from
Nov 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*.user
*.userosscache
*.sln.docstates
*.binlog

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
Expand Down
25 changes: 0 additions & 25 deletions scripts/BuildAndTest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -65,29 +65,6 @@ Import-Module -Force $PSScriptRoot\Projects.psm1
$SolutionFile = "$SourceRoot\Sarif.Viewer.VisualStudio.sln"
$BuildTarget = "Rebuild"

function Update-VersionConstantsFiles {
foreach ($project in $Projects.All) {
& $PSScriptRoot\New-VersionConstantsFile.ps1 -OutputDirectory $SourceRoot\$project -Namespace "Microsoft.CodeAnalysis.$project"
}
}

function Update-VsixManifest($project) {
$versionPrefix, $versionSuffix = & "$PSScriptRoot\Get-VersionConstants.ps1"

$vsixManifestPath = "$SourceRoot\$project\source.extension.vsixmanifest"
$vsixManifest = [xml](Get-Content $vsixManifestPath)

$vsixManifest.PackageManifest.Metadata.Identity.Version = $versionPrefix

$vsixManifest.Save($vsixManifestPath)
}

function Update-VsixManifests {
foreach ($project in $Projects.Vsix) {
Update-VsixManifest $project
}
}

function Invoke-Build {
Write-Information "Building $SolutionFile..."
msbuild /verbosity:minimal /target:$BuildTarget /property:Configuration=$Configuration /fileloggerparameters:Verbosity=detailed $SolutionFile
Expand Down Expand Up @@ -167,8 +144,6 @@ if (-not $NoRestore) {
}

if (-not $NoBuild) {
Update-VersionConstantsFiles
Update-VsixManifests
Copy link

@ghost ghost Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VsixManifests [](start = 11, length = 13)

Yay! #Closed

Copy link

@ghost ghost Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VsixManifests [](start = 11, length = 13)

Remove the functions since they are no longer called. #Closed

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reactivating. As of iteration 10, these functions are still defined. Everything from lines 68-90 can go away.


In reply to: 521542752 [](ancestors = 521542752)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just removed! :)


In reply to: 521587394 [](ancestors = 521587394,521542752)

Invoke-Build
}

Expand Down
25 changes: 0 additions & 25 deletions scripts/Get-VersionConstants.ps1

This file was deleted.

40 changes: 0 additions & 40 deletions scripts/New-VersionConstantsFile.ps1

This file was deleted.

11 changes: 3 additions & 8 deletions scripts/ScriptUtilities.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,10 @@ function New-NuGetPackageFromNuspecFile($configuration, $project, $version, $fra
}

function New-NuGetPackages($configuration, $projects, $frameworks) {
$versionPrefix, $versionSuffix = & $PSScriptRoot\Get-VersionConstants.ps1
Copy link

@ghost ghost Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get-VersionConstants.ps1 [](start = 53, length = 24)

The file Get-VersionConstants.ps1 should no longer be needed and can be removed. (If it is still needed, then we missed something.) #Closed

if ($versionSuffix)
{
$version = "$versionPrefix-$versionSuffix"
} else {
$version = $versionPrefix
}

dotnet tool install --global nbgv --version 3.3.37
$version = nbgv get-version --project src --variable Version
foreach ($project in $Projects.NuGet) {
Write-Information $project
foreach ($framework in $frameworks) {
New-NuGetPackageFromNuSpecFile $configuration $project $version $framework
}
Expand Down
5 changes: 0 additions & 5 deletions src/Sarif.Sarifer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
using System.Reflection;
using System.Resources;

using Microsoft.CodeAnalysis.Sarif.Sarifer;

[assembly: AssemblyTitle("Sarifer test data producer extension for Visual Studio")]
[assembly: AssemblyDescription("Generates test data in SARIF format and provides it to the SARIF viewer extension, upon which it depends.")]

[assembly: NeutralResourcesLanguage("en")]

[assembly: AssemblyVersion(VersionConstants.FileVersion)]
[assembly: AssemblyFileVersion(VersionConstants.FileVersion)]
Copy link

@ghost ghost Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VersionConstants [](start = 31, length = 16)

Remove all the VersionConstants.cs files from the solution. #Closed

13 changes: 0 additions & 13 deletions src/Sarif.Sarifer/Properties/VersionConstants.cs

This file was deleted.

6 changes: 5 additions & 1 deletion src/Sarif.Sarifer/Sarif.Sarifer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="15.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Shell.15.0" Version="15.7.27703" />
<PackageReference Include="Nerdbank.GitVersioning">
<Version>3.3.37</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Compile Include="GenerateTestDataCommand.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\VersionConstants.cs" />
<Compile Include="Guids.cs" />
<Compile Include="FileAndForgetEventName.cs" />
<Compile Include="SariferPackageCommandIds.cs" />
Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Sarifer/SariferPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Microsoft.CodeAnalysis.Sarif.Sarifer
/// provided by the Managed Package Framework (MPF).
/// </summary>
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
[InstalledProductRegistration("#110", "#112", VersionConstants.AssemblyVersion, IconResourceID = 400)]
[InstalledProductRegistration("#110", "#112", ThisAssembly.AssemblyFileVersion, IconResourceID = 400)]
[Guid(PackageGuidString)]
[ProvideMenuResource("Menus.ctmenu", 1)]
[ComVisible(true)]
Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Sarifer/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Licensed under the MIT license. See LICENSE file in the project root for full li
-->
<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="2ec87711-16c7-4a58-8e1d-453f805ce112" Version="2.1.20" Language="en-US" Publisher="Microsoft Corporation" />
<Identity Id="2ec87711-16c7-4a58-8e1d-453f805ce112" Version="|%CurrentProject%;GetBuildVersion|" Language="en-US" Publisher="Microsoft Corporation" />
<DisplayName>Sarifer</DisplayName>
<Description xml:space="preserve">Sends test SARIF data to the SARIF Viewer extension.</Description>
<Icon>Resources\Package.ico</Icon>
Expand Down
15 changes: 0 additions & 15 deletions src/Sarif.Viewer.VisualStudio.Interop/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
using System.Reflection;
using System.Runtime.InteropServices;

using Microsoft.CodeAnalysis.Sarif.Viewer.VisualStudio.Interop;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
Expand All @@ -20,16 +18,3 @@

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("9d407555-d268-461e-bfaf-4251b0fbf7c9")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// 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(VersionConstants.FileVersion)]
[assembly: AssemblyFileVersion(VersionConstants.FileVersion)]

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="15.0.1" />
<PackageReference Include="Nerdbank.GitVersioning">
<Version>3.3.37</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<!-- Necessary to resolve version conflict on Newtonsoft.Json: -->
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
</ItemGroup>
Expand All @@ -40,7 +45,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\VersionConstants.cs" />
<Compile Include="SarifViewerInterop.cs" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,4 @@

using System.Reflection;

using Microsoft.CodeAnalysis.Sarif.Viewer.VisualStudio.UnitTests;

[assembly: AssemblyTitle("Unit Tests for Microsoft SARIF Viewer for Visual Studio")]

[assembly: AssemblyVersion(VersionConstants.FileVersion)]
[assembly: AssemblyFileVersion(VersionConstants.FileVersion)]
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
<Compile Include="ThreadFlowToTreeConverterTests.cs" />
<Compile Include="Models\CallTreeNodeTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\VersionConstants.cs" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
Expand Down
2 changes: 1 addition & 1 deletion src/Sarif.Viewer.VisualStudio.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
..\BuildAndTest.cmd = ..\BuildAndTest.cmd
..\scripts\BuildAndTest.ps1 = ..\scripts\BuildAndTest.ps1
..\scripts\BuildPackagesFromSigningDirectory.ps1 = ..\scripts\BuildPackagesFromSigningDirectory.ps1
..\scripts\Get-VersionConstants.ps1 = ..\scripts\Get-VersionConstants.ps1
..\scripts\New-AtomXml.ps1 = ..\scripts\New-AtomXml.ps1
..\scripts\New-VersionConstantsFile.ps1 = ..\scripts\New-VersionConstantsFile.ps1
..\scripts\Projects.psm1 = ..\scripts\Projects.psm1
Expand All @@ -22,6 +21,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
..\scripts\Run-Tests.ps1 = ..\scripts\Run-Tests.ps1
..\scripts\ScriptUtilities.psm1 = ..\scripts\ScriptUtilities.psm1
..\scripts\Unzip.ps1 = ..\scripts\Unzip.ps1
version.json = version.json
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sarif.Viewer.VisualStudio.Interop", "Sarif.Viewer.VisualStudio.Interop\Sarif.Viewer.VisualStudio.Interop.csproj", "{9D407555-D268-461E-BFAF-4251B0FBF7C9}"
Expand Down
5 changes: 0 additions & 5 deletions src/Sarif.Viewer.VisualStudio/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@
using System.Resources;
using System.Runtime.CompilerServices;

using Microsoft.CodeAnalysis.Sarif.Viewer.VisualStudio;

[assembly: AssemblyTitle("Microsoft SARIF Viewer for Visual Studio")]
[assembly: AssemblyDescription("Visual Studio Extension for viewing SARIF log files")]

[assembly: NeutralResourcesLanguage("en")]

[assembly: AssemblyVersion(VersionConstants.FileVersion)]
[assembly: AssemblyFileVersion(VersionConstants.FileVersion)]

[assembly: InternalsVisibleTo("Sarif.Viewer.VisualStudio.Tests.Apex, PublicKey=0024000004800000940000000602000000240000525341310004000001000100433fbf156abe9718142bdbd48a440e779a1b708fd21486ee0ae536f4c548edf8a7185c1e3ac89ceef76c15b8cc2497906798779a59402f9b9e27281fb15e7111566cdc9a9f8326301d45320623c5222089cf4d0013f365ae729fb0a9c9d15138042825cd511a0f3d4887a7b92f4c2749f81b410813d297b73244cf64995effb1")]
[assembly: InternalsVisibleTo("Sarif.Viewer.VisualStudio.UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100433fbf156abe9718142bdbd48a440e779a1b708fd21486ee0ae536f4c548edf8a7185c1e3ac89ceef76c15b8cc2497906798779a59402f9b9e27281fb15e7111566cdc9a9f8326301d45320623c5222089cf4d0013f365ae729fb0a9c9d15138042825cd511a0f3d4887a7b92f4c2749f81b410813d297b73244cf64995effb1")]
13 changes: 0 additions & 13 deletions src/Sarif.Viewer.VisualStudio/Properties/VersionConstants.cs

This file was deleted.

12 changes: 11 additions & 1 deletion src/Sarif.Viewer.VisualStudio/Sarif.Viewer.VisualStudio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<!-- Hack: https://github.com/dotnet/Nerdbank.GitVersioning/issues/404, since its a vsix with pages -->
<Import Project="$(MSBuildProjectExtensionsPath)$(_TargetAssemblyProjectName)$(MSBuildProjectExtension).nuget.g.props"
Copy link
Collaborator Author

@eddynaka eddynaka Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hack: dotnet/Nerdbank.GitVersioning#404, since its a vsix with pages #Closed

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this comment to the project file itself.


In reply to: 521584147 [](ancestors = 521584147)

Condition=" '$(_TargetAssemblyProjectName)' != '' and '$(ImportProjectExtensionProps)' != 'false' and exists('$(MSBuildProjectExtensionsPath)$(_TargetAssemblyProjectName)$(MSBuildProjectExtension).nuget.g.props')" />
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
Expand Down Expand Up @@ -34,6 +37,11 @@
<!-- Necessary to provide TaskStatusCenter and ITextViewCreationListener: -->
<PackageReference Include="Microsoft.VisualStudio.Shell.15.0" Version="15.7.27703" />
<PackageReference Include="Microsoft.VisualStudio.Text.UI" Version="15.8.525" />
<PackageReference Include="Nerdbank.GitVersioning">
<Version>3.3.37</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Sarif.Sdk" Version="2.3.6" />
<PackageReference Include="Sarif.Converters" Version="2.3.6" />
<!-- Necessary to resolve version conflict on Newtonsoft.Json: -->
Expand All @@ -48,7 +56,6 @@
<Compile Include="Fixes\ProjectionBufferFactoryServiceExtensions.cs" />
<Compile Include="Fixes\ReplacementEdit.cs" />
<Compile Include="Fixes\SizeToFitHelper.cs" />
<Compile Include="Properties\VersionConstants.cs" />
<Compile Include="CodeAnalysisResultManager.cs" />
<Compile Include="CodeFlowToTreeConverter.cs" />
<Compile Include="CodeLocationObjectTypeDescriptor.cs" />
Expand Down Expand Up @@ -330,4 +337,7 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<!-- Hack: https://github.com/dotnet/Nerdbank.GitVersioning/issues/404, since its a vsix with pages -->
<Import Project="$(MSBuildProjectExtensionsPath)$(_TargetAssemblyProjectName)$(MSBuildProjectExtension).nuget.g.targets"
Copy link
Collaborator Author

@eddynaka eddynaka Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hack: dotnet/Nerdbank.GitVersioning#404, since its a vsix with pages #Closed

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this comment to the project file itself.


In reply to: 521584272 [](ancestors = 521584272)

Condition=" '$(_TargetAssemblyProjectName)' != '' and '$(ImportProjectExtensionProps)' != 'false' and exists('$(MSBuildProjectExtensionsPath)$(_TargetAssemblyProjectName)$(MSBuildProjectExtension).nuget.g.targets')" />
</Project>
3 changes: 1 addition & 2 deletions src/Sarif.Viewer.VisualStudio/SarifViewerPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Runtime.InteropServices;
using System.Threading;

using Microsoft.CodeAnalysis.Sarif.Viewer.VisualStudio;
using Microsoft.Sarif.Viewer.ErrorList;
using Microsoft.Sarif.Viewer.Services;
using Microsoft.Sarif.Viewer.Tags;
Expand All @@ -23,7 +22,7 @@ namespace Microsoft.Sarif.Viewer
/// This is the class that implements the package exposed by this assembly.
/// </summary>
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
[InstalledProductRegistration("#110", "#112", VersionConstants.AssemblyVersion, IconResourceID = 400)] // Info on this package for Help/About
[InstalledProductRegistration("#110", "#112", ThisAssembly.AssemblyFileVersion, IconResourceID = 400)] // Info on this package for Help/About
[Guid(PackageGuidString)]
[ProvideMenuResource("Menus.ctmenu", 1)]
[ProvideToolWindow(typeof(SarifExplorerWindow), Style = VsDockStyle.Tabbed, Window = "3ae79031-e1bc-11d0-8f78-00a0c9110057", Transient = true)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<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="Microsoft.Sarif.Viewer.Michael C. Fanning.f17e897a-fd38-4e1f-99db-19fa34a4e184" Version="2.1.20" Language="en-US" Publisher="Microsoft DevLabs" />
<Identity Id="Microsoft.Sarif.Viewer.Michael C. Fanning.f17e897a-fd38-4e1f-99db-19fa34a4e184" Version="|%CurrentProject%;GetBuildVersion|" Language="en-US" Publisher="Microsoft DevLabs" />
<DisplayName>Microsoft SARIF Viewer</DisplayName>
<Description xml:space="preserve">Visual Studio Static Analysis Results Interchange Format (SARIF) log file viewer</Description>
<License>License.txt</License>
Expand Down
5 changes: 0 additions & 5 deletions src/build.props
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<PropertyGroup Label="AssemblyAttributes">
<VersionPrefix Condition=" '$(VersionPrefix)' == ''">2.1.20</VersionPrefix>
<VersionSuffix Condition=" '$(VersionSuffix)' == ''"></VersionSuffix>
</PropertyGroup>

<!-- Configuration specific properties -->
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' " Label="Debug build">
<DebugType>full</DebugType>
Expand Down
Loading