|
| 1 | +[](https://github.com/avan1235/advent-of-code-kotlin/releases/latest) |
| 2 | +[](https://github.com/avan1235/advent-of-code-kotlin/releases/latest) |
| 3 | + |
| 4 | +[](./LICENSE.md) |
| 5 | +[](https://central.sonatype.com/namespace/in.procyk.adventofcode) |
| 6 | + |
| 7 | +[](https://github.com/avan1235/advent-of-code-kotlin/stargazers) |
| 8 | +[](https://github.com/avan1235/advent-of-code-kotlin/fork) |
| 9 | + |
1 | 10 | # 🎄🎁🎅 Advent of Code in Kotlin 🎅🎁🎄 |
2 | 11 |
|
| 12 | +Kotlin Multiplatform utility library for bringing solutions for Advent of Code |
| 13 | +and sharing them as an interactive solver. |
| 14 | + |
| 15 | +## Project Contents |
| 16 | + |
| 17 | +### Kotlin Libraries |
| 18 | + |
| 19 | +#### [solutions](./solutions/src/commonMain/kotlin/in/procyk/adventofcode/solutions) |
| 20 | + |
| 21 | +`implementation("in.procyk.adventofcode:solutions:1.0.2")` |
| 22 | + |
| 23 | +- [AdventDay](./solutions/src/commonMain/kotlin/in/procyk/adventofcode/solutions/AdventDay.kt) is a single day solution |
| 24 | +- [Advent](./solutions/src/commonMain/kotlin/in/procyk/adventofcode/solutions/Advent.kt) is a collection of solutions |
| 25 | + from a single year |
| 26 | +- utility functions and classes that are helpful so far in solving the tasks |
| 27 | + |
| 28 | +#### [runner](./runner/src/commonMain/kotlin/in/procyk/adventofcode/runner) |
| 29 | + |
| 30 | +`implementation("in.procyk.adventofcode:runner:1.0.2")` |
| 31 | + |
| 32 | +- [FileAdventInputReader](./runner/src/commonMain/kotlin/in/procyk/adventofcode/runner/FileAdventInputReader.kt) is an |
| 33 | + instance of `AdventDay.InputReader` that allows to read inputs from system file |
| 34 | +- [Advent.solve](./runner/src/commonMain/kotlin/in/procyk/adventofcode/runner/Advent.kt) is a utility function to solve |
| 35 | + single day from current year if executed during the Advent of Code time, while it runs all days on other days. It's |
| 36 | + intended to run current day when prototyping the solution for current day. |
| 37 | + |
| 38 | +#### [test-runner](./test-runner/src/commonMain/kotlin/in/procyk/adventofcode/runner) |
| 39 | + |
| 40 | +`implementation("in.procyk.adventofcode:test-runner:1.0.2")` |
| 41 | + |
| 42 | +- [AdventTest](./test-runner/src/commonMain/kotlin/in/procyk/adventofcode/runner/AdventTest.kt) has easy assertions of |
| 43 | + solutions from [AdventDay](./solutions/src/commonMain/kotlin/in/procyk/adventofcode/solutions/AdventDay.kt) |
| 44 | + |
| 45 | +#### [solver](./solver/src/commonMain/kotlin/in/procyk/adventofcode/solver) |
| 46 | + |
| 47 | +`implementation("in.procyk.adventofcode:solver:1.0.2")` |
| 48 | + |
| 49 | +- [AdventSolver](./solver/src/commonMain/kotlin/in/procyk/adventofcode/solver/AdventSolver.kt) implements UI for |
| 50 | + providing solutions and log outputs for Advent of Code based |
| 51 | + on [Compose Multiplatform](https://github.com/JetBrains/compose-multiplatform) |
| 52 | +- [adventWebSolver](./solver/src/wasmJsMain/kotlin/in/procyk/adventofcode/solver/AdventWebSolver.kt) is a web entrypoint |
| 53 | + for UI |
| 54 | +- [adventJvmSolver](./solver/src/jvmMain/kotlin/in/procyk/adventofcode/solver/AdventJvmSolver.kt) is a desktop |
| 55 | + entrypoint for UI |
| 56 | + |
| 57 | +### Publishing Utilities |
| 58 | + |
| 59 | +#### [convention-plugins](./convention-plugins/src/main/kotlin) |
| 60 | + |
| 61 | +- [convention.publication.gradle.kts](./convention-plugins/src/main/kotlin/convention.publication.gradle.kts) enables |
| 62 | + easy configuration of publication for each project where applied |
| 63 | + |
| 64 | +#### [GitHub Actions](./.github/workflows) |
| 65 | + |
| 66 | +- [release.yml](./.github/workflows/release.yml) implements a GitHub Action that publishes Kotlin Multiplatform |
| 67 | + libraries to [Maven Central](https://central.sonatype.com/) when git tag in format `v*.*.*` with a version matching |
| 68 | + version configured in [build.gradle.kts](./build.gradle.kts) is pushed. Requires following secrets to be configured: |
| 69 | + - `OSSRH_USERNAME`: a `username` generated from [Maven Central Panel](https://s01.oss.sonatype.org/#profile;User%20Token) |
| 70 | + - `OSSRH_PASSWORD`: a `password` generated from [Maven Central Panel](https://s01.oss.sonatype.org/#profile;User%20Token) |
| 71 | + - `SIGNING_KEY_ID`: last 8 bytes of signing key ID that can be checked with `gpg --list-secret-keys --keyid-format SHORT` |
| 72 | + - `SIGNING_PASSWORD`: password for signing key |
| 73 | + - `SIGNING_KEY`: signing key in a format extracted with `gpg --armor --export-secret-key 'example@gmail.com' | grep -v '\-\-' | grep -v '=.' | tr -d '\n'` |
| 74 | + |
| 75 | +## Version Catalog |
| 76 | + |
| 77 | +```toml |
| 78 | +[versions] |
| 79 | +procyk-adventofcode = "1.0.2" |
| 80 | + |
| 81 | +[libraries] |
| 82 | +procyk-adventofcode-runner = { module = "in.procyk.adventofcode:runner", version.ref = "procyk-adventofcode" } |
| 83 | +procyk-adventofcode-solutions = { module = "in.procyk.adventofcode:solutions", version.ref = "procyk-adventofcode" } |
| 84 | +procyk-adventofcode-solver = { module = "in.procyk.adventofcode:solver", version.ref = "procyk-adventofcode" } |
| 85 | +procyk-adventofcode-test-runner = { module = "in.procyk.adventofcode:test-runner", version.ref = "procyk-adventofcode" } |
| 86 | +``` |
0 commit comments