diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 8012ec0..a537b7e 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -10,6 +10,7 @@ diff --git a/demo-remote/build.gradle.kts b/demo-remote/build.gradle.kts new file mode 100644 index 0000000..9b66ba2 --- /dev/null +++ b/demo-remote/build.gradle.kts @@ -0,0 +1,28 @@ +plugins { + kotlin("jvm") + application +} + +group = "fr.lengrand" + +repositories { + mavenCentral() +} + +dependencies { + implementation("org.jsoup:jsoup:1.20.1") + implementation("fr.lengrand:opengraphkt:0.0.1") + testImplementation(kotlin("test")) +} + +tasks.test { + useJUnitPlatform() +} + +kotlin { + jvmToolchain(23) +} + +application { + mainClass = "fr.lengrand.opengraphkt.MainKt" +} diff --git a/demo-remote/src/main/kotlin/fr/lengrand/opengraphkt/Main.kt b/demo-remote/src/main/kotlin/fr/lengrand/opengraphkt/Main.kt new file mode 100644 index 0000000..fdb0624 --- /dev/null +++ b/demo-remote/src/main/kotlin/fr/lengrand/opengraphkt/Main.kt @@ -0,0 +1,38 @@ +package fr.lengrand.opengraphkt + +import org.jsoup.Jsoup + +/** + * This module is only here to verify that the latest Maven Central release can be imported and used as intended. + */ +fun main() { + val parser = OpenGraphParser() + + val html = """ + + + + Open Graph Example + + + + + + + + + + +

Example Page

+ + + """.trimIndent() + + println("Parsing from JSoup Document") + + val doc = Jsoup.parse(html) + val openGraphDataDoc = parser.parse(doc) + + println("Title: ${openGraphDataDoc.title}") + println("Is valid: ${openGraphDataDoc.isValid()}") +} diff --git a/demo/build.gradle.kts b/demo/build.gradle.kts index 60bfb31..a5b42ca 100644 --- a/demo/build.gradle.kts +++ b/demo/build.gradle.kts @@ -1,12 +1,11 @@ import org.gradle.kotlin.dsl.implementation plugins { - kotlin("jvm") version "2.1.21" + kotlin("jvm") application } -group = "nl.lengrand" -version = "0.1-SNAPSHOT" +group = "fr.lengrand" repositories { mavenCentral() @@ -18,22 +17,10 @@ dependencies { 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) } diff --git a/opengraphkt/build.gradle.kts b/opengraphkt/build.gradle.kts index 337ee2f..513f22e 100644 --- a/opengraphkt/build.gradle.kts +++ b/opengraphkt/build.gradle.kts @@ -1,7 +1,7 @@ import com.vanniktech.maven.publish.SonatypeHost plugins { - kotlin("jvm") version "2.1.21" + kotlin("jvm") id("com.vanniktech.maven.publish") version "0.30.0" } diff --git a/settings.gradle.kts b/settings.gradle.kts index 5867f24..9c6f925 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,6 +1,12 @@ +pluginManagement { + plugins { + kotlin("jvm") version "2.1.21" + } +} plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" } rootProject.name = "OpenGraphKt" include("opengraphkt") -include("demo") \ No newline at end of file +include("demo") +include("demo-remote") \ No newline at end of file