Skip to content

Commit 5c05838

Browse files
authored
Introduce windows runners for aoc and aot (#15)
Co-authored-by: Dominik <wezik@users.noreply.github.com>
1 parent 453aa69 commit 5c05838

File tree

3 files changed

+61
-16
lines changed

3 files changed

+61
-16
lines changed

README.md

Lines changed: 57 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,76 @@
11
# Advent of Code
2-
My solutions to [Advent of Code puzzles](https://adventofcode.com/) in Kotlin!
2+
3+
My solutions to [Advent of Code](https://adventofcode.com/) puzzles in Kotlin!
34

45
## Years completed
5-
2024: 50/50⭐ (not all solutions are implemented in repo yet)
6+
7+
2024: 50/50⭐
8+
9+
Missing implementations:
10+
11+
- Day 24 (part 2): solution is mostly manual, it's difficult to implement in code
612

713
## Requirements to run
14+
815
- JDK 21
916

10-
## Setup
11-
- clone the repo `git clone https://github.com/wezik/aoc-kotlin.git`
12-
- enter `cd aoc-kotlin`
13-
- build fat jar with `./gradlew buildFat`
14-
- source aliases with `source ./alias.sh`
17+
## Installation from source
18+
19+
### Linux/macOS
1520

16-
or simply copy and paste in terminal:
1721
```bash
1822
git clone https://github.com/wezik/aoc-kotlin.git
1923
cd aoc-kotlin
2024
./gradlew buildFat
2125
source ./alias.sh
2226
```
2327

24-
now run the CLI (look [below](#how-to-use) for more details)
28+
### Windows
29+
30+
```ps1
31+
git clone https://github.com/wezik/aoc-kotlin.git
32+
cd aoc-kotlin
33+
.\gradlew buildFat
34+
```
2535

2636
## How to use
27-
This project is split into 2 separate CLI entrypoints:
28-
- `aoc` core
29-
- `aot` test runner
37+
38+
This project provides 2 separate CLI entrypoints: [aoc](#aoc) and [aot](#aot).
39+
These are executed via shell or batch scripts, allowing you to use them like a regular CLI tool.
40+
The entrypoint scripts are:
41+
42+
- [alias.sh](alias.sh) for Linux/macOS - defines `aoc` and `aot` functions
43+
- [aoc.bat](aoc.bat) for Windows - runs `aoc`
44+
- [aot.bat](aot.bat) for Windows - runs `aot`
45+
46+
> [!NOTE]
47+
> These scripts are meant to be run from the project directory,
48+
> they *do not install anything globally* or add commands to your system `PATH`.
49+
50+
After building the project (and sourcing aliases for Linux/macOS with `source ./alias.sh`)
51+
You can invoke them like:
52+
53+
```bash
54+
aoc -d 5
55+
aot -d 3 --path "inputs/Day03.txt"
56+
```
57+
58+
Or in Powershell:
59+
60+
```ps1
61+
.\aoc.bat -d 5
62+
.\aot.bat -d 3 --path "inputs/Day03.txt"
63+
```
3064

3165
### AOC
32-
Serves as the core CLI entrypoint to run solutions
3366

34-
> [!NOTE]
35-
> `aoc` entrypoint runs against real advent of code inputs, you have to either export `ADVENT_COOKIE` value from your advent of code session or provide `--session-cookie` option
67+
Loads inputs directly from Advent of Code website to run solutions against.
68+
69+
> [!IMPORTANT]
70+
> It runs against advent of code inputs, which requires session cookie, you can either:
71+
>
72+
> - export ADVENT_COOKIE ex. `export ADVENT_COOKIE="xxx"`
73+
> - provide session cookie via option ex. `-s "session_cookie"`
3674
3775
```bash
3876
Usage: aoc [<options>]
@@ -45,7 +83,9 @@ Options:
4583
```
4684

4785
### AOT
48-
Serves as the test runner entrypoint, it will run solutions against example inputs or your custom input file if you provide `--path` option.
86+
87+
Loads inputs from files instead of running solutions against real ones.
88+
You can provide `--path` to load custom input, otherwise it will load examples.
4989

5090
```bash
5191
Usage: aot [<options>]
@@ -58,4 +98,5 @@ Options:
5898
```
5999

60100
## TODO
101+
61102
- [ ] Introduce releases so it's not necessary to build from source

aoc.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
java -jar build\libs\aoc.jar %*

aot.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
java -jar build\libs\aot.jar %*

0 commit comments

Comments
 (0)