diff --git a/.idea/gradle.xml b/.idea/gradle.xml index b948380..ae87444 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -8,6 +8,8 @@ diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml index 131e44d..1e16934 100644 --- a/.idea/kotlinc.xml +++ b/.idea/kotlinc.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/build.gradle.kts b/demo/build.gradle.kts similarity index 77% rename from build.gradle.kts rename to demo/build.gradle.kts index 867591b..4116000 100644 --- a/build.gradle.kts +++ b/demo/build.gradle.kts @@ -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" } diff --git a/src/main/kotlin/nl/lengrand/opengraphkt/Main.kt b/demo/src/main/kotlin/fr/lengrand/opengraphkt/Main.kt similarity index 98% rename from src/main/kotlin/nl/lengrand/opengraphkt/Main.kt rename to demo/src/main/kotlin/fr/lengrand/opengraphkt/Main.kt index 8d60847..bf6f773 100644 --- a/src/main/kotlin/nl/lengrand/opengraphkt/Main.kt +++ b/demo/src/main/kotlin/fr/lengrand/opengraphkt/Main.kt @@ -1,4 +1,4 @@ -package nl.lengrand.opengraphkt +package fr.lengrand.opengraphkt import java.io.File diff --git a/opengraphkt/build.gradle.kts b/opengraphkt/build.gradle.kts new file mode 100644 index 0000000..b0dc2ab --- /dev/null +++ b/opengraphkt/build.gradle.kts @@ -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) +} \ No newline at end of file diff --git a/src/main/kotlin/nl/lengrand/opengraphkt/DocumentFetcher.kt b/opengraphkt/src/main/kotlin/fr/lengrand/opengraphkt/DocumentFetcher.kt similarity index 84% rename from src/main/kotlin/nl/lengrand/opengraphkt/DocumentFetcher.kt rename to opengraphkt/src/main/kotlin/fr/lengrand/opengraphkt/DocumentFetcher.kt index 4d98363..e7e78ec 100644 --- a/src/main/kotlin/nl/lengrand/opengraphkt/DocumentFetcher.kt +++ b/opengraphkt/src/main/kotlin/fr/lengrand/opengraphkt/DocumentFetcher.kt @@ -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) } } diff --git a/src/main/kotlin/nl/lengrand/opengraphkt/OpenGraphParser.kt b/opengraphkt/src/main/kotlin/fr/lengrand/opengraphkt/OpenGraphParser.kt similarity index 99% rename from src/main/kotlin/nl/lengrand/opengraphkt/OpenGraphParser.kt rename to opengraphkt/src/main/kotlin/fr/lengrand/opengraphkt/OpenGraphParser.kt index 78431e5..776d1a7 100644 --- a/src/main/kotlin/nl/lengrand/opengraphkt/OpenGraphParser.kt +++ b/opengraphkt/src/main/kotlin/fr/lengrand/opengraphkt/OpenGraphParser.kt @@ -1,4 +1,4 @@ -package nl.lengrand.opengraphkt +package fr.lengrand.opengraphkt import org.jsoup.nodes.Document import org.jsoup.select.Elements diff --git a/src/main/resources/example.html b/opengraphkt/src/main/resources/example.html similarity index 100% rename from src/main/resources/example.html rename to opengraphkt/src/main/resources/example.html diff --git a/src/test/kotlin/nl/lengrand/opengraphkt/OpenGraphParserTest.kt b/opengraphkt/src/test/kotlin/fr/lengrand/opengraphkt/OpenGraphParserTest.kt similarity index 99% rename from src/test/kotlin/nl/lengrand/opengraphkt/OpenGraphParserTest.kt rename to opengraphkt/src/test/kotlin/fr/lengrand/opengraphkt/OpenGraphParserTest.kt index 2cb4c31..c1ee33e 100644 --- a/src/test/kotlin/nl/lengrand/opengraphkt/OpenGraphParserTest.kt +++ b/opengraphkt/src/test/kotlin/fr/lengrand/opengraphkt/OpenGraphParserTest.kt @@ -1,4 +1,4 @@ -package nl.lengrand.opengraphkt +package fr.lengrand.opengraphkt import org.junit.jupiter.api.Test import kotlin.test.assertEquals diff --git a/settings.gradle.kts b/settings.gradle.kts index 06ec895..5867f24 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,4 +1,6 @@ plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" } -rootProject.name = "OpenGraphKt" \ No newline at end of file +rootProject.name = "OpenGraphKt" +include("opengraphkt") +include("demo") \ No newline at end of file