Skip to content

Commit d136870

Browse files
major refactor
Updates sharpraven to the last version strong sign sharpraven and the remaining assemblies removes one msbuild target as it has become obsolete (Custom.Before) Fixes a few bugs with the linqpad script creation updates to the latest version of JSON.NET
1 parent 245115b commit d136870

25 files changed

+200
-155
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "Lib/SharpRaven"]
22
path = Lib/SharpRaven
3-
url = https://github.com/getsentry/raven-csharp
3+
url = https://github.com/codingadventures/raven-csharp

Src/BridgeVs.Build/BridgeVs.Build.csproj

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@
3131
<PlatformTarget>AnyCPU</PlatformTarget>
3232
<Optimize>true</Optimize>
3333
</PropertyGroup>
34+
<PropertyGroup>
35+
<SignAssembly>true</SignAssembly>
36+
</PropertyGroup>
37+
<PropertyGroup>
38+
<AssemblyOriginatorKeyFile>..\BridgeVs.VsPackage\Key.snk</AssemblyOriginatorKeyFile>
39+
</PropertyGroup>
3440
<ItemGroup>
3541
<Compile Include="Dependency\Crawler.cs" />
3642
<Compile Include="Dependency\ProjectDependency.cs" />
@@ -47,7 +53,7 @@
4753
</ItemGroup>
4854
<ItemGroup>
4955
<ProjectReference Include="..\..\Lib\SharpRaven\src\app\SharpRaven\SharpRaven.csproj">
50-
<Project>{d472fc40-284f-4532-a269-be7bdac2b153}</Project>
56+
<Project>{36fcaf4d-911d-41a8-8303-e31527d3149f}</Project>
5157
<Name>SharpRaven</Name>
5258
</ProjectReference>
5359
<ProjectReference Include="..\BridgeVs.Locations\BridgeVs.Shared.csproj">
@@ -74,7 +80,7 @@
7480
<HintPath>..\packages\Mono.Cecil.0.10.0\lib\net40\Mono.Cecil.Rocks.dll</HintPath>
7581
</Reference>
7682
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
77-
<HintPath>..\packages\Newtonsoft.Json.11.0.1\lib\net40\Newtonsoft.Json.dll</HintPath>
83+
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net40\Newtonsoft.Json.dll</HintPath>
7884
</Reference>
7985
<Reference Include="System" />
8086
<Reference Include="System.Configuration" />

