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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
44 changes: 28 additions & 16 deletions bin/add-practice-exercise.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,40 @@ $exerciseName = (Get-Culture).TextInfo.ToTitleCase($Exercise).Replace("-", "")
$exerciseDir = "exercises/practice/${Exercise}"
$projectFile = "${exerciseDir}/${ExerciseName}.csproj"
& dotnet new install xunit.v3.templates
& dotnet new xunit3 --force --framework net9.0 --output $exerciseDir --name $ExerciseName
& dotnet sln exercises/Exercises.sln add $projectFile

[xml]$project = Get-Content $projectFile
$project.Project.PropertyGroup.RemoveChild($project.Project.PropertyGroup.SelectSingleNode("//comment()"))
$project.Project.PropertyGroup.RemoveChild($project.Project.PropertyGroup.SelectSingleNode("//RootNamespace"))
$restorePackagesWithLockFileElement = $project.CreateElement("RestorePackagesWithLockFile");
$restorePackagesWithLockFileElement.InnerText = "true"
$project.Project.PropertyGroup.AppendChild($restorePackagesWithLockFileElement)
$project.Project.RemoveChild($project.Project.ItemGroup[0])
$project.Project.ItemGroup[1].SelectSingleNode("PackageReference[@Include='Microsoft.NET.Test.Sdk']").SetAttribute("Version", "17.12.0")
$project.Project.ItemGroup[1].SelectSingleNode("PackageReference[@Include='xunit.v3']").SetAttribute("Version", "1.1.0")
$project.Project.ItemGroup[1].SelectSingleNode("PackageReference[@Include='xunit.runner.visualstudio']").SetAttribute("Version", "3.0.1")
$project.Save($projectFile)

dotnet add $projectFile package Exercism.Tests.xunit.v3 --version 0.1.0-beta1
& dotnet new xunit3 --force --framework net10.0 --output $exerciseDir --name $ExerciseName
& dotnet sln exercises/Exercises.slnx add --solution-folder "/practice/" $projectFile
& dotnet add $projectFile package Exercism.Tests.xunit.v3 --version 0.1.0-beta1
& dotnet remove $projectFile package xunit.v3.mtp-v2
& dotnet add $projectFile package Exercism.Tests.xunit.v3 --version 0.1.0-beta1
& dotnet add $projectFile package xunit.runner.visualstudio --version 3.1.5
& dotnet add $projectFile package xunit.v3 --version 3.2.2
& dotnet add $projectFile package Microsoft.NET.Test.Sdk --version 18.3.0

# Remove and update files
Remove-Item -Path "global.json"
Remove-Item -Path "${exerciseDir}/xunit.runner.json"
Remove-Item -Path "${exerciseDir}/UnitTest1.cs"
(Get-Content -Path ".editorconfig") -Replace "\[\*\.cs\]", "[${exerciseName}.cs]" | Set-Content -Path "${exerciseDir}/.editorconfig"

$project = [xml]::new()
$project.PreserveWhitespace = $true
$project.Load($projectFile)

$restorePackagesWithLockFileElement = $project.CreateElement("RestorePackagesWithLockFile");
$restorePackagesWithLockFileElement.InnerText = "true"
$project.Project.PropertyGroup.AppendChild($project.CreateTextNode(" ")) | Out-Null
$project.Project.PropertyGroup.AppendChild($restorePackagesWithLockFileElement) | Out-Null
$project.Project.PropertyGroup.AppendChild($project.CreateTextNode("`n ")) | Out-Null
$project.Project.PropertyGroup.SelectSingleNode("//RootNamespace").InnerText = "Exercism"
$itemGroup = $project.Project.ItemGroup[0]
$next = $itemGroup.NextSibling
$project.Project.RemoveChild($itemGroup) | Out-Null
if ($next -and $next.NodeType -eq [System.Xml.XmlNodeType]::Whitespace) {
$project.Project.RemoveChild($next) | Out-Null
}

$project.Save($projectFile)

# Create new generator template and run generator (this will update the tests file)
bin/update-tests.ps1 -Exercise $Exercise -New -SyncProbSpecs

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
2,762 changes: 0 additions & 2,762 deletions exercises/Exercises.sln

This file was deleted.

188 changes: 188 additions & 0 deletions exercises/Exercises.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
<Solution>
<Folder Name="/concept/">
<Project Path="concept/annalyns-infiltration/AnnalynsInfiltration.csproj" />
<Project Path="concept/attack-of-the-trolls/AttackOfTheTrolls.csproj" />
<Project Path="concept/authentication-system/AuthenticationSystem.csproj" />
<Project Path="concept/beauty-salon-goes-global/BeautySalonGoesGlobal.csproj" />
<Project Path="concept/bird-watcher/BirdWatcher.csproj" />
<Project Path="concept/booking-up-for-beauty/BookingUpForBeauty.csproj" />
<Project Path="concept/building-telemetry/BuildingTelemetry.csproj" />
<Project Path="concept/calculator-conundrum/CalculatorConundrum.csproj" />
<Project Path="concept/cars-assemble/CarsAssemble.csproj" />
<Project Path="concept/developer-privileges/DeveloperPrivileges.csproj" />
<Project Path="concept/faceid-2/Faceid2.csproj" />
<Project Path="concept/football-match-reports/FootballMatchReports.csproj" />
<Project Path="concept/high-school-sweethearts/HighSchoolSweethearts.csproj" />
<Project Path="concept/hyper-optimized-telemetry/HyperOptimizedTelemetry.csproj" />
<Project Path="concept/hyperia-forex/HyperiaForex.csproj" />
<Project Path="concept/hyperinflation-hits-hyperia/HyperinflationHitsHyperia.csproj" />
<Project Path="concept/instruments-of-texas/InstrumentsOfTexas.csproj" />
<Project Path="concept/interest-is-interesting/InterestIsInteresting.csproj" />
<Project Path="concept/international-calling-connoisseur/InternationalCallingConnoisseur.csproj" />
<Project Path="concept/jedliks-toys/JedliksToys.csproj" />
<Project Path="concept/land-grab-in-space/LandGrabInSpace.csproj" />
<Project Path="concept/log-analysis/LogAnalysis.csproj" />
<Project Path="concept/log-levels/LogLevels.csproj" />
<Project Path="concept/logs-logs-logs/LogsLogsLogs.csproj" />
<Project Path="concept/lucians-luscious-lasagna/LuciansLusciousLasagna.csproj" />
<Project Path="concept/need-for-speed/NeedForSpeed.csproj" />
<Project Path="concept/object-relational-mapping/ObjectRelationalMapping.csproj" />
<Project Path="concept/orm-in-one-go/OrmInOneGo.csproj" />
<Project Path="concept/parsing-log-files/ParsingLogFiles.csproj" />
<Project Path="concept/phone-number-analysis/PhoneNumberAnalysis.csproj" />
<Project Path="concept/red-vs-blue-darwin-style/RedVsBlueDarwinStyle.csproj" />
<Project Path="concept/remote-control-cleanup/RemoteControlCleanup.csproj" />
<Project Path="concept/remote-control-competition/RemoteControlCompetition.csproj" />
<Project Path="concept/roll-the-die/RollTheDie.csproj" />
<Project Path="concept/secure-munchester-united/SecureMunchesterUnited.csproj" />
<Project Path="concept/squeaky-clean/SqueakyClean.csproj" />
<Project Path="concept/the-weather-in-deather/TheWeatherInDeather.csproj" />
<Project Path="concept/tim-from-marketing/TimFromMarketing.csproj" />
<Project Path="concept/tracks-on-tracks-on-tracks/TracksOnTracksOnTracks.csproj" />
<Project Path="concept/weighing-machine/WeighingMachine.csproj" />
<Project Path="concept/wizards-and-warriors-2/WizardsAndWarriors2.csproj" />
<Project Path="concept/wizards-and-warriors/WizardsAndWarriors.csproj" />
</Folder>
<Folder Name="/practice/">
<Project Path="practice/accumulate/Accumulate.csproj" />
<Project Path="practice/acronym/Acronym.csproj" />
<Project Path="practice/affine-cipher/AffineCipher.csproj" />
<Project Path="practice/all-your-base/AllYourBase.csproj" />
<Project Path="practice/allergies/Allergies.csproj" />
<Project Path="practice/alphametics/Alphametics.csproj" />
<Project Path="practice/anagram/Anagram.csproj" />
<Project Path="practice/armstrong-numbers/ArmstrongNumbers.csproj" />
<Project Path="practice/atbash-cipher/AtbashCipher.csproj" />
<Project Path="practice/baffling-birthdays/BafflingBirthdays.csproj" />
<Project Path="practice/bank-account/BankAccount.csproj" />
<Project Path="practice/beer-song/BeerSong.csproj" />
<Project Path="practice/binary-search-tree/BinarySearchTree.csproj" />
<Project Path="practice/binary-search/BinarySearch.csproj" />
<Project Path="practice/binary/Binary.csproj" />
<Project Path="practice/bob/Bob.csproj" />
<Project Path="practice/book-store/BookStore.csproj" />
<Project Path="practice/bottle-song/BottleSong.csproj" />
<Project Path="practice/bowling/Bowling.csproj" />
<Project Path="practice/camicia/Camicia.csproj" />
<Project Path="practice/change/Change.csproj" />
<Project Path="practice/circular-buffer/CircularBuffer.csproj" />
<Project Path="practice/clock/Clock.csproj" />
<Project Path="practice/collatz-conjecture/CollatzConjecture.csproj" />
<Project Path="practice/complex-numbers/ComplexNumbers.csproj" />
<Project Path="practice/connect/Connect.csproj" />
<Project Path="practice/crypto-square/CryptoSquare.csproj" />
<Project Path="practice/custom-set/CustomSet.csproj" />
<Project Path="practice/darts/Darts.csproj" />
<Project Path="practice/diamond/Diamond.csproj" />
<Project Path="practice/difference-of-squares/DifferenceOfSquares.csproj" />
<Project Path="practice/diffie-hellman/DiffieHellman.csproj" />
<Project Path="practice/dnd-character/DndCharacter.csproj" />
<Project Path="practice/dominoes/Dominoes.csproj" />
<Project Path="practice/dot-dsl/DotDsl.csproj" />
<Project Path="practice/eliuds-eggs/EliudsEggs.csproj" />
<Project Path="practice/error-handling/ErrorHandling.csproj" />
<Project Path="practice/etl/Etl.csproj" />
<Project Path="practice/flatten-array/FlattenArray.csproj" />
<Project Path="practice/flower-field/FlowerField.csproj" />
<Project Path="practice/food-chain/FoodChain.csproj" />
<Project Path="practice/forth/Forth.csproj" />
<Project Path="practice/gigasecond/Gigasecond.csproj" />
<Project Path="practice/go-counting/GoCounting.csproj" />
<Project Path="practice/grade-school/GradeSchool.csproj" />
<Project Path="practice/grains/Grains.csproj" />
<Project Path="practice/grep/Grep.csproj" />
<Project Path="practice/hamming/Hamming.csproj" />
<Project Path="practice/hangman/Hangman.csproj" />
<Project Path="practice/hello-world/HelloWorld.csproj" />
<Project Path="practice/hexadecimal/Hexadecimal.csproj" />
<Project Path="practice/high-scores/HighScores.csproj" />
<Project Path="practice/house/House.csproj" />
<Project Path="practice/intergalactic-transmission/IntergalacticTransmission.csproj" />
<Project Path="practice/isbn-verifier/IsbnVerifier.csproj" />
<Project Path="practice/isogram/Isogram.csproj" />
<Project Path="practice/killer-sudoku-helper/KillerSudokuHelper.csproj" />
<Project Path="practice/kindergarten-garden/KindergartenGarden.csproj" />
<Project Path="practice/knapsack/Knapsack.csproj" />
<Project Path="practice/largest-series-product/LargestSeriesProduct.csproj" />
<Project Path="practice/leap/Leap.csproj" />
<Project Path="practice/ledger/Ledger.csproj" />
<Project Path="practice/linked-list/LinkedList.csproj" />
<Project Path="practice/list-ops/ListOps.csproj" />
<Project Path="practice/luhn/Luhn.csproj" />
<Project Path="practice/markdown/Markdown.csproj" />
<Project Path="practice/matching-brackets/MatchingBrackets.csproj" />
<Project Path="practice/matrix/Matrix.csproj" />
<Project Path="practice/meetup/Meetup.csproj" />
<Project Path="practice/minesweeper/Minesweeper.csproj" />
<Project Path="practice/nth-prime/NthPrime.csproj" />
<Project Path="practice/nucleotide-count/NucleotideCount.csproj" />
<Project Path="practice/ocr-numbers/OcrNumbers.csproj" />
<Project Path="practice/octal/Octal.csproj" />
<Project Path="practice/palindrome-products/PalindromeProducts.csproj" />
<Project Path="practice/pangram/Pangram.csproj" />
<Project Path="practice/parallel-letter-frequency/ParallelLetterFrequency.csproj" />
<Project Path="practice/pascals-triangle/PascalsTriangle.csproj" />
<Project Path="practice/perfect-numbers/PerfectNumbers.csproj" />
<Project Path="practice/phone-number/PhoneNumber.csproj" />
<Project Path="practice/pig-latin/PigLatin.csproj" />
<Project Path="practice/poker/Poker.csproj" />
<Project Path="practice/pov/Pov.csproj" />
<Project Path="practice/prime-factors/PrimeFactors.csproj" />
<Project Path="practice/protein-translation/ProteinTranslation.csproj" />
<Project Path="practice/proverb/Proverb.csproj" />
<Project Path="practice/pythagorean-triplet/PythagoreanTriplet.csproj" />
<Project Path="practice/queen-attack/QueenAttack.csproj" />
<Project Path="practice/rail-fence-cipher/RailFenceCipher.csproj" />
<Project Path="practice/raindrops/Raindrops.csproj" />
<Project Path="practice/rational-numbers/RationalNumbers.csproj" />
<Project Path="practice/react/React.csproj" />
<Project Path="practice/rectangles/Rectangles.csproj" />
<Project Path="practice/relative-distance/RelativeDistance.csproj" />
<Project Path="practice/resistor-color-duo/ResistorColorDuo.csproj" />
<Project Path="practice/resistor-color-trio/ResistorColorTrio.csproj" />
<Project Path="practice/resistor-color/ResistorColor.csproj" />
<Project Path="practice/rest-api/RestApi.csproj" />
<Project Path="practice/reverse-string/ReverseString.csproj" />
<Project Path="practice/rna-transcription/RnaTranscription.csproj" />
<Project Path="practice/robot-name/RobotName.csproj" />
<Project Path="practice/robot-simulator/RobotSimulator.csproj" />
<Project Path="practice/roman-numerals/RomanNumerals.csproj" />
<Project Path="practice/rotational-cipher/RotationalCipher.csproj" />
<Project Path="practice/run-length-encoding/RunLengthEncoding.csproj" />
<Project Path="practice/saddle-points/SaddlePoints.csproj" />
<Project Path="practice/satellite/Satellite.csproj" />
<Project Path="practice/say/Say.csproj" />
<Project Path="practice/scale-generator/ScaleGenerator.csproj" />
<Project Path="practice/scrabble-score/ScrabbleScore.csproj" />
<Project Path="practice/secret-handshake/SecretHandshake.csproj" />
<Project Path="practice/series/Series.csproj" />
<Project Path="practice/sgf-parsing/SgfParsing.csproj" />
<Project Path="practice/sieve/Sieve.csproj" />
<Project Path="practice/simple-cipher/SimpleCipher.csproj" />
<Project Path="practice/simple-linked-list/SimpleLinkedList.csproj" />
<Project Path="practice/space-age/SpaceAge.csproj" />
<Project Path="practice/spiral-matrix/SpiralMatrix.csproj" />
<Project Path="practice/split-second-stopwatch/SplitSecondStopwatch.csproj" />
<Project Path="practice/square-root/SquareRoot.csproj" />
<Project Path="practice/state-of-tic-tac-toe/StateOfTicTacToe.csproj" />
<Project Path="practice/strain/Strain.csproj" />
<Project Path="practice/sublist/Sublist.csproj" />
<Project Path="practice/sum-of-multiples/SumOfMultiples.csproj" />
<Project Path="practice/swift-scheduling/SwiftScheduling.csproj" />
<Project Path="practice/tournament/Tournament.csproj" />
<Project Path="practice/transpose/Transpose.csproj" />
<Project Path="practice/tree-building/TreeBuilding.csproj" />
<Project Path="practice/triangle/Triangle.csproj" />
<Project Path="practice/trinary/Trinary.csproj" />
<Project Path="practice/twelve-days/TwelveDays.csproj" />
<Project Path="practice/two-bucket/TwoBucket.csproj" />
<Project Path="practice/two-fer/TwoFer.csproj" />
<Project Path="practice/variable-length-quantity/VariableLengthQuantity.csproj" />
<Project Path="practice/word-count/WordCount.csproj" />
<Project Path="practice/word-search/WordSearch.csproj" />
<Project Path="practice/wordy/Wordy.csproj" />
<Project Path="practice/yacht/Yacht.csproj" />
<Project Path="practice/zebra-puzzle/ZebraPuzzle.csproj" />
<Project Path="practice/zipper/Zipper.csproj" />
</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.csproj" />
<Project Path="practice/markdown/Markdown.csproj" />
<Project Path="practice/tree-building/TreeBuilding.csproj" />
</Folder>
</Solution>
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<OutputType>Exe</OutputType>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<RootNamespace>Exercism</RootNamespace>
</PropertyGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit.v3" Version="1.1.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1" />
<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="Exercism.Tests.xunit.v3" Version="0.1.0-beta1" />
</ItemGroup>

Expand Down
Loading
Loading