Skip to content

Commit

Permalink
Remove thirdparty folder
Browse files Browse the repository at this point in the history
  • Loading branch information
ThadHouse committed Feb 24, 2024
1 parent 892fbc0 commit a095098
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 16 deletions.
6 changes: 1 addition & 5 deletions WPILib.sln
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wpiutil.test", "test\wpiuti
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wpilibsharp", "src\wpilibsharp\wpilibsharp.csproj", "{AA0BE2D8-DCE2-415C-A60B-4382F50D8C91}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "thirdparty", "thirdparty", "{822627EF-820D-488B-BC14-BDC4BA88454B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stereologue", "src\thirdparty\Stereologue\Stereologue.csproj", "{2124D403-17C4-4116-932D-74933812ECE6}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stereologue", "src\Stereologue\Stereologue.csproj", "{2124D403-17C4-4116-932D-74933812ECE6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "stereologue.test", "test\stereologue.test\stereologue.test.csproj", "{630D08FD-CD06-4674-BC5A-F1F211619E83}"
EndProject
Expand Down Expand Up @@ -137,8 +135,6 @@ Global
{FA3D5F6A-561C-4F12-AE91-B10AE11F7BB8} = {AD95ECD8-E708-4FB4-9B7E-A8A8EF3FCB3E}
{4EF1913A-C495-491D-9783-D758E4723170} = {AD95ECD8-E708-4FB4-9B7E-A8A8EF3FCB3E}
{AA0BE2D8-DCE2-415C-A60B-4382F50D8C91} = {DB664556-4BF0-4874-8CB6-DC24E60A67AF}
{822627EF-820D-488B-BC14-BDC4BA88454B} = {DB664556-4BF0-4874-8CB6-DC24E60A67AF}
{2124D403-17C4-4116-932D-74933812ECE6} = {822627EF-820D-488B-BC14-BDC4BA88454B}
{630D08FD-CD06-4674-BC5A-F1F211619E83} = {AD95ECD8-E708-4FB4-9B7E-A8A8EF3FCB3E}
{76F4D0AE-2123-493B-B721-4118330C52BB} = {909FC1DB-3083-4F01-8496-B8C9DD4FEA13}
{42E0EFC6-4990-4395-A9D1-8683778751E7} = {909FC1DB-3083-4F01-8496-B8C9DD4FEA13}
Expand Down
2 changes: 1 addition & 1 deletion codehelp/CodeHelpers.Test/CodeHelpers.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2" />
<ProjectReference Include="..\CodeHelpers\WPILib.CodeHelpers.csproj"/>
<ProjectReference Include="..\..\src\thirdparty\Stereologue\Stereologue.csproj" />
<ProjectReference Include="..\..\src\Stereologue\Stereologue.csproj" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.8.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace WPILib.CodeHelpers.LogGenerator.Analyzer;

[DiagnosticAnalyzer(LanguageNames.CSharp)]
[DiagnosticAnalyzer(LanguageNames.CSharp, [LanguageNames.VisualBasic])]
public sealed class LogGeneratorAnalyzer : DiagnosticAnalyzer
{
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create([
Expand Down
20 changes: 17 additions & 3 deletions codehelp/CodeHelpers/LogGenerator/LoggableMember.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,28 @@ public FailureMode WriteLogCall(IndentedStringBuilder? builder)
{
nullCheck = "?";
}
builder.AppendFullLine($"{getOperation}{nullCheck}.{Strings.UpdateStereologueName}($\"{{path}}/{path}\", logger);");
string semi = builder.Language == LanguageKind.VisualBasic ? "" : ";";
builder.AppendFullLine($"{getOperation}{nullCheck}.{Strings.UpdateStereologueName}($\"{{path}}/{path}\", logger){semi}");
}
else
{
// We're an array, loop
builder.AppendFullLine($"foreach (var __tmpValue in {getOperation})");
if (builder.Language == LanguageKind.CSharp)
{
builder.AppendFullLine($"foreach (var __tmpValue in {getOperation})");
}
else if (builder.Language == LanguageKind.VisualBasic)
{
builder.AppendFullLine($"For Each __tmpValue in {getOperation}");
}
builder.EnterScope(ScopeType.ForEach);
string nullCheck = "";
if (MemberDeclaration.LoggedKind != DeclarationKind.None)
{
nullCheck = "?";
}
builder.AppendFullLine($"__tmpValue{nullCheck}.{Strings.UpdateStereologueName}($\"{{path}}/{path}\", logger);");
string semi = builder.Language == LanguageKind.VisualBasic ? "" : ";";
builder.AppendFullLine($"__tmpValue{nullCheck}.{Strings.UpdateStereologueName}($\"{{path}}/{path}\", logger){semi}");
builder.ExitScope();
}
return FailureMode.None;
Expand Down Expand Up @@ -203,6 +212,11 @@ public FailureMode WriteLogCall(IndentedStringBuilder? builder)
builder.ExitScope(); // If
builder.ExitScope(); // Empty
}
else if (MemberDeclaration.LoggedKind == DeclarationKind.ReadOnlyMemory || MemberDeclaration.LoggedKind == DeclarationKind.Memory)
{
string semi = builder.Language == LanguageKind.VisualBasic ? "" : ";";
builder.AppendFullLine($"logger.{logMethod}($\"{{path}}/{path}\", {AttributeInfo.GetLogTypeString(builder.Language)}, {getOperation}.Span, {AttributeInfo.GetLogLevelString(builder.Language)}){semi}");
}
else
{
string semi = builder.Language == LanguageKind.VisualBasic ? "" : ";";
Expand Down
4 changes: 2 additions & 2 deletions codehelp/CodeHelpers/WPILib.CodeHelpers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

<ItemGroup>
<!-- Include enums used in attributes -->
<Compile Include="$(SolutionDir)src\thirdparty\Stereologue\LogLevel.cs" Link="Production\LogLevel.cs" />
<Compile Include="$(SolutionDir)src\thirdparty\Stereologue\LogType.cs" Link="Production\LogType.cs" />
<Compile Include="$(SolutionDir)src\Stereologue\LogLevel.cs" Link="Production\LogLevel.cs" />
<Compile Include="$(SolutionDir)src\Stereologue\LogType.cs" Link="Production\LogType.cs" />

<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" PrivateAssets="all" />
Expand Down
2 changes: 1 addition & 1 deletion dev/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<ProjectReference Include="..\..\src\ntcore\ntcore.csproj" />
<ProjectReference Include="..\..\src\wpilibsharp\wpilibsharp.csproj" />
<ProjectReference Include="..\..\src\wpiutil\wpiutil.csproj" />
<ProjectReference Include="..\..\src\thirdparty\stereologue\stereologue.csproj" />
<ProjectReference Include="..\..\src\stereologue\stereologue.csproj" />
<ProjectReference Include="$(SolutionDir)codehelp\CodeHelpers\WPILib.CodeHelpers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
</Project>
15 changes: 15 additions & 0 deletions dev/vbTest/Program.vb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Imports System
Imports Stereologue
Imports WPIMath.Geometry

Module Program
Sub Main(args As String())
Expand All @@ -8,8 +9,22 @@ Module Program
End Module

Namespace vbTest
<Stereologue.GenerateLog()> Partial Public Class ExtraLogged
End Class

<Stereologue.GenerateLog()> Partial Public Class LoggedClass
<Stereologue.Log()> Dim x As String
<Stereologue.Log()> Dim y As Integer
<Stereologue.Log()> Dim z As ReadOnlyMemory(Of Long)

<Stereologue.Log()> Dim rot As Rotation2d
<Stereologue.Log()> Dim rotArray As Rotation2d()

<Stereologue.Log()> Dim cls As ExtraLogged
<Stereologue.Log()> Dim classArray As ExtraLogged()

<Stereologue.Log()> Function GetMemory() As ReadOnlyMemory(Of Long)
Return z
End Function
End Class
End Namespace
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\ntcore\ntcore.csproj" />
<ProjectReference Include="..\..\wpiutil\wpiutil.csproj" />
<ProjectReference Include="..\ntcore\ntcore.csproj" />
<ProjectReference Include="..\wpiutil\wpiutil.csproj" />
</ItemGroup>

</Project>
File renamed without changes.
2 changes: 1 addition & 1 deletion test/stereologue.test/stereologue.test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<ProjectReference Include="..\..\src\thirdparty\Stereologue\Stereologue.csproj" />
<ProjectReference Include="..\..\src\Stereologue\Stereologue.csproj" />
<ProjectReference Include="..\..\src\wpimath\wpimath.csproj" />
<ProjectReference Include="..\..\codehelp\CodeHelpers\WPILib.CodeHelpers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
Expand Down

0 comments on commit a095098

Please sign in to comment.