Creating separate modules

* Lib module building
 * demo module needs fixing
This commit is contained in:
Julien Lengrand-Lambert
2025-05-16 14:21:56 +02:00
parent b8fc6da809
commit ccd3a6f3a6
10 changed files with 49 additions and 10 deletions

2
.idea/gradle.xml generated
View File

@@ -8,6 +8,8 @@
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/demo" />
<option value="$PROJECT_DIR$/opengraphkt" />
</set>
</option>
</GradleProjectSettings>

2
.idea/kotlinc.xml generated
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="2.1.20" />
<option name="version" value="2.1.21" />
</component>
</project>

View File

@@ -1,5 +1,5 @@
plugins {
kotlin("jvm") version "2.1.20"
kotlin("jvm") version "2.1.21"
application
}
@@ -11,7 +11,6 @@ repositories {
}
dependencies {
implementation("org.jsoup:jsoup:1.20.1")
testImplementation(kotlin("test"))
}
@@ -36,5 +35,5 @@ kotlin {
}
application {
mainClass = "nl.lengrand.opengraphkt.MainKt"
mainClass = "fr.lengrand.opengraphkt.MainKt"
}

View File

@@ -1,4 +1,4 @@
package nl.lengrand.opengraphkt
package fr.lengrand.opengraphkt
import java.io.File

View File

@@ -0,0 +1,35 @@
plugins {
kotlin("jvm") version "2.1.21"
}
group = "fr.lengrand"
version = "0.1-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
implementation("org.jsoup:jsoup:1.20.1")
testImplementation(kotlin("test"))
}
java {
withSourcesJar()
}
tasks.test {
useJUnitPlatform()
}
tasks.jar {
manifest {
attributes(mapOf("Implementation-Title" to project.name,
"Implementation-Version" to project.version))
}
}
kotlin {
jvmToolchain(23)
}

View File

@@ -1,7 +1,8 @@
package nl.lengrand.opengraphkt
package fr.lengrand.opengraphkt
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import java.io.File
/**
* DocumentFetcher's job is to take any type of input and transform it into a JSoup document for the Parser to then do its job
@@ -22,7 +23,7 @@ class DocumentFetcher {
* @param charsetName The charset to use for parsing (default is UTF-8)
* @return A JSoup Document representing the parsed HTML
*/
fun fromFile(file: java.io.File, charsetName: String = "UTF-8") : Document {
fun fromFile(file: File, charsetName: String = "UTF-8") : Document {
return Jsoup.parse(file, charsetName)
}
}

View File

@@ -1,4 +1,4 @@
package nl.lengrand.opengraphkt
package fr.lengrand.opengraphkt
import org.jsoup.nodes.Document
import org.jsoup.select.Elements

View File

@@ -1,4 +1,4 @@
package nl.lengrand.opengraphkt
package fr.lengrand.opengraphkt
import org.junit.jupiter.api.Test
import kotlin.test.assertEquals

View File

@@ -1,4 +1,6 @@
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}
rootProject.name = "OpenGraphKt"
rootProject.name = "OpenGraphKt"
include("opengraphkt")
include("demo")