Skip to content

Commit

Permalink
Added end state of practice 2b
Browse files Browse the repository at this point in the history
  • Loading branch information
arminzavada committed Sep 9, 2024
1 parent 8f4932c commit 57610bd
Show file tree
Hide file tree
Showing 44 changed files with 151 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ jobs:
uses: actions/upload-artifact@v4
with:
path: |
build/distributions/*
build/reports/*
**/build/distributions/*
**/build/reports/*
7 changes: 7 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
`kotlin-dsl`
}

repositories {
mavenCentral()
}
Empty file added buildSrc/settings.gradle.kts
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package hu.bme.mit.ase.shingler.gradle

import org.gradle.kotlin.dsl.application

plugins {
id("hu.bme.mit.ase.shingler.gradle.java")
application
}

tasks.distZip {
enabled = false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package hu.bme.mit.ase.shingler.gradle

plugins {
java
jacoco
`java-library`
}

java.toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}

repositories {
mavenCentral()
}

tasks {
test {
useJUnitPlatform()
testLogging.showStandardStreams = true
finalizedBy(jacocoTestReport)
}

jacocoTestReport {
inputs.files(test.get().outputs)
}
}
21 changes: 21 additions & 0 deletions diversity/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
plugins {
id("hu.bme.mit.ase.shingler.gradle.application")
}

application {
mainClass = "hu.bme.mit.ase.shingler.diversity.DiversityApp"
}

dependencies {
implementation(project(":logic"))

implementation(libs.slf4j.api)
implementation(libs.picocli)

runtimeOnly(libs.slf4j.log4j.impl)

testImplementation(libs.junit.jupiter.core)

testRuntimeOnly(libs.junit.jupiter.engine)
testRuntimeOnly(libs.junit.platform.launcher)
}
File renamed without changes.
16 changes: 16 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
# This file was generated by the Gradle 'init' task.
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format

[versions]
picoCli = "4.7.6"
slf4j = "1.7.25"
log4j = "2.23.1"
logback = "1.5.8"
jUnit = "5.10.0"

[libraries]
picocli = { group = "info.picocli", name = "picocli", version.ref = "picoCli" }
slf4j-api = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j" }
slf4j-log4j-impl = { group = "org.apache.logging.log4j", name = "log4j-slf4j-impl", version.ref = "log4j" }
slf4j-logback-impl = { group = "ch.qos.logback", name = "logback-classic", version.ref = "logback" }
junit-jupiter-core = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "jUnit" }
junit-jupiter-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "jUnit" }
junit-platform-launcher = { group = "org.junit.platform", name = "junit-platform-launcher" }
3 changes: 3 additions & 0 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins {
id("hu.bme.mit.ase.shingler.gradle.java")
}
16 changes: 16 additions & 0 deletions logic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
plugins {
id("hu.bme.mit.ase.shingler.gradle.java")
}

dependencies {
api(project(":lib"))

implementation(libs.slf4j.api)

runtimeOnly(libs.slf4j.log4j.impl)

testImplementation(libs.junit.jupiter.core)

testRuntimeOnly(libs.junit.jupiter.engine)
testRuntimeOnly(libs.junit.platform.launcher)
}
8 changes: 8 additions & 0 deletions logic/src/test/resources/log4j2.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# The root logger with appender name
rootLogger = INFO, STDOUT

# Assign STDOUT a valid appender & define its layout
appender.console.name = STDOUT
appender.console.type = Console
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = [%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n
14 changes: 7 additions & 7 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
* For more detailed information on multi-project builds, please refer to https://docs.gradle.org/8.10/userguide/multi_project_builds.html in the Gradle documentation.
*/

rootProject.name = "Shingler"

include(
"lib",
"logic",
"similarity",
"diversity",
)
21 changes: 21 additions & 0 deletions similarity/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
plugins {
id("hu.bme.mit.ase.shingler.gradle.application")
}

application {
mainClass = "hu.bme.mit.ase.shingler.similarity.SimilarityApp"
}

dependencies {
implementation(project(":logic"))

implementation(libs.slf4j.api)
implementation(libs.picocli)

runtimeOnly(libs.slf4j.logback.impl)

testImplementation(libs.junit.jupiter.core)

testRuntimeOnly(libs.junit.jupiter.engine)
testRuntimeOnly(libs.junit.platform.launcher)
}
11 changes: 11 additions & 0 deletions similarity/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<root level="debug">
<appender-ref ref="STDOUT" />
</root>
</configuration>

0 comments on commit 57610bd

Please sign in to comment.