Skip to content

Commit 2aea0a9

Browse files
committed
Update build configuration for Kotlin projects
- Change build directory path to include 'kotlin' for clarity. - Remove unused dependencies related to testing and Guava from build files. - Clean up `libs.versions.toml` by removing version references for Guava and JUnit.
1 parent ef3d208 commit 2aea0a9

File tree

14 files changed

+13
-82
lines changed

14 files changed

+13
-82
lines changed

compiled_starters/kotlin/.codecrafters/compile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
set -e # Exit on failure
1010

1111
gradle build
12-
cd /tmp/codecrafters-build-redis/distributions
12+
cd /tmp/codecrafters-build-redis-kotlin/distributions
1313
rm -rf app
1414
tar -xvf app.tar

compiled_starters/kotlin/.codecrafters/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
set -e # Exit on failure
1010

11-
exec /tmp/codecrafters-build-redis/distributions/app/bin/app "$@"
11+
exec /tmp/codecrafters-build-redis-kotlin/distributions/app/bin/app "$@"

compiled_starters/kotlin/app/build.gradle.kts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* For more details on building Java & JVM projects, please refer to https://docs.gradle.org/9.1.0/userguide/building_java_projects.html in the Gradle documentation.
66
*/
77

8-
layout.buildDirectory.set(file("/tmp/codecrafters-build-redis"))
8+
layout.buildDirectory.set(file("/tmp/codecrafters-build-redis-kotlin"))
99

1010
plugins {
1111
// Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin.
@@ -21,16 +21,6 @@ repositories {
2121
}
2222

2323
dependencies {
24-
// Use the Kotlin Test integration.
25-
testImplementation("org.jetbrains.kotlin:kotlin-test")
26-
27-
// Use the JUnit 5 integration.
28-
testImplementation(libs.junit.jupiter.engine)
29-
30-
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
31-
32-
// This dependency is used by the application.
33-
implementation(libs.guava)
3424
}
3525

3626
// Apply a specific Java toolchain to ease working on different environments.
@@ -44,8 +34,3 @@ application {
4434
// Define the main class for the application.
4535
mainClass.set("AppKt")
4636
}
47-
48-
tasks.named<Test>("test") {
49-
// Use JUnit Platform for unit tests.
50-
useJUnitPlatform()
51-
}
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
# This file was generated by the Gradle 'init' task.
22
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
33

4-
[versions]
5-
guava = "33.4.6-jre"
6-
junit-jupiter-engine = "5.12.1"
7-
8-
[libraries]
9-
guava = { module = "com.google.guava:guava", version.ref = "guava" }
10-
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit-jupiter-engine" }
11-
124
[plugins]
135
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version = "2.2.0" }

compiled_starters/kotlin/your_program.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ set -e # Exit early if any commands fail
1515
(
1616
cd "$(dirname "$0")" # Ensure compile steps are run within the repository directory
1717
gradle build
18-
cd /tmp/codecrafters-build-redis/distributions
18+
cd /tmp/codecrafters-build-redis-kotlin/distributions
1919
rm -rf app
2020
tar -xvf app.tar
2121
)
@@ -24,4 +24,4 @@ set -e # Exit early if any commands fail
2424
#
2525
# - Edit this to change how your program runs locally
2626
# - Edit .codecrafters/run.sh to change how your program runs remotely
27-
exec /tmp/codecrafters-build-redis/distributions/app/bin/app "$@"
27+
exec /tmp/codecrafters-build-redis-kotlin/distributions/app/bin/app "$@"

solutions/kotlin/01-jm1/code/.codecrafters/compile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
set -e # Exit on failure
1010

1111
gradle build
12-
cd /tmp/codecrafters-build-redis/distributions
12+
cd /tmp/codecrafters-build-redis-kotlin/distributions
1313
rm -rf app
1414
tar -xvf app.tar

solutions/kotlin/01-jm1/code/.codecrafters/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
set -e # Exit on failure
1010

11-
exec /tmp/codecrafters-build-redis/distributions/app/bin/app "$@"
11+
exec /tmp/codecrafters-build-redis-kotlin/distributions/app/bin/app "$@"

solutions/kotlin/01-jm1/code/app/build.gradle.kts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* For more details on building Java & JVM projects, please refer to https://docs.gradle.org/9.1.0/userguide/building_java_projects.html in the Gradle documentation.
66
*/
77

8-
layout.buildDirectory.set(file("/tmp/codecrafters-build-redis"))
8+
layout.buildDirectory.set(file("/tmp/codecrafters-build-redis-kotlin"))
99

1010
plugins {
1111
// Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin.
@@ -21,16 +21,6 @@ repositories {
2121
}
2222

2323
dependencies {
24-
// Use the Kotlin Test integration.
25-
testImplementation("org.jetbrains.kotlin:kotlin-test")
26-
27-
// Use the JUnit 5 integration.
28-
testImplementation(libs.junit.jupiter.engine)
29-
30-
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
31-
32-
// This dependency is used by the application.
33-
implementation(libs.guava)
3424
}
3525

3626
// Apply a specific Java toolchain to ease working on different environments.
@@ -44,8 +34,3 @@ application {
4434
// Define the main class for the application.
4535
mainClass.set("AppKt")
4636
}
47-
48-
tasks.named<Test>("test") {
49-
// Use JUnit Platform for unit tests.
50-
useJUnitPlatform()
51-
}
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
# This file was generated by the Gradle 'init' task.
22
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
33

4-
[versions]
5-
guava = "33.4.6-jre"
6-
junit-jupiter-engine = "5.12.1"
7-
8-
[libraries]
9-
guava = { module = "com.google.guava:guava", version.ref = "guava" }
10-
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit-jupiter-engine" }
11-
124
[plugins]
135
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version = "2.2.0" }

solutions/kotlin/01-jm1/code/your_program.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ set -e # Exit early if any commands fail
1515
(
1616
cd "$(dirname "$0")" # Ensure compile steps are run within the repository directory
1717
gradle build
18-
cd /tmp/codecrafters-build-redis/distributions
18+
cd /tmp/codecrafters-build-redis-kotlin/distributions
1919
rm -rf app
2020
tar -xvf app.tar
2121
)
@@ -24,4 +24,4 @@ set -e # Exit early if any commands fail
2424
#
2525
# - Edit this to change how your program runs locally
2626
# - Edit .codecrafters/run.sh to change how your program runs remotely
27-
exec /tmp/codecrafters-build-redis/distributions/app/bin/app "$@"
27+
exec /tmp/codecrafters-build-redis-kotlin/distributions/app/bin/app "$@"

0 commit comments

Comments
 (0)