Skip to content

Commit 1a9151a

Browse files
feat: Adds java port of Lesson 2 Quiz and tests
1 parent 9270f51 commit 1a9151a

File tree

14 files changed

+946
-0
lines changed

14 files changed

+946
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# Linux start script should use lf
5+
/gradlew text eol=lf
6+
7+
# These are Windows script files and should use crlf
8+
*.bat text eol=crlf
9+
10+
# Binary files should be left untouched
11+
*.jar binary
12+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Ignore Gradle project-specific cache directory
2+
.gradle
3+
4+
# Ignore Gradle build output directory
5+
build
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* This file was generated by the Gradle 'init' task.
3+
*
4+
* This generated file contains a sample Java application project to get you started.
5+
* For more details on building Java & JVM projects, please refer to https://docs.gradle.org/9.0.0/userguide/building_java_projects.html in the Gradle documentation.
6+
*/
7+
8+
plugins {
9+
java
10+
id("org.springframework.boot") version "3.1.0"
11+
id("io.spring.dependency-management") version "1.1.0"
12+
application
13+
}
14+
repositories {
15+
// Use Maven Central for resolving dependencies.
16+
mavenCentral()
17+
flatDir {
18+
dirs("../../../../lib/java/codedifferently-instructional")
19+
}
20+
}
21+
22+
23+
// Instead of this (which doesn't work):
24+
// implementation("com.codedifferently.instructional:instructional-lib")
25+
26+
// Use direct file reference:
27+
dependencies {
28+
implementation("org.apache.commons:commons-text:1.10.0")
29+
implementation(project(":instructional-lib"))
30+
implementation("org.springframework.boot:spring-boot-starter")
31+
testImplementation("org.springframework.boot:spring-boot-starter-test")
32+
33+
34+
}
35+
36+
// Apply a specific Java toolchain to ease working on different environments.
37+
java {
38+
toolchain {
39+
languageVersion = JavaLanguageVersion.of(21)
40+
}
41+
}
42+
43+
application {
44+
// Define the main class for the application.
45+
mainClass.set("org.example.Lesson2")
46+
}
47+
48+
tasks.named<Test>("test") {
49+
// Use JUnit Platform for unit tests.
50+
useJUnitPlatform()
51+
}
52+
53+
tasks.withType<JavaCompile> {
54+
options.encoding = "UTF-8"
55+
}

0 commit comments

Comments
 (0)