Expected and Results
Issue
When trying to relocate a library, some method parameters don't get relocated properly. E.g., when trying to include ktor version 3.1.3 into the project and relocate it, some parameters in io.ktor.http.Cookie.<init> don't get relocated correctly.
Expected result
The Cookie constructor has the signature (Ljava/lang/String;Ljava/lang/String;Lcom/example/shadowed/ktor/http/CookieEncoding;Ljava/lang/Integer;Lcom/example/shadowed/ktor/util/date/GMTDate;Ljava/lang/String;Ljava/lang/String;ZZLjava/util/Map;)V
Actual result
The Cookie constructor has the signature (Ljava/lang/String;Ljava/lang/String;Lio/ktor/http/CookieEncoding;Ljava/lang/Integer;Lio/ktor/util/date/GMTDate;Ljava/lang/String;Ljava/lang/String;ZZLjava/util/Map;)V
Related environment and versions
Gradle version: 8.13
shadow version: 8.3.5 (also tested with 9.0.0-beta13, has the same issue)
ktor version: 3.1.3
Reproduction steps
- Initialize a new gradle Kotlin application project.
- Add ktor as a dependency:
dependencies {
// Use the Kotlin JUnit 5 integration.
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
// Use the JUnit 5 integration.
testImplementation(libs.junit.jupiter.engine)
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
// This dependency is used by the application.
implementation(libs.guava)
implementation("io.ktor:ktor-client-core:3.1.3")
implementation("io.ktor:ktor-client-okhttp:3.1.3")
}
- Add shadowJar plugin and relocations:
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
// Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin.
alias(libs.plugins.kotlin.jvm)
// Apply the application plugin to add support for building a CLI application in Java.
application
id("com.gradleup.shadow") version "8.3.5"
}
[...]
tasks {
named<ShadowJar>("shadowJar") {
relocate("io.ktor", "org.example.shadowed.ktor")
}
}
- Run
$ ./gradlew build
- Inspect
org/example/shadowed/ktor/http/Cookie.class in app/build/libs/app-all.jar file
Anything else?
No response
Expected and Results
Issue
When trying to relocate a library, some method parameters don't get relocated properly. E.g., when trying to include ktor version 3.1.3 into the project and relocate it, some parameters in
io.ktor.http.Cookie.<init>don't get relocated correctly.Expected result
The
Cookieconstructor has the signature(Ljava/lang/String;Ljava/lang/String;Lcom/example/shadowed/ktor/http/CookieEncoding;Ljava/lang/Integer;Lcom/example/shadowed/ktor/util/date/GMTDate;Ljava/lang/String;Ljava/lang/String;ZZLjava/util/Map;)VActual result
The
Cookieconstructor has the signature(Ljava/lang/String;Ljava/lang/String;Lio/ktor/http/CookieEncoding;Ljava/lang/Integer;Lio/ktor/util/date/GMTDate;Ljava/lang/String;Ljava/lang/String;ZZLjava/util/Map;)VRelated environment and versions
Gradle version: 8.13
shadow version: 8.3.5 (also tested with 9.0.0-beta13, has the same issue)
ktor version: 3.1.3
Reproduction steps
dependencies { // Use the Kotlin JUnit 5 integration. testImplementation("org.jetbrains.kotlin:kotlin-test-junit5") // Use the JUnit 5 integration. testImplementation(libs.junit.jupiter.engine) testRuntimeOnly("org.junit.platform:junit-platform-launcher") // This dependency is used by the application. implementation(libs.guava) implementation("io.ktor:ktor-client-core:3.1.3") implementation("io.ktor:ktor-client-okhttp:3.1.3") }$ ./gradlew buildorg/example/shadowed/ktor/http/Cookie.classinapp/build/libs/app-all.jarfileAnything else?
No response