Skip to content

Commit

Permalink
Upgraded libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
markjfisher committed Nov 23, 2023
1 parent 79c898d commit 2b714cd
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 27 deletions.
9 changes: 7 additions & 2 deletions advents/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ tasks {
classpath = sourceSets["main"].runtimeClasspath
}

register("advent2023", JavaExec::class) {
mainClass.set("net.fish.y2023.AdventOfCode2023")
classpath = sourceSets["main"].runtimeClasspath
}

register("advent2022day12", JavaExec::class) {
mainClass.set("net.fish.y2022.Advent2022Day12")
classpath = sourceSets["main"].runtimeClasspath
Expand All @@ -99,14 +104,14 @@ tasks {

named<KotlinCompile>("compileKotlin") {
kotlinOptions {
jvmTarget = "11"
jvmTarget = "17"
javaParameters = true
}
}

named<KotlinCompile>("compileTestKotlin") {
kotlinOptions {
jvmTarget = "11"
jvmTarget = "17"
javaParameters = true
freeCompilerArgs += listOf("-Xinline-classes", "-Xopt-in=kotlin.RequiresOptIn")
}
Expand Down
15 changes: 15 additions & 0 deletions advents/src/main/kotlin/net/fish/y2023/AdventOfCode.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@file:JvmName("AdventOfCode2023")
package net.fish.y2023

import net.fish.Reflect
import net.fish.Runner

object AdventOfCode {
val days = Reflect.getDays(2023)
}

fun main(args: Array<String>) {
// WindowsAnsi.setup()
val day = if(args.isEmpty()) 0 else args[0].toInt()
Runner.run(2023, AdventOfCode.days, day)
}
21 changes: 21 additions & 0 deletions advents/src/main/kotlin/net/fish/y2023/Day01.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package net.fish.y2023

import net.fish.Day
import net.fish.resourceLines

object Day01 : Day {
private val data by lazy { resourceLines(2023, 1) }

override fun part1() = doPart1(data)
override fun part2() = doPart2(data)

fun doPart1(data: List<String>): Int = data.size
fun doPart2(data: List<String>): Int = data.size

@JvmStatic
fun main(args: Array<String>) {
println(part1())
println(part2())
}

}
21 changes: 21 additions & 0 deletions advents/src/main/kotlin/net/fish/y2023/DayTemplate.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package net.fish.y2023

import net.fish.Day
import net.fish.resourceLines

object DayTemplate : Day {
private val data by lazy { resourceLines(2023, 0) }

override fun part1() = doPart1(data)
override fun part2() = doPart2(data)

fun doPart1(data: List<String>): Int = data.size
fun doPart2(data: List<String>): Int = data.size

@JvmStatic
fun main(args: Array<String>) {
println(part1())
println(part2())
}

}
1 change: 1 addition & 0 deletions advents/src/main/resources/2023/day01.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

tasks {
getByName<Wrapper>("wrapper") {
gradleVersion = "7.6"
gradleVersion = "8.4"
distributionType = Wrapper.DistributionType.ALL
}
}
Expand Down
22 changes: 11 additions & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
kotlinVersion=1.7.21
kotlinxCoroutineVersion=1.6.4
kotlinVersion=1.8.20
kotlinxCoroutineVersion=1.7.3
kotlinxSerializationRuntime=1.7.20
shadowVersion=7.1.2
shadowVersion=8.1.1

mathsToolKitVersion=1.0.3
reflectionsVersion=0.9.12
mordantVersion=2.0.0-beta9
reflectionsVersion=0.10.2
mordantVersion=2.2.0
orToolsVersion=9.5.2237
kEvalVersion=0.8.0
kEvalVersion=0.9.0

lwjglVersion=3.3.2
jomlVersion=1.10.5

# see https://github.com/kotlin-graphics/mary/tree/master/kotlin/graphics for the subdirs and their versions
glmVersion=0.9.9.1-5
glnVersion=0.5.31
unoVersion=0.7.9+52
glmVersion=0.9.9.1-11
glnVersion=0.5.32
unoVersion=0.7.21

logbackClassicVersion=1.2.3
logbackEncoderVersion=6.4
logbackClassicVersion=1.2.9
logbackEncoderVersion=7.4
kotlinLoggingVersion=2.0.3

junitJupiterEngineVersion=5.9.1
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 17 additions & 12 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down

0 comments on commit 2b714cd

Please sign in to comment.