Skip to content

Commit

Permalink
.NET 6 + dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacharyPatten committed Dec 16, 2021
1 parent 869b73c commit c884f41
Show file tree
Hide file tree
Showing 21 changed files with 68 additions and 88 deletions.
16 changes: 5 additions & 11 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@
name: Bug
about: Report a flaw.
title: ''
labels: Bug
labels: bug
assigees: ''
---
<!--
1. Thank you for your interest in Contributing to Towel. :)
2. Keep in mind that Towel does not have a 24/7 staff. Sorry if you do not receive a timely response.
3. Please check other open issues to ensure this issue would not be a duplicate. If it would be a duplicate, consider commenting on the existing issue.
Please include the following:
1. The challenge containing the bug.
2. Detailed information about how to reproduct the bug.
3. Ping (@contributor) the contributor of the challenge.
-->
<!-- Description: Describe the bug. Please include both what you expected to happen and what actually did happen. -->

<!-- Steps: Include how to reproduce the bug. -->

<!-- Screenshots: Consider including screenshots if they would be beneficial. -->

<!-- Context: Please check and link if there are any existing issues that are related to this issue. -->
12 changes: 1 addition & 11 deletions .github/ISSUE_TEMPLATE/enhancement.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@
name: Enhancement
about: Sugguest an improvement.
title: ''
labels: Enhancement
labels: enhancement
assignees: ''
---
<!--
1. Thank you for your interest in Contributing to Towel. :)
2. Keep in mind that Towel does not have a 24/7 staff. Sorry if you do not receive a timely response.
3. Please check other open issues to ensure this issue would not be a duplicate. If it would be a duplicate, consider commenting on the existing issue.
-->
<!-- Description: Describe the enhancement. -->

<!-- Purpose: Elaborate on the benefit that this enhancement would provide. -->

