Clic on Use this template
and clone the repository.
Then, build the project with the following command:
If you want to customize the project, and change the group id for example, you can change group id in the pom.xml file:
<groupId>dev.vinyard.adventofcode</groupId>
If you do this you also need to change the package name in the BluePrinter environment.xml file to keep it working:
<property key="PACKAGE">dev/vinyard/adventofcode</property>
All the generated files will be created in the new package.
Setting up the environmentTo get the Advent of Cope scrapper plugin to work, you need to set up your session id :
You can set your session id in your environment variables:
How to get my session idApplication
tab.Cookies
section, you will find a cookie named session
.export AOC_SESSION_ID=your_session_idShow instruction for Windows
You have to go to the environment variables and add a new one with the name AOC_SESSION_ID
and the value your_session_id
.
Or you can set it in the BluePrinter environment.xml file:
<property key="SESSION_ID">your_session_id</property>
Caution
Be careful not to share your session id with anyone, don't commit it in your repository.
Configure your repositoryAllow github action to create pull requests on your repository:
Actions
tab.General
section.Workflow permissions
checkbox.
Read and write permissions
Allow GitHub Actions to create and approve pull requests
Add your session_id in your secrets:
Secrets and variables
tab.Actions
section.New repository secret
.AOC_SESSION_ID
and the value your_session_id
.Create a Personal Access Token (PAT) for the workflow:
contents: write
and pull-requests: write
scopes.Developer settings
tab.Personal access tokens
section.Fine-grained token
section.contents: write
and pull-requests: write
scopes and copy the token.Secrets and variables
tab.Actions
section.New repository secret
.PAT
and the value your_personal_access_token
.That's it, you are ready to generate your solutions with Github Actions. Solutions will be generated in a brand new branch and a pull request will be created.
To generate the next solution of the year for Advent of Code, run the following command:
mvn blueprinter:blueprint@next-solution
To generate a specific solution for Advent of Code, run the following command:
mvn blueprinter:blueprint@solution -Dyear=2023 -Dday=1 -Dpart=1
Important
To generate a new pull request with the solution, you need to have your GitHub environment set up
Actions
tab.All workflows
section.You will see 3 workflows:
Generate antlr4 based Solution of the Day
: This workflow generates the solution for today's day.Generate Next antlr4 based Solution
: This workflow generates the next unimplemented solution of the year. If you haven't implemented any solution yet, it will generate the first one.Maven Build
: This workflow builds the project, generates the README.md file, and pushes the changes to the repository.Once you have generated the solution, you can implement the code in the generated files.
src/main/antlr4
directory.src/main/java
directory
src/test/java
directory to initialize the first test result.test.txt
is not automatically generated, you need to copy it from the Advent of Code website and paste it in the second argument of the testSolution
method in the test file.Important
Automated generation of the README.md is disabled by default, because it erase the actual content of the README.md file. You can enable it by uncomment the on:
section in the .github/workflows/build.yml
file.
on: pull_request: push: branches: - master
Tip
You can find a lot of examples of resolved solutions in my repository adventofcode.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4