Src/BridgeVs.Build/Tasks/CleanBuildTask.cs

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
using System.IO;
2727
using BridgeVs.Build.Util;
28+
using BridgeVs.Shared.Common;
2829
using BridgeVs.Shared.Locations;
2930
using BridgeVs.Shared.Logging;
3031
using Microsoft.Build.Framework;
@@ -33,10 +34,27 @@ namespace BridgeVs.Build.Tasks
3334
{
3435
public class CleanBuildTask : ITask
3536
{
37+
[Required]
38+
public string VisualStudioVer { private get; set; }
39+
40+
[Required]
41+
public string Assembly { private get; set; }
42+
43+
[Required]
44+
public string SolutionName { get; set; }
45+
46+
public IBuildEngine BuildEngine { get; set; }
47+
public ITaskHost HostObject { get; set; }
48+
3649
public bool Execute()
3750
{
3851
Log.VisualStudioVersion = VisualStudioVer;
3952

53+
if (!CommonRegistryConfigurations.IsSolutionEnabled(SolutionName, VisualStudioVer))
54+
{
55+
return true;
56+
}
57+
4058
try
4159
{
4260
string visualizerAssemblyName = VisualizerAssemblyNameFormat.GetTargetVisualizerAssemblyName(VisualStudioVer, Assembly);
@@ -62,14 +80,5 @@ public bool Execute()
6280

6381
return true;
6482
}
65-
66-
[Required]
67-
public string VisualStudioVer { private get; set; }
68-
69-
[Required]
70-
public string Assembly { private get; set; }
71-
72-
public IBuildEngine BuildEngine { get; set; }
73-
public ITaskHost HostObject { get; set; }
7483
}
7584
}

Src/BridgeVs.Build/Tasks/MapperBuildTask.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,16 @@
2323
// OTHER DEALINGS IN THE SOFTWARE.
2424
#endregion
2525

26-
using System;
27-
using System.Collections.Generic;
28-
using System.IO;
29-
using System.Linq;
3026
using BridgeVs.Build.TypeMapper;
3127
using BridgeVs.Build.Util;
28+
using BridgeVs.Shared.Common;
3229
using BridgeVs.Shared.Locations;
3330
using BridgeVs.Shared.Logging;
3431
using Microsoft.Build.Framework;
32+
using System;
33+
using System.Collections.Generic;
34+
using System.IO;
35+
using System.Linq;
3536

3637
namespace BridgeVs.Build.Tasks
3738
{
@@ -45,6 +46,9 @@ public class MapperBuildTask : ITask
4546
[Required]
4647
public string VisualStudioVer { private get; set; }
4748

49+
[Required]
50+
public string SolutionName { get; set; }
51+
4852
private string TargetVisualizerAssemblyName
4953
=> VisualizerAssemblyNameFormat.GetTargetVisualizerAssemblyName(VisualStudioVer, Assembly);
5054
private string DotNetVisualizerAssemblyName
@@ -67,6 +71,11 @@ public bool Execute()
6771
{
6872
Log.VisualStudioVersion = VisualStudioVer;
6973

74+
if (!CommonRegistryConfigurations.IsSolutionEnabled(SolutionName, VisualStudioVer))
75+
{
76+
return true;
77+
}
78+
7079
try
7180
{
7281
//this is where the current assembly being built is saved

Src/BridgeVs.Build/Tasks/SInjectionBuildTask.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
using System;
2727
using System.IO;
28+
using BridgeVs.Shared.Common;
2829
using BridgeVs.Shared.Logging;
2930
using Microsoft.Build.Framework;
3031

@@ -41,14 +42,22 @@ public class SInjectionBuildTask : ITask
4142
[Required]
4243
public string Snk { get; set; }
4344

45+
[Required]
46+
public string SolutionName { get; set; }
47+
4448
public bool Execute()
4549
{
4650
Log.VisualStudioVersion = VisualStudioVer;
4751

52+
if (!CommonRegistryConfigurations.IsSolutionEnabled(SolutionName, VisualStudioVer))
53+
{
54+
return true;
55+
}
56+
4857
try
4958
{
5059
string snkCertificate = File.Exists(Snk) ? Snk : null;
51-
var sInjection = new SInjection(Assembly, snkCertificate);
60+
SInjection sInjection = new SInjection(Assembly, snkCertificate);
5261
return sInjection.Patch(SerializationTypes.BinarySerialization);
5362
}
5463
catch (Exception e)

Src/BridgeVs.Build/TypeMapper/VisualizerAttributeInjector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ bool baseTypeFilter(TypeDefinition typeDef, string toCompare)
130130

131131
private void RemapAssembly()
132132
{
133-
var microsoftDebuggerVisualizerAssembly = _debuggerVisualizerAssembly.MainModule.AssemblyReferences.First(p => p.Name == "Microsoft.VisualStudio.DebuggerVisualizers");
133+
AssemblyNameReference microsoftDebuggerVisualizerAssembly = _debuggerVisualizerAssembly.MainModule.AssemblyReferences.First(p => p.Name == "Microsoft.VisualStudio.DebuggerVisualizers");
134134

135135
if (microsoftDebuggerVisualizerAssembly.Version.Major == _targetVsVersion)
136136
return;

Src/BridgeVs.Build/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Mono.Cecil" version="0.10.0" targetFramework="net40" />
4-
<package id="Newtonsoft.Json" version="11.0.1" targetFramework="net40" />
4+
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net40" />
55
</packages>

Src/BridgeVs.DynamicVisualizers/BridgeVs.DynamicVisualizers.csproj

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
<ErrorReport>prompt</ErrorReport>
2424
<WarningLevel>4</WarningLevel>
2525
</PropertyGroup>
26+
<PropertyGroup>
27+
<SignAssembly>true</SignAssembly>
28+
</PropertyGroup>
29+
<PropertyGroup>
30+
<AssemblyOriginatorKeyFile>..\BridgeVs.VsPackage\Key.snk</AssemblyOriginatorKeyFile>
31+
</PropertyGroup>
2632
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Test|AnyCPU' ">
2733
<DebugType>full</DebugType>
2834
<Optimize>false</Optimize>
@@ -47,7 +53,11 @@
4753
<HintPath>..\..\Lib\VS2017\Microsoft.VisualStudio.DebuggerVisualizers.dll</HintPath>
4854
<Private>True</Private>
4955
</Reference>
56+
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
57+
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net40\Newtonsoft.Json.dll</HintPath>
58+
</Reference>
5059
<Reference Include="System" />
60+
<Reference Include="System.Configuration" />
5161
<Reference Include="System.Core" />
5262
<Reference Include="System.Data" />
5363
<Reference Include="System.Drawing" />
@@ -96,7 +106,7 @@
96106
</ItemGroup>
97107
<ItemGroup>
98108
<ProjectReference Include="..\..\Lib\SharpRaven\src\app\SharpRaven\SharpRaven.csproj">
99-
<Project>{d472fc40-284f-4532-a269-be7bdac2b153}</Project>
109+
<Project>{36fcaf4d-911d-41a8-8303-e31527d3149f}</Project>
100110
<Name>SharpRaven</Name>
101111
</ProjectReference>
102112
<ProjectReference Include="..\BridgeVs.Locations\BridgeVs.Shared.csproj">

Src/BridgeVs.DynamicVisualizers/Template/Inspection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public virtual string TransformText()
3434
<Namespace>System.Dynamic</Namespace>
3535
<Namespace>System.Runtime.Serialization.Formatters</Namespace>
3636
<Namespace>System.Xml.Linq</Namespace>
37-
<Namespace>BridgeVs.Shared.Grapple</Namespace>
37+
<Namespace>BridgeVs.Shared.Serialization</Namespace>
3838
<Namespace>BridgeVs.Shared</Namespace>
3939
<Namespace>BridgeVs.Shared.Options</Namespace>
4040
<Namespace>");
@@ -47,7 +47,7 @@ public virtual string TransformText()
4747
this.Write("</Namespace>\r\n ");
4848

4949
#line 17 "C:\Users\Jarvis\Documents\GitHub\LINQBridgeVs\Src\BridgeVs.DynamicVisualizers\Template\Inspection.tt"
50-
foreach(var elem in this._assemblies) {
50+
foreach(var elem in this._assemblies.Distinct()) {
5151
if (!elem.Contains("mscorlib")){
5252

5353
#line default

Src/BridgeVs.DynamicVisualizers/Template/Inspection.tt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
<Namespace>System.Dynamic</Namespace>
1111
<Namespace>System.Runtime.Serialization.Formatters</Namespace>
1212
<Namespace>System.Xml.Linq</Namespace>
13-
<Namespace>BridgeVs.Shared.Grapple</Namespace>
13+
<Namespace>BridgeVs.Shared.Serialization</Namespace>
1414
<Namespace>BridgeVs.Shared</Namespace>
1515
<Namespace>BridgeVs.Shared.Options</Namespace>
1616
<Namespace><#= _typeNamespace #></Namespace>
17-
<# foreach(var elem in this._assemblies) {
17+
<# foreach(var elem in this._assemblies.Distinct()) {
1818
if (!elem.Contains("mscorlib")){#>
1919
<Reference><#=elem#></Reference>
2020
<#}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3+
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net40" />
34
<package id="System.IO.Abstractions" version="2.1.0.233" targetFramework="net40" />
45
</packages>

Src/BridgeVs.Locations/BridgeVs.Shared.csproj

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<ItemGroup>
4949
<Reference Include="Microsoft.CSharp" />
5050
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
51-
<HintPath>..\packages\Newtonsoft.Json.11.0.1\lib\net40\Newtonsoft.Json.dll</HintPath>
51+
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net40\Newtonsoft.Json.dll</HintPath>
5252
</Reference>
5353
<Reference Include="System" />
5454
<Reference Include="System.Configuration" />
@@ -74,14 +74,15 @@
7474
<Compile Include="Serialization\Truck.cs" />
7575
<Compile Include="Options\Defaults.cs" />
7676
</ItemGroup>
77+
<ItemGroup>
78+
<None Include="app.config" />
79+
<None Include="packages.config" />
80+
</ItemGroup>
7781
<ItemGroup>
7882
<ProjectReference Include="..\..\Lib\SharpRaven\src\app\SharpRaven\SharpRaven.csproj">
79-
<Project>{d472fc40-284f-4532-a269-be7bdac2b153}</Project>
83+
<Project>{36fcaf4d-911d-41a8-8303-e31527d3149f}</Project>
8084
<Name>SharpRaven</Name>
8185
</ProjectReference>
8286
</ItemGroup>
83-
<ItemGroup>
84-
<None Include="packages.config" />
85-
</ItemGroup>
8687
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
8788
</Project>

Src/BridgeVs.Locations/Common/CommonFolderPaths.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ namespace BridgeVs.Shared.Common
3737
public static class CommonFolderPaths
3838
{
3939
private const string CustomAfterTargets = @"Targets\Custom.After.Microsoft.Common.targets";
40-
private const string CustomBeforeTargets = @"Targets\Custom.Before.Microsoft.Common.targets";
4140

4241
public static readonly string ProgramFilesFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
4342
private static readonly string SpecialWindowsFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.Windows);
@@ -68,9 +67,6 @@ public static class CommonFolderPaths
6867
public static readonly string CustomAfterTargetFileNamePath = Path.Combine(InstallFolder, CustomAfterTargets);
6968
public static readonly string CustomAfterTargetFileName = Path.GetFileName(CustomAfterTargets);
7069

71-
public static readonly string CustomBeforeTargetFileNamePath = Path.Combine(InstallFolder, CustomBeforeTargets);
72-
public static readonly string CustomBeforeTargetFileName = Path.GetFileName(CustomBeforeTargets);
73-
7470
public static readonly string MsBuildPath = Path.Combine(ProgramFilesFolderPath, "MSBuild");
7571

7672
public static readonly string MsBuildPath2017 = Path.Combine(ProgramFilesFolderPath, $@"{VisualStudio2017Path}\{{0}}\MSBuild");

0 commit comments

Comments
 (0)