Repository: cosinekitty/astronomy (language: python)

Issue:
kotlin: Upgrade the depedency and unbreak the demo
Fixes build issue after AstroTime rename

Alternative to #198


Discussion / hints:

Fix patch:
diff --git a/demo/java/build.gradle.kts b/demo/java/build.gradle.kts
index abd631a9..cdc95518 100644
--- a/demo/java/build.gradle.kts
+++ b/demo/java/build.gradle.kts
@@ -8,11 +8,13 @@ version = "0.0.1"
 
 repositories {
     mavenCentral()
-    maven("https://jitpack.io")
+    // maven("https://jitpack.io")
 }
 
 dependencies {
-    implementation("com.github.ebraminio:astronomy:2bcbf09edd335a42e013135e04c1418d0bdcde32")
+    implementation(fileTree("../../source/kotlin/build/libs"))
+    // Or resolve it from jitpack like,
+    //   implementation("com.github.cosinekitty:astronomy:0.0.1")
     testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
     testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
 }
diff --git a/source/kotlin/build.gradle.kts b/source/kotlin/build.gradle.kts
index 8ca1b9e2..fada47e2 100644
--- a/source/kotlin/build.gradle.kts
+++ b/source/kotlin/build.gradle.kts
@@ -35,6 +35,12 @@ val sourceJar by tasks.creating(Jar::class) {
     from(sourceSets["main"].allSource)
 }
 
+task("fatJar", type = Jar::class) {
+    from(configurations.runtimeClasspath.get().map(::zipTree))
+    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
+    with(tasks.jar.get())
+}
+
 publishing {
     publications {
         register("mavenJava", MavenPublication::class) {


Test patch:
diff --git a/demo/java/demotest b/demo/java/demotest
index 1f77e52a..c0732cc4 100755
--- a/demo/java/demotest
+++ b/demo/java/demotest
@@ -10,6 +10,9 @@ RunDemo()
     java -jar build/libs/astronomy-demo-0.0.1.jar $*
 }
 
+(echo "Build astronomy library jar" && cd ../../source/kotlin && ./gradlew fatJar)
+
+echo "Build astronomy java demo"
 ./gradlew jar || Fail "Cannot build jar file."
 echo ""
 echo "Java demos: starting"