diff --git a/build.gradle.kts b/build.gradle.kts index 3ce15f2..7e85250 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -32,18 +32,6 @@ subprojects { spotless { val javaVersion = JavaVersion.current() - if (javaVersion >= JavaVersion.VERSION_17) { - logger.warn("!!! WARNING !!!") - logger.warn("=================") - logger.warn( - " You are running Java version:[{}]. Spotless may not work well with JDK 17.", - javaVersion - ) - logger.warn( - " In IntelliJ, go to [File -> Build -> Execution, Build, Deployment -> Gradle] and check Gradle JVM" - ) - } - if (javaVersion < JavaVersion.VERSION_11) { throw GradleException("Java 11 or greater is required for spotless Gradle plugin.") } diff --git a/wallet-sdk/build.gradle.kts b/wallet-sdk/build.gradle.kts index c5adecb..16076ae 100644 --- a/wallet-sdk/build.gradle.kts +++ b/wallet-sdk/build.gradle.kts @@ -1,3 +1,4 @@ +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar import org.jetbrains.kotlin.gradle.tasks.KotlinCompile // The alias call in plugins scope produces IntelliJ false error which is suppressed here. @@ -8,10 +9,11 @@ plugins { signing alias(libs.plugins.kotlin.serialization) idea + id("com.github.johnrengelman.shadow") version "7.1.2" } fun DependencyHandler.testIntegrationImplementation(dependencyNotation: Any): Dependency? = - add("testIntegrationImplementation", dependencyNotation) + add("testIntegrationImplementation", dependencyNotation) sourceSets { val testIntegration by creating { @@ -59,14 +61,14 @@ idea.module { } val testIntegration by - tasks.register("integrationTest") { - useJUnitPlatform() + tasks.register("integrationTest") { + useJUnitPlatform() - testClassesDirs = sourceSets.getByName("testIntegration").output.classesDirs - classpath = sourceSets.getByName("testIntegration").runtimeClasspath + testClassesDirs = sourceSets.getByName("testIntegration").output.classesDirs + classpath = sourceSets.getByName("testIntegration").runtimeClasspath - mustRunAfter(tasks.test) - } + mustRunAfter(tasks.test) + } tasks.getByName("compileTestIntegrationKotlin") { (this as KotlinCompile).kotlinOptions.jvmTarget = JavaVersion.VERSION_11.toString() @@ -79,20 +81,47 @@ val dokkaOutputDir = buildDir.resolve("dokka") tasks.dokkaHtml { outputDirectory.set(dokkaOutputDir) } val deleteDokkaOutputDir by - tasks.register("deleteDokkaOutputDirectory") { delete(dokkaOutputDir) } + tasks.register("deleteDokkaOutputDirectory") { delete(dokkaOutputDir) } val javadocJar = - tasks.register("javadocJar") { - dependsOn(deleteDokkaOutputDir, tasks.dokkaHtml) - archiveClassifier.set("javadoc") - from(dokkaOutputDir) - } + tasks.register("javadocJar") { + dependsOn(deleteDokkaOutputDir, tasks.dokkaHtml) + archiveClassifier.set("javadoc") + from(dokkaOutputDir) + } val sourcesJar by - tasks.registering(Jar::class) { - archiveClassifier.set("sources") - from(kotlin.sourceSets.main.get().kotlin) + tasks.registering(Jar::class) { + archiveClassifier.set("sources") + from(kotlin.sourceSets.main.get().kotlin) + } + +val uberJar = + tasks.register("uberJar") { + archiveBaseName.set("kotlin-wallet-sdk-uber") + archiveClassifier.set("") // No classifier + + // Include all runtime dependencies + from(sourceSets.main.get().output) + configurations = listOf(project.configurations.runtimeClasspath.get()) + + // Relocations + relocate("com", "shadow.wallet-sdk.com") + relocate("io", "shadow.wallet-sdk.io") + relocate("mu", "shadow.wallet-sdk.mu") + relocate("net", "shadow.wallet-sdk.net") + relocate("okhttp3", "shadow.wallet-sdk.okhttp3") + relocate("okio", "shadow.wallet-sdk.okio") + relocate("org", "shadow.wallet-sdk.org") { exclude("org.stellar.walletsdk") } + } + +tasks { + build { + dependsOn(javadocJar) + dependsOn(sourcesJar) + dependsOn(uberJar) } +} publishing { repositories { diff --git a/wallet-sdk/src/testIntegration/kotlin/org/stellar/walletsdk/SponsorTest.kt b/wallet-sdk/src/testIntegration/kotlin/org/stellar/walletsdk/SponsorTest.kt index b7081f2..3750fca 100644 --- a/wallet-sdk/src/testIntegration/kotlin/org/stellar/walletsdk/SponsorTest.kt +++ b/wallet-sdk/src/testIntegration/kotlin/org/stellar/walletsdk/SponsorTest.kt @@ -11,7 +11,7 @@ class SponsorTest { private val stellar = wallet.stellar() private val account = wallet.stellar().account() private val sponsoringKey = - SigningKeyPair.fromSecret("SAHXRL7XY2RMUETMIRORXSQ7JJ73FOOF4OMLDSCJW22HRPMULKY4M7KP") + SigningKeyPair.fromSecret("SBHTWEF5U7FK53FLGDMBQYGXRUJ24VBM3M6VDXCHRIGCRG3Z64PH45LW") @Test @Order(0) fun testSponsorNewAccount(): Unit = runBlocking { createAccount() }