Skip to content

Commit 235dcf8

Browse files
author
i1e0
authored
Update to .NET 6 and simplify fsproj (#17)
1 parent e3da673 commit 235dcf8

File tree

4 files changed

+30
-87
lines changed

4 files changed

+30
-87
lines changed

Algorithms.Tests/Algorithms.Tests.fsproj

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,29 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net5.0</TargetFramework>
5-
<LangVersion>preview</LangVersion>
6-
4+
<TargetFramework>net6.0</TargetFramework>
5+
<LangVersion>latest</LangVersion>
6+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
77
<IsPackable>false</IsPackable>
88
<GenerateProgramFile>false</GenerateProgramFile>
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<Compile Include="Math\FactorialTests.fs" />
13-
<Compile Include="Math\PowerTests.fs" />
14-
<Compile Include="Math\PerfectNumbersTests.fs" />
15-
<Compile Include="Strings\ZFunctionTests.fs" />
16-
<Compile Include="Strings\WordOccurrenceTests.fs" />
17-
<Compile Include="Strings\UpperTests.fs" />
18-
<Compile Include="Strings\SwapCaseTests.fs" />
19-
<Compile Include="Strings\SplitTests.fs" />
20-
<Compile Include="Strings\ReverseWordsTests.fs" />
21-
<Compile Include="Strings\ReverseLettersTests.fs" />
22-
<Compile Include="Strings\RemoveDuplicatesTests.fs" />
23-
<Compile Include="Strings\RabinKarpTests.fs" />
24-
<Compile Include="Strings\PrefixFunctionTests.fs" />
25-
<Compile Include="Strings\NaiveStringSearchTests.fs" />
26-
<Compile Include="Strings\ManacherTests.fs" />
27-
<Compile Include="Strings\MinCostStringConversionTests.fs" />
28-
<Compile Include="Strings\LowerTests.fs" />
29-
<Compile Include="Strings\LevenshteinDistanceTests.fs" />
30-
<Compile Include="Strings\KnuthMorrisPrattTests.fs" />
31-
<Compile Include="Strings\JaroWinklerTests.fs" />
32-
<Compile Include="Strings\IsPalindromeTests.fs" />
33-
<Compile Include="Strings\CheckPangramTests.fs" />
34-
<Compile Include="Strings\CheckAnagramsTests.fs" />
35-
<Compile Include="Strings\CapitalizeTests.fs" />
12+
<Compile Include="Math/*.fs" />
13+
<Compile Include="Search/*.fs" />
14+
<Compile Include="Sort/*.fs" />
15+
<Compile Include="Strings/*.fs" />
3616
<Compile Include="Program.fs" />
3717
</ItemGroup>
3818

3919
<ItemGroup>
40-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
41-
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
42-
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
43-
<PackageReference Include="coverlet.collector" Version="1.3.0" />
20+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
21+
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
22+
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
23+
<PackageReference Include="coverlet.collector" Version="3.1.0">
24+
<PrivateAssets>all</PrivateAssets>
25+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
26+
</PackageReference>
4427
</ItemGroup>
4528

4629
<ItemGroup>

Algorithms/Algorithms.fsproj

Lines changed: 13 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,22 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
3+
34
<PropertyGroup>
4-
<OutputType>Exe</OutputType>
5-
<TargetFramework>net5.0</TargetFramework>
6-
<LangVersion>preview</LangVersion>
5+
<OutputType>Library</OutputType>
6+
<TargetFramework>net6.0</TargetFramework>
7+
<LangVersion>latest</LangVersion>
8+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
79
</PropertyGroup>
10+
811
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
912
<DefineConstants>TRACE</DefineConstants>
1013
</PropertyGroup>
14+
1115
<ItemGroup>
12-
<Compile Include="Math/Abs.fs" />
13-
<Compile Include="Math/AbsMax.fs" />
14-
<Conpile Include="Math/AbsMin.fs" />
15-
<Compile Include="Math/Factorial.fs" />
16-
<Compile Include="Math/Fibonacci.fs" />
17-
<Compile Include="Math/Perfect_Numbers.fs" />
18-
<Compile Include="Math/Power.fs" />
19-
<Compile Include="Sort/Bubble_Sort.fs" />
20-
<Compile Include="Sort/Comb_Sort.fs" />
21-
<Compile Include="Sort/Cycle_Sort.fs" />
22-
<Compile Include="Sort/Gnome_Sort.fs" />
23-
<Compile Include="Sort/Heap_Sort.fs" />
24-
<Compile Include="Sort/Insertion_Sort.fs" />
25-
<Compile Include="Sort/Merge_Sort.fs" />
26-
<Compile Include="Sort/Pancake_Sort.fs" />
27-
<Compile Include="Sort/Quick_Sort.fs" />
28-
<Compile Include="Search/BinarySearch.fs" />
29-
<Compile Include="Strings/Capitalize.fs" />
30-
<Compile Include="Strings/CheckAnagrams.fs" />
31-
<Compile Include="Strings/CheckPangram.fs" />
32-
<Compile Include="Strings/IsPalindrome.fs" />
33-
<Compile Include="Strings/JaroWinkler.fs" />
34-
<Compile Include="Strings/KnuthMorrisPratt.fs" />
35-
<Compile Include="Strings/LevenshteinDistance.fs" />
36-
<Compile Include="Strings/Lower.fs" />
37-
<Compile Include="Strings/Manacher.fs" />
38-
<Compile Include="Strings/MinCostStringConversion.fs" />
39-
<Compile Include="Strings/NaiveStringSearch.fs" />
40-
<Compile Include="Strings/PrefixFunction.fs" />
41-
<Compile Include="Strings/RabinKarp.fs" />
42-
<Compile Include="Strings/RemoveDuplicates.fs" />
43-
<Compile Include="Strings/ReverseLetters.fs" />
44-
<Compile Include="Strings/ReverseWords.fs" />
45-
<Compile Include="Strings/Split.fs" />
46-
<Compile Include="Strings/SwapCase.fs" />
47-
<Compile Include="Strings/Upper.fs" />
48-
<Compile Include="Strings/WordOccurrence.fs" />
49-
<Compile Include="Strings/ZFunction.fs" />
50-
<Compile Include="Program.fs" />
16+
<Compile Include="Math/*.fs" />
17+
<Compile Include="Search/*.fs" />
18+
<Compile Include="Sort/*.fs" />
19+
<Compile Include="Strings/*.fs" />
5120
</ItemGroup>
52-
</Project>
21+
22+
</Project>

Algorithms/Program.fs

Lines changed: 0 additions & 12 deletions
This file was deleted.

Algorithms/Strings/Manacher.fs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ module Manacher =
1818

1919
printfn "%A" newInputString
2020
// Append last character
21-
newInputString <- newInputString + (string) inputString.[^1]
21+
newInputString <-
22+
newInputString
23+
+ string inputString.[inputString.Length - 1]
2224

2325
// We will store the starting and ending of previous furthest ending palindromic
2426
// substring

0 commit comments

Comments
 (0)