/* * This file was generated by the Gradle 'init' task. * * This generated file contains a sample Kotlin application project to get you started. * For more details on building Java & JVM projects, please refer to https://docs.gradle.org/8.10.1/userguide/building_java_projects.html in the Gradle documentation. */ plugins { // Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin. alias(libs.plugins.kotlin.jvm) kotlin("plugin.serialization") version "2.0.20" // Apply the application plugin to add support for building a CLI application in Java. application } repositories { // Use Maven Central for resolving dependencies. mavenCentral() } dependencies { implementation(libs.clikt) implementation(libs.jsoup) implementation(libs.okhttp) implementation(libs.json) testImplementation(libs.kotlin.test) testImplementation(libs.mockk) } kotlin { jvmToolchain(17) } version = "1.0.0" application { // Define the main class for the application. mainClass = "com.ustadmobile.zim2xapi.AppKt" } tasks.jar { manifest { attributes["Main-Class"] = application.mainClass // Entry point for your application } // Add runtime dependencies into the JAR file from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) }) duplicatesStrategy = DuplicatesStrategy.EXCLUDE archiveBaseName = "zim2xapi" archiveVersion = version.toString() } tasks.register("copyJarToJsTests") { dependsOn(tasks.jar) // Ensure the JAR task runs before copying val jarTask = tasks.jar.get() val jarFile = jarTask.archiveFile.get().asFile from(jarFile) into("../js-tests/build/libs") rename { "zim2xapi.jar" } } tasks.build { dependsOn("copyJarToJsTests") }