-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
988 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
name: Custom issue template | ||
about: Describe this issue template's purpose here. | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Build | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fetch sources | ||
uses: actions/checkout@v4 | ||
- name: Set up jdk 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
cache: maven | ||
- name: build with maven | ||
run: ./mvnw --batch-mode --update-snapshots verify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# 🎄 Advent of Code {year} | ||
Your solutions for [Advent of Code](https://adventofcode.com/) written in Java ☕. | ||
## Template setup | ||
### Configure repository | ||
1. Open [the template repository](https://github.com/thermoweb/aoc-java-template) on GitHub | ||
2. Click [Use this template](https://github.com/thermoweb/aoc-java-template/generate) and create your repository | ||
3. Clone your repository on your computer | ||
|
||
### Requirements | ||
- Java 17+ installed | ||
|
||
## Usage | ||
|
||
```shell | ||
Usage: aoc [COMMAND] | ||
run Advent of Code command line tool. | ||
Commands: | ||
scaffold create class and tests for the day. | ||
download download input file and create an empty example file. | ||
solve run the solution with the input for the specified day. | ||
help Display help information about the specified command. | ||
``` | ||
|
||
The usual workflow of this is to: | ||
1. use the `scaffold --day <day>` command to create both test and solution classes in the project for the day. | ||
2. use the `download --day <day>` command to download the input of the day and create an empty example file. | ||
3. write your solution | ||
4. use the `solve --day <day>` command to launch your code with the day's input. | ||
|
||
### Scaffold a day | ||
This will create both day class and the associated test. | ||
```shell | ||
# example: `./aoc scaffold --day 1` | ||
./aoc scaffold --day <day> | ||
``` | ||
|
||
### Download Input for a day | ||
|
||
> [!IMPORTANT] | ||
> This requires in your home folder the file `.adventofcode.session` with your session-cookie in it. | ||
> To find it, you have to log in on [adventofcode.com](https://adventofcode.com) and use the web developer tool to retrieve the value of the `session` cookie. | ||
```shell | ||
# example: `./aoc download --day 1` | ||
./aoc download --day <day> | ||
``` | ||
|
||
this will create the input file and download corresponding data of day and an empty example file. | ||
|
||
### Solve a day | ||
```shell | ||
# example: `./aoc solve --day 1` | ||
./aoc solve --day <day> | ||
``` | ||
This will launch the day solver for the specified day with the input. | ||
|
||
### Help | ||
You can run the help command to see all available commands: | ||
```shell | ||
./aoc help | ||
``` | ||
|
||
You also can have more information on commands with: | ||
```shell | ||
# example: `./aoc help solve` | ||
./aoc help <command> | ||
``` | ||
|
||
--- | ||
|
||
Inspired by [advent-of-code-rust](https://github.com/fspoettel/advent-of-code-rust) template. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
||
COMMAND=$1 | ||
AOC_JAR=${SCRIPT_DIR}/aoc-runner/target/aoc.jar | ||
|
||
if [ ${COMMAND} == "solve" ] || [ ! -f ${AOC_JAR} ] | ||
then | ||
echo "building project jars" | ||
./mvnw --batch-mode --quiet clean install | ||
fi | ||
|
||
if [ ${COMMAND} == "" ] | ||
then | ||
java -jar ${AOC_JAR} help | ||
exit 1 | ||
fi | ||
|
||
echo "launching aoc command '$@'" | ||
java -jar ${AOC_JAR} $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
40 changes: 0 additions & 40 deletions
40
aoc-maven-plugin/src/main/java/org/thermoweb/aoc/plugin/DownloadMojo.java
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
aoc-maven-plugin/src/main/java/org/thermoweb/aoc/plugin/ScaffoldMojo.java
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
aoc-maven-plugin/src/main/java/org/thermoweb/aoc/plugin/SolveMojo.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.