Skip to content
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
30 changes: 20 additions & 10 deletions bin/add-practice-exercise.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,42 @@ $PSNativeCommandUseErrorActionPreference = $true
$exerciseName = (Get-Culture).TextInfo.ToTitleCase($Exercise).Replace("-", "")
$exerciseDir = "exercises/practice/${Exercise}"
$project = "${exerciseDir}/${ExerciseName}.fsproj"
& dotnet new xunit --force -lang "F#" --target-framework-override net9.0 -o $exerciseDir -n $ExerciseName
& dotnet sln exercises/Exercises.sln add $project
& dotnet new xunit --force -lang "F#" --target-framework-override net10.0 -o $exerciseDir -n $ExerciseName
& dotnet sln exercises/Exercises.slnx add --solution-folder "/practice/" $project

# Update project packages
& dotnet remove $project package coverlet.collector
& dotnet add $project package Exercism.Tests --version 0.1.0-beta1
& dotnet add $project package xunit.runner.visualstudio --version 2.4.3
& dotnet add $project package xunit --version 2.4.1
& dotnet add $project package Microsoft.NET.Test.Sdk --version 16.8.3
& dotnet add $project package FsUnit.xUnit --version 4.0.4
& dotnet remove $project package xunit
& dotnet add $project package Microsoft.NET.Test.Sdk --version 18.3.0
& dotnet add $project package xunit.v3 --version 3.2.2
& dotnet add $project package xunit.runner.visualstudio --version 3.1.5
& dotnet add $project package FsUnit.xUnit --version 7.1.1
& dotnet add $project package Exercism.Tests.xunit.v3 --version 0.1.0-beta1

# Add tools
& dotnet new tool-manifest -o $exerciseDir
& dotnet tool install --tool-manifest "${exerciseDir}/.config/dotnet-tools.json" fantomas-tool

# Remove and update files
Remove-Item -Path "${exerciseDir}/Program.fs"
Remove-Item -Path "${exerciseDir}/Tests.fs"
Set-Content -Path "${exerciseDir}/${exerciseName}.fs" -Value "module ${exerciseName}"
Set-Content -Path "${exerciseDir}/.meta/Example.fs" -Value "module ${exerciseName}"

# Fix the project
[xml]$proj = Get-Content $project
$proj = [xml]::new()
$proj.PreserveWhitespace = $true
$proj.Load($project)

$proj.Project.ItemGroup[0].AppendChild($proj.CreateTextNode(" "))
$proj.Project.ItemGroup[0].AppendChild($proj.Project.ItemGroup[0].Compile.CloneNode($true))
$proj.Project.ItemGroup[0].AppendChild($proj.CreateTextNode("`n "))
$proj.Project.ItemGroup[0].Compile[0].Include = "${exerciseName}.fs"
$proj.Project.ItemGroup[0].Compile[1].Include = "${exerciseName}Tests.fs"
$proj.Project.PropertyGroup.RemoveChild($proj.Project.PropertyGroup.SelectSingleNode("//GenerateProgramFile"))
$rootNamespace = $proj.CreateElement("RootNamespace")
$rootNamespace.InnerText="Exercism"
$proj.Project.PropertyGroup.AppendChild($proj.CreateTextNode(" "))
$proj.Project.PropertyGroup.AppendChild($rootNamespace)
$proj.Project.PropertyGroup.AppendChild($proj.CreateTextNode("`n "))
$proj.Save($project)

# Add and run generator (this will update the tests file)
Expand Down
4 changes: 2 additions & 2 deletions bin/test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function Test-Single-Exercise($Exercise, $Exercises) {
function Test-All-Exercises($Exercises) {
try {
Prepare-Exercises $Exercises
Run-Tests "exercises/Exercises.sln"
Run-Tests "exercises/Exercises.slnx"
} finally {
Restore-Exercises $Exercises
}
Expand All @@ -139,7 +139,7 @@ function Build-Generators {

function Test-Refactoring-Exercise-Default-Implementations {
Write-Output "Testing refactoring exercises"
Run-Tests (Join-Path "exercises" "Refactoring.sln")
Run-Tests (Join-Path "exercises" "Refactoring.slnx")
}

function Test-Exercise-Example-Implementations($Exercise) {
Expand Down
1,072 changes: 0 additions & 1,072 deletions exercises/Exercises.sln

This file was deleted.

156 changes: 156 additions & 0 deletions exercises/Exercises.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
<Solution>
<Folder Name="/concept/">
<Project Path="concept/annalyns-infiltration/AnnalynsInfiltration.fsproj" />
<Project Path="concept/bandwagoner/Bandwagoner.fsproj" />
<Project Path="concept/bird-watcher/BirdWatcher.fsproj" />
<Project Path="concept/booking-up-for-beauty/BookingUpForBeauty.fsproj" />
<Project Path="concept/cars-assemble/CarsAssemble.fsproj" />
<Project Path="concept/guessing-game/GuessingGame.fsproj" />
<Project Path="concept/interest-is-interesting/InterestIsInteresting.fsproj" />
<Project Path="concept/log-levels/LogLevels.fsproj" />
<Project Path="concept/lucians-luscious-lasagna/LuciansLusciousLasagna.fsproj" />
<Project Path="concept/pizza-pricing/PizzaPricing.fsproj" />
<Project Path="concept/squeaky-clean/SqueakyClean.fsproj" />
<Project Path="concept/tisbury-treasure-hunt/TisburyTreasureHunt.fsproj" />
<Project Path="concept/tracks-on-tracks-on-tracks/TracksOnTracksOnTracks.fsproj" />
<Project Path="concept/valentines-day/ValentinesDay.fsproj" />
</Folder>
<Folder Name="/practice/">
<Project Path="practice/accumulate/Accumulate.fsproj" />
<Project Path="practice/acronym/Acronym.fsproj" />
<Project Path="practice/affine-cipher/AffineCipher.fsproj" />
<Project Path="practice/all-your-base/AllYourBase.fsproj" />
<Project Path="practice/allergies/Allergies.fsproj" />
<Project Path="practice/alphametics/Alphametics.fsproj" />
<Project Path="practice/anagram/Anagram.fsproj" />
<Project Path="practice/armstrong-numbers/ArmstrongNumbers.fsproj" />
<Project Path="practice/atbash-cipher/AtbashCipher.fsproj" />
<Project Path="practice/bank-account/BankAccount.fsproj" />
<Project Path="practice/beer-song/BeerSong.fsproj" />
<Project Path="practice/binary-search-tree/BinarySearchTree.fsproj" />
<Project Path="practice/binary-search/BinarySearch.fsproj" />
<Project Path="practice/binary/Binary.fsproj" />
<Project Path="practice/bob/Bob.fsproj" />
<Project Path="practice/book-store/BookStore.fsproj" />
<Project Path="practice/bottle-song/BottleSong.fsproj" />
<Project Path="practice/bowling/Bowling.fsproj" />
<Project Path="practice/change/Change.fsproj" />
<Project Path="practice/circular-buffer/CircularBuffer.fsproj" />
<Project Path="practice/clock/Clock.fsproj" />
<Project Path="practice/collatz-conjecture/CollatzConjecture.fsproj" />
<Project Path="practice/complex-numbers/ComplexNumbers.fsproj" />
<Project Path="practice/connect/Connect.fsproj" />
<Project Path="practice/crypto-square/CryptoSquare.fsproj" />
<Project Path="practice/custom-set/CustomSet.fsproj" />
<Project Path="practice/darts/Darts.fsproj" />
<Project Path="practice/diamond/Diamond.fsproj" />
<Project Path="practice/difference-of-squares/DifferenceOfSquares.fsproj" />
<Project Path="practice/diffie-hellman/DiffieHellman.fsproj" />
<Project Path="practice/dnd-character/DndCharacter.fsproj" />
<Project Path="practice/dominoes/Dominoes.fsproj" />
<Project Path="practice/dot-dsl/DotDsl.fsproj" />
<Project Path="practice/eliuds-eggs/EliudsEggs.fsproj" />
<Project Path="practice/error-handling/ErrorHandling.fsproj" />
<Project Path="practice/etl/Etl.fsproj" />
<Project Path="practice/flower-field/FlowerField.fsproj" />
<Project Path="practice/food-chain/FoodChain.fsproj" />
<Project Path="practice/forth/Forth.fsproj" />
<Project Path="practice/game-of-life/GameOfLife.fsproj" />
<Project Path="practice/gigasecond/Gigasecond.fsproj" />
<Project Path="practice/go-counting/GoCounting.fsproj" />
<Project Path="practice/grade-school/GradeSchool.fsproj" />
<Project Path="practice/grains/Grains.fsproj" />
<Project Path="practice/grep/Grep.fsproj" />
<Project Path="practice/hamming/Hamming.fsproj" />
<Project Path="practice/hangman/Hangman.fsproj" />
<Project Path="practice/hello-world/HelloWorld.fsproj" />
<Project Path="practice/hexadecimal/Hexadecimal.fsproj" />
<Project Path="practice/high-scores/HighScores.fsproj" />
<Project Path="practice/house/House.fsproj" />
<Project Path="practice/isbn-verifier/IsbnVerifier.fsproj" />
<Project Path="practice/isogram/Isogram.fsproj" />
<Project Path="practice/killer-sudoku-helper/KillerSudokuHelper.fsproj" />
<Project Path="practice/kindergarten-garden/KindergartenGarden.fsproj" />
<Project Path="practice/knapsack/Knapsack.fsproj" />
<Project Path="practice/largest-series-product/LargestSeriesProduct.fsproj" />
<Project Path="practice/leap/Leap.fsproj" />
<Project Path="practice/ledger/Ledger.fsproj" />
<Project Path="practice/lens-person/LensPerson.fsproj" />
<Project Path="practice/linked-list/LinkedList.fsproj" />
<Project Path="practice/list-ops/ListOps.fsproj" />
<Project Path="practice/luhn/Luhn.fsproj" />
<Project Path="practice/markdown/Markdown.fsproj" />
<Project Path="practice/matching-brackets/MatchingBrackets.fsproj" />
<Project Path="practice/matrix/Matrix.fsproj" />
<Project Path="practice/meetup/Meetup.fsproj" />
<Project Path="practice/minesweeper/Minesweeper.fsproj" />
<Project Path="practice/nth-prime/NthPrime.fsproj" />
<Project Path="practice/nucleotide-count/NucleotideCount.fsproj" />
<Project Path="practice/ocr-numbers/OcrNumbers.fsproj" />
<Project Path="practice/octal/Octal.fsproj" />
<Project Path="practice/palindrome-products/PalindromeProducts.fsproj" />
<Project Path="practice/pangram/Pangram.fsproj" />
<Project Path="practice/parallel-letter-frequency/ParallelLetterFrequency.fsproj" />
<Project Path="practice/pascals-triangle/PascalsTriangle.fsproj" />
<Project Path="practice/perfect-numbers/PerfectNumbers.fsproj" />
<Project Path="practice/phone-number/PhoneNumber.fsproj" />
<Project Path="practice/pig-latin/PigLatin.fsproj" />
<Project Path="practice/poker/Poker.fsproj" />
<Project Path="practice/pov/Pov.fsproj" />
<Project Path="practice/prime-factors/PrimeFactors.fsproj" />
<Project Path="practice/protein-translation/ProteinTranslation.fsproj" />
<Project Path="practice/proverb/Proverb.fsproj" />
<Project Path="practice/pythagorean-triplet/PythagoreanTriplet.fsproj" />
<Project Path="practice/queen-attack/QueenAttack.fsproj" />
<Project Path="practice/rail-fence-cipher/RailFenceCipher.fsproj" />
<Project Path="practice/raindrops/Raindrops.fsproj" />
<Project Path="practice/rational-numbers/RationalNumbers.fsproj" />
<Project Path="practice/react/React.fsproj" />
<Project Path="practice/rectangles/Rectangles.fsproj" />
<Project Path="practice/relative-distance/RelativeDistance.fsproj" />
<Project Path="practice/resistor-color-duo/ResistorColorDuo.fsproj" />
<Project Path="practice/resistor-color-trio/ResistorColorTrio.fsproj" />
<Project Path="practice/resistor-color/ResistorColor.fsproj" />
<Project Path="practice/rest-api/RestApi.fsproj" />
<Project Path="practice/reverse-string/ReverseString.fsproj" />
<Project Path="practice/rna-transcription/RnaTranscription.fsproj" />
<Project Path="practice/robot-name/RobotName.fsproj" />
<Project Path="practice/robot-simulator/RobotSimulator.fsproj" />
<Project Path="practice/roman-numerals/RomanNumerals.fsproj" />
<Project Path="practice/rotational-cipher/RotationalCipher.fsproj" />
<Project Path="practice/run-length-encoding/RunLengthEncoding.fsproj" />
<Project Path="practice/saddle-points/SaddlePoints.fsproj" />
<Project Path="practice/satellite/Satellite.fsproj" />
<Project Path="practice/say/Say.fsproj" />
<Project Path="practice/scale-generator/ScaleGenerator.fsproj" />
<Project Path="practice/scrabble-score/ScrabbleScore.fsproj" />
<Project Path="practice/secret-handshake/SecretHandshake.fsproj" />
<Project Path="practice/series/Series.fsproj" />
<Project Path="practice/sgf-parsing/SgfParsing.fsproj" />
<Project Path="practice/sieve/Sieve.fsproj" />
<Project Path="practice/simple-cipher/SimpleCipher.fsproj" />
<Project Path="practice/simple-linked-list/SimpleLinkedList.fsproj" />
<Project Path="practice/space-age/SpaceAge.fsproj" />
<Project Path="practice/spiral-matrix/SpiralMatrix.fsproj" />
<Project Path="practice/square-root/SquareRoot.fsproj" />
<Project Path="practice/state-of-tic-tac-toe/StateOfTicTacToe.fsproj" />
<Project Path="practice/strain/Strain.fsproj" />
<Project Path="practice/sublist/Sublist.fsproj" />
<Project Path="practice/sum-of-multiples/SumOfMultiples.fsproj" />
<Project Path="practice/tournament/Tournament.fsproj" />
<Project Path="practice/transpose/Transpose.fsproj" />
<Project Path="practice/tree-building/TreeBuilding.fsproj" />
<Project Path="practice/triangle/Triangle.fsproj" />
<Project Path="practice/trinary/Trinary.fsproj" />
<Project Path="practice/twelve-days/TwelveDays.fsproj" />
<Project Path="practice/two-bucket/TwoBucket.fsproj" />
<Project Path="practice/two-fer/TwoFer.fsproj" />
<Project Path="practice/variable-length-quantity/VariableLengthQuantity.fsproj" />
<Project Path="practice/word-count/WordCount.fsproj" />
<Project Path="practice/word-search/WordSearch.fsproj" />
<Project Path="practice/wordy/Wordy.fsproj" />
<Project Path="practice/yacht/Yacht.fsproj" />
<Project Path="practice/zebra-puzzle/ZebraPuzzle.fsproj" />
<Project Path="practice/zipper/Zipper.fsproj" />
</Folder>
</Solution>
41 changes: 0 additions & 41 deletions exercises/Refactoring.sln

This file was deleted.

7 changes: 7 additions & 0 deletions exercises/Refactoring.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Solution>
<Folder Name="/practice/">
<Project Path="practice/ledger/Ledger.fsproj" />
<Project Path="practice/markdown/Markdown.fsproj" />
<Project Path="practice/tree-building/TreeBuilding.fsproj" />
</Folder>
</Solution>
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<IsPackable>false</IsPackable>
<RootNamespace>Exercism</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand All @@ -11,11 +12,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageReference Include="FsUnit.xUnit" Version="4.0.4" />
<PackageReference Include="Exercism.Tests" Version="0.1.0-beta1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="xunit.v3" Version="3.2.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageReference Include="FsUnit.xUnit" Version="7.1.1" />
<PackageReference Include="Exercism.Tests.xunit.v3" Version="0.1.0-beta1" />
</ItemGroup>

</Project>
13 changes: 7 additions & 6 deletions exercises/concept/bandwagoner/Bandwagoner.fsproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<IsPackable>false</IsPackable>
<RootNamespace>Exercism</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand All @@ -11,11 +12,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageReference Include="FsUnit.xUnit" Version="4.0.4" />
<PackageReference Include="Exercism.Tests" Version="0.1.0-beta1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="xunit.v3" Version="3.2.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageReference Include="FsUnit.xUnit" Version="7.1.1" />
<PackageReference Include="Exercism.Tests.xunit.v3" Version="0.1.0-beta1" />
</ItemGroup>

</Project>
13 changes: 7 additions & 6 deletions exercises/concept/bird-watcher/BirdWatcher.fsproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<IsPackable>false</IsPackable>
<RootNamespace>Exercism</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand All @@ -11,11 +12,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageReference Include="FsUnit.xUnit" Version="4.0.4" />
<PackageReference Include="Exercism.Tests" Version="0.1.0-beta1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="xunit.v3" Version="3.2.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageReference Include="FsUnit.xUnit" Version="7.1.1" />
<PackageReference Include="Exercism.Tests.xunit.v3" Version="0.1.0-beta1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<IsPackable>false</IsPackable>
<RootNamespace>Exercism</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand All @@ -11,11 +12,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageReference Include="FsUnit.xUnit" Version="4.0.4" />
<PackageReference Include="Exercism.Tests" Version="0.1.0-beta1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="xunit.v3" Version="3.2.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageReference Include="FsUnit.xUnit" Version="7.1.1" />
<PackageReference Include="Exercism.Tests.xunit.v3" Version="0.1.0-beta1" />
</ItemGroup>

</Project>
Loading