Add setup script for 2019
This commit is contained in:
parent
3e8ec04b29
commit
f585085a20
|
@ -0,0 +1,2 @@
|
||||||
|
.gradle/
|
||||||
|
build
|
|
@ -0,0 +1,20 @@
|
||||||
|
val arrowVersion = "0.10.3"
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id("org.jetbrains.kotlin.jvm") version "1.3.60"
|
||||||
|
application
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
maven("https://dl.bintray.com/arrow-kt/arrow-kt/")
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
||||||
|
implementation("io.arrow-kt:arrow-core:$arrowVersion")
|
||||||
|
}
|
||||||
|
|
||||||
|
application {
|
||||||
|
mainClassName = "moe.kageru.aoc.DayXXKt"
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
rootProject.name = "advent-of-code"
|
|
@ -0,0 +1,5 @@
|
||||||
|
package moe.kageru.aoc
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
println("Hello, Advent of Code")
|
||||||
|
}
|
|
@ -1,8 +1,26 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
today=$(date +%d)
|
today=$(date +%d)
|
||||||
mkdir "$today"
|
echo 'Select language for today. (r)ust, (k)otlin:'
|
||||||
cd "$today"
|
read lang
|
||||||
|
|
||||||
|
if [[ "$lang" == "r" ]]; then
|
||||||
|
mkdir "$today"
|
||||||
|
cd "$today"
|
||||||
|
cargo init --name "day$today"
|
||||||
|
echo 'Initialized cargo project'
|
||||||
|
elif [[ "$lang" == "k" ]]; then
|
||||||
|
cp -r kt "$today"
|
||||||
|
cd "$today"
|
||||||
|
sed -i "s/DayXX/Day$today/" build.gradle.kts
|
||||||
|
mv "src/main/kotlin/moe/kageru/aoc/DayXX.kt" "src/main/kotlin/moe/kageru/aoc/Day$today.kt"
|
||||||
|
echo 'Initialized gradle project from skeleton'
|
||||||
|
else
|
||||||
|
echo "Unknown language $lang"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# this assumes that your puzzle input is already in your clipboard
|
# this assumes that your puzzle input is already in your clipboard
|
||||||
xsel -b > input
|
xsel -b > input
|
||||||
|
# add trailing newline if necessary
|
||||||
|
sed -i -e '$a\' input
|
||||||
|
|
Loading…
Reference in New Issue
Block a user