<!-- Context: Please check and link if there are any existing issues that are related to this issue. -->
2 changes: 1 addition & 1 deletion .github/workflows/Continuous Integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
dotnet-version: 6.0.x
- name: dotnet build
run: dotnet build --configuration 'Release'
- name: dotnet test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
dotnet-version: 6.0.x
- name: dotnet test
run: dotnet test --collect:"XPlat Code Coverage"
- name: find coverage.cobertura.xml path
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Towel Deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
dotnet-version: 6.0.x
- name: dotnet pack
run: dotnet pack Sources/Towel/Towel.csproj --configuration Release /p:Version=${{ github.event.release.tag_name }} /p:PackageReleaseNotes="See https://github.com/ZacharyPatten/Towel/releases/tag/${{ github.event.release.tag_name }}"
- name: archive nuget
Expand Down
48 changes: 18 additions & 30 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations":
[
Expand All @@ -10,9 +7,8 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Build BasicsAndExtensions Example [Debug]",
"program": "${workspaceFolder}/Examples/BasicsAndExtensions/bin/Debug/net5.0/BasicsAndExtensions.dll",
"args": [],
"cwd": "${workspaceFolder}/Examples/BasicsAndExtensions/bin/Debug/net5.0",
"program": "${workspaceFolder}/Examples/BasicsAndExtensions/bin/Debug/BasicsAndExtensions.dll",
"cwd": "${workspaceFolder}/Examples/BasicsAndExtensions/bin/Debug",
"console": "externalTerminal",
"stopAtEntry": false
},
Expand All @@ -21,9 +17,8 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Build CommandLine Example [Debug]",
"program": "${workspaceFolder}/Examples/CommandLine/bin/Debug/net5.0/CommandLine.dll",
"args": [],
"cwd": "${workspaceFolder}/Examples/CommandLine/bin/Debug/net5.0",
"program": "${workspaceFolder}/Examples/CommandLine/bin/Debug/CommandLine.dll",
"cwd": "${workspaceFolder}/Examples/CommandLine/bin/Debug",
"console": "externalTerminal",
"stopAtEntry": false
},
Expand All @@ -32,9 +27,8 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Build ConsoleHelpers Example [Debug]",
"program": "${workspaceFolder}/Examples/ConsoleHelpers/bin/Debug/net5.0/ConsoleHelpers.dll",
"args": [],
"cwd": "${workspaceFolder}/Examples/ConsoleHelpers/bin/Debug/net5.0",
"program": "${workspaceFolder}/Examples/ConsoleHelpers/bin/Debug/ConsoleHelpers.dll",
"cwd": "${workspaceFolder}/Examples/ConsoleHelpers/bin/Debug",
"console": "externalTerminal",
"stopAtEntry": false
},
Expand All @@ -43,9 +37,8 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Build Data Structures Example [Debug]",
"program": "${workspaceFolder}/Examples/DataStructures/bin/Debug/net5.0/DataStructures.dll",
"args": [],
"cwd": "${workspaceFolder}/Examples/DataStructures/bin/Debug/net5.0",
"program": "${workspaceFolder}/Examples/DataStructures/bin/Debug/DataStructures.dll",
"cwd": "${workspaceFolder}/Examples/DataStructures/bin/Debug",
"console": "externalTerminal",
"stopAtEntry": false
},
Expand All @@ -54,9 +47,8 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Build GraphSearch Example [Debug]",
"program": "${workspaceFolder}/Examples/GraphSearch/bin/Debug/net5.0/GraphSearch.dll",
"args": [],
"cwd": "${workspaceFolder}/Examples/GraphSearch/bin/Debug/net5.0",
"program": "${workspaceFolder}/Examples/GraphSearch/bin/Debug/GraphSearch.dll",
"cwd": "${workspaceFolder}/Examples/GraphSearch/bin/Debug",
"console": "externalTerminal",
"stopAtEntry": false
},
Expand All @@ -65,9 +57,8 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Build Mathematics Example [Debug]",
"program": "${workspaceFolder}/Examples/Mathematics/bin/Debug/net5.0/Mathematics.dll",
"args": [],
"cwd": "${workspaceFolder}/Examples/Mathematics/bin/Debug/net5.0",
"program": "${workspaceFolder}/Examples/Mathematics/bin/Debug/Mathematics.dll",
"cwd": "${workspaceFolder}/Examples/Mathematics/bin/Debug",
"console": "externalTerminal",
"stopAtEntry": false
},
Expand All @@ -76,9 +67,8 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Build Measurements Example [Debug]",
"program": "${workspaceFolder}/Examples/Measurements/bin/Debug/net5.0/Measurements.dll",
"args": [],
"cwd": "${workspaceFolder}/Examples/Measurements/bin/Debug/net5.0",
"program": "${workspaceFolder}/Examples/Measurements/bin/Debug/Measurements.dll",
"cwd": "${workspaceFolder}/Examples/Measurements/bin/Debug",
"console": "externalTerminal",
"stopAtEntry": false
},
Expand All @@ -87,9 +77,8 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Build OmnitreeGraphicsDemo Example [Debug]",
"program": "${workspaceFolder}/Examples/OmnitreeGraphicsDemo/bin/Debug/net5.0/OmnitreeGraphicsDemo.dll",
"args": [],
"cwd": "${workspaceFolder}/Examples/OmnitreeGraphicsDemo/bin/Debug/net5.0",
"program": "${workspaceFolder}/Examples/OmnitreeGraphicsDemo/bin/Debug/OmnitreeGraphicsDemo.dll",
"cwd": "${workspaceFolder}/Examples/OmnitreeGraphicsDemo/bin/Debug",
"console": "externalTerminal",
"stopAtEntry": false
},
Expand All @@ -98,9 +87,8 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Build TagAttributes Example [Debug]",
"program": "${workspaceFolder}/Examples/TagAttributes/bin/Debug/net5.0/TagAttributes.dll",
"args": [],
"cwd": "${workspaceFolder}/Examples/TagAttributes/bin/Debug/net5.0",
"program": "${workspaceFolder}/Examples/TagAttributes/bin/Debug/TagAttributes.dll",
"cwd": "${workspaceFolder}/Examples/TagAttributes/bin/Debug",
"console": "externalTerminal",
"stopAtEntry": false
},
Expand Down
8 changes: 8 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<RollForward>LatestMajor</RollForward>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion Examples/BasicsAndExtensions/BasicsAndExtensions.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Examples/CommandLine/CommandLine.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<DocumentationFile>CommandLine.xml</DocumentationFile>
<Nullable>enable</Nullable>
Expand Down
2 changes: 1 addition & 1 deletion Examples/ConsoleHelpers/ConsoleHelpers.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Examples/DataStructures/DataStructures.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Examples/GraphSearch/GraphSearch.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Examples/Mathematics/Mathematics.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Examples/Measurements/Measurements.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Examples/OmnitreeGraphicsDemo/OmnitreeGraphicsDemo.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
Expand Down
2 changes: 1 addition & 1 deletion Examples/TagAttributes/TagAttributes.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
34 changes: 17 additions & 17 deletions Sources/Towel/Mathematics/Symbolics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ public override Expression Substitute(string variable, Expression expression) =>
/// <returns>The string represnetation of this expression.</returns>
public override string ToString()
{
if (!(A is Constant) && !(A is Variable))
if (A is not Constant && A is not Variable)
{
return "-(" + A + ")";
}
Expand Down Expand Up @@ -3048,9 +3048,9 @@ internal static void BuildParsableOperationLibrary()
NewExpression newExpression = System.Linq.Expressions.Expression.New(constructorInfo, A);
Func<Expression, Unary> newFunction = System.Linq.Expressions.Expression.Lambda<Func<Expression, Unary>>(newExpression, A).Compile();
string operationName = type.Name;
if (operationName.Contains("+"))
if (operationName.Contains('+'))
{
int index = operationName.LastIndexOf("+");
int index = operationName.LastIndexOf('+');
operationName = operationName[(index + 1)..];
}
ParsableUnaryOperations.Add(operationName.ToLower(), newFunction);
Expand Down Expand Up @@ -3091,9 +3091,9 @@ internal static void BuildParsableOperationLibrary()
NewExpression newExpression = System.Linq.Expressions.Expression.New(constructorInfo, A, B);
Func<Expression, Expression, Binary> newFunction = System.Linq.Expressions.Expression.Lambda<Func<Expression, Expression, Binary>>(newExpression, A, B).Compile();
string operationName = type.Name;
if (operationName.Contains("+"))
if (operationName.Contains('+'))
{
int index = operationName.LastIndexOf("+");
int index = operationName.LastIndexOf('+');
operationName = operationName[(index + 1)..];
}
ParsableBinaryOperations.Add(operationName.ToLower(), newFunction);
Expand Down Expand Up @@ -3128,9 +3128,9 @@ internal static void BuildParsableOperationLibrary()
NewExpression newExpression = System.Linq.Expressions.Expression.New(constructorInfo, A, B, C);
Func<Expression, Expression, Expression, Ternary> newFunction = System.Linq.Expressions.Expression.Lambda<Func<Expression, Expression, Expression, Ternary>>(newExpression, A, B, C).Compile();
string operationName = type.Name;
if (operationName.Contains("+"))
if (operationName.Contains('+'))
{
int index = operationName.LastIndexOf("+");
int index = operationName.LastIndexOf('+');
operationName = operationName[(index + 1)..];
}
ParsableTernaryOperations.Add(operationName.ToLower(), newFunction);
Expand All @@ -3157,9 +3157,9 @@ internal static void BuildParsableOperationLibrary()
NewExpression newExpression = System.Linq.Expressions.Expression.New(constructorInfo, A);
Func<Expression[], Multinary> newFunction = System.Linq.Expressions.Expression.Lambda<Func<Expression[], Multinary>>(newExpression, A).Compile();
string operationName = type.Name;
if (operationName.Contains("+"))
if (operationName.Contains('+'))
{
int index = operationName.LastIndexOf("+");
int index = operationName.LastIndexOf('+');
operationName = operationName[(index + 1)..];
}
ParsableMultinaryOperations.Add(operationName.ToLower(), newFunction);
Expand All @@ -3185,9 +3185,9 @@ internal static void BuildParsableOperationLibrary()
NewExpression newExpression = System.Linq.Expressions.Expression.New(constructorInfo);
Func<KnownConstantOfUnknownType> newFunction = System.Linq.Expressions.Expression.Lambda<Func<KnownConstantOfUnknownType>>(newExpression).Compile();
// string knownConstant = type.ConvertToCsharpSource();
// if (knownConstant.Contains("+"))
// if (knownConstant.Contains('+'))
// {
// int index = knownConstant.LastIndexOf("+");
// int index = knownConstant.LastIndexOf('+');
// knownConstant = knownConstant.Substring(index + 1);
// }
// ParsableKnownConstants.Add(knownConstant.ToLower(), newFunction);
Expand Down Expand Up @@ -3464,7 +3464,7 @@ bool IsUnaryLeftOperator()
}
if (leftSpecialMatch is null)
{
string substring = @string.Substring(0, rightIndex);
string substring = @string[..rightIndex];
return string.IsNullOrWhiteSpace(substring);
}
else if (ParsableRightUnaryOperators!.ContainsKey(leftSpecialMatch.Value)) // This will need to be fixed in the future
Expand Down Expand Up @@ -3559,7 +3559,7 @@ bool IsUnaryRightOperator()
}

// if an operator was found, parse the expression
if (!(@operator is null))
if (@operator is not null)
{
if (isUnaryLeftOperator)
{
Expand All @@ -3570,7 +3570,7 @@ bool IsUnaryRightOperator()
}
else if (isUnaryRightOperator)
{
string a = @string.Substring(0, @operator.Index);
string a = @string[..@operator.Index];
Expression A = Parse(a, tryParse);
expression = ParsableRightUnaryOperators![@operator.Value].Item2(A);
return true;
Expand Down Expand Up @@ -3614,7 +3614,7 @@ internal static bool TryParseParenthesisExpression<T>(string @string, Func<strin
// Check for implicit multiplications to the left of the parenthesis pattern
if (parenthesisMatch.Index > 0)
{
string leftExpression = @string.Substring(0, parenthesisMatch.Index);
string leftExpression = @string[..parenthesisMatch.Index];
expression *= Parse(leftExpression, tryParse);
}

Expand Down Expand Up @@ -3680,7 +3680,7 @@ internal static bool TryParseOperationExpression<T>(string @string, Func<string,
// handle implicit multiplications if any exist
if (operationMatch.Index != 0) // Left
{
Expression A = Parse(@string.Substring(0, operationMatch.Index), tryParse);
Expression A = Parse(@string[..operationMatch.Index], tryParse);
expression *= A;
}
if (operationMatch.Length + operationMatch.Index < @string.Length) // Right
Expand Down Expand Up @@ -3787,7 +3787,7 @@ internal static bool TryParseKnownConstantExpression<T>(string @string, Func<str
// implied multiplications to the left and right
if (knownConstantMatch.Index != 0)
{
Expression A = Parse<T>(@string.Substring(0, knownConstantMatch.Index), tryParse);
Expression A = Parse<T>(@string[..knownConstantMatch.Index], tryParse);
parsedExpression *= A;
}
if (knownConstantMatch.Index < @string.Length - 1)
Expand Down
Loading

0 comments on commit c884f41

Please sign in to comment.