Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to do multiple years #92

Open
h2oboi89 opened this issue Dec 4, 2021 · 5 comments
Open

Ability to do multiple years #92

h2oboi89 opened this issue Dec 4, 2021 · 5 comments
Labels
Feature New features

Comments

@h2oboi89
Copy link

h2oboi89 commented Dec 4, 2021

I've taken the idea of your framework and expanded on it by allowing for multiple years.

My updated project structure is as follows:

+---AdventOfCode
|   AdventOfCode.csproj
|   GlobalUsings.cs
|   Program.cs
|
+---2015
|   |   Day_01.cs
|   |   Day_02.cs
|   |   Day_03.cs
|   |
|   \---Inputs
|           01.txt
|           02.txt
|           03.txt
|
+---2021
    |   Day_01.cs
    |   Day_02.cs
    |   Day_03.cs
    |
    \---Inputs
            01.txt
            02.txt
            03.txt
@eduherminio eduherminio added the Feature New features label Dec 5, 2021
@eduherminio
Copy link
Owner

Thanks for the suggestion @h2oboi89.
Out of curiosity, do you find that more useful than having N projects, one per year?

Apart for simplicity in terms of AoCHelper implementation, the main advantage I find to maintaining one project per year is being able to use different versions of .NET/Libraries: if next year .NET 7 is released with breaking changes and AoCHelper 2.x is released with breaking changes, I wouldn't like having to update all my previous years just to use a new version of .NET/AoCHelper in 2022.

An example of a AoCHelper breaking change between v0.x and v1.x was the signature of the solver methods: ValueTask<string> instead of string, which in case of keeping all the previous years in the same project, would have required changes in all the Day files in the repo to accommodate the new version.

@h2oboi89
Copy link
Author

h2oboi89 commented Dec 5, 2021

I only discovered AoC this year, so I am doing a lot of catch up. I'm rather impatient so I have started doing 2015 while I wait for the next days problem to be released.

I liked your idea with the framework but was annoyed at having to copy paste stuff between the solutions and not being able to run all days at once so I made the improvement on my end.

> dotnet run -c Release --project .\AdventOfCode\ -- --help
AdventOfCode 1.0.0
Copyright (C) 2021 AdventOfCode

  -y, --year      Year selection (default is highest year)

  --all           Enables running all days for year or all years if no year is specified

  --help          Display this help screen.

  --version       Display version information.

  value pos. 0    Specify days to run (ie: 1 2 3)

I'm using CommandLineParser for args and added -y #### as to let me focus on year.

@eduherminio
Copy link
Owner

Fair enough, I'll leave this issue open to track the feature suggestion so that people can 👍🏼 if they agree, but not planning to implement it straight away for the reasons mentioned above.

@h2oboi89
Copy link
Author

https://github.com/h2oboi89/AdventOfCode

Here is link to my code for your reference should you choose to implement this.

@eduherminio
Copy link
Owner

#181 allows to execute problems from assemblies different from the one where Solver is used.
This facilitates doing multiple years in the same repository, with the restriction of using a different library/project per year.

That's showcased in AdventOfCode.MultiYearTemplate.

Despite the potential pros of keeping each year separated from each other and the effort to simplify the solution structure there (i.e. using Directory.Build.Props heavily), I still acknowledge the desire to keep all the years in the same project and share the goal of eventually getting there, so will keep this issue open for the purpose of tracking that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New features
Projects
None yet
Development

No branches or pull requests

2 participants