Skip to content

Commit

Permalink
cache downgraded jars
Browse files Browse the repository at this point in the history
  • Loading branch information
wagyourtail committed Jun 18, 2024
1 parent 7e73ecf commit f5dde94
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ abstract class JVMDowngraderExtension @Inject constructor(@get:Internal val proj

@get:Internal
internal val downgradedApis = defaultedMapOf<JavaVersion, File> { version ->
val downgradedPath = project.file(".gradle").resolve("jvmdg/java-api-${version}-downgraded.jar")
val downgradedPath = project.file(".gradle").resolve("jvmdg/java-api-${this.version}-${version}-downgraded.jar")

ClassDowngrader.downgradeTo(this.toFlags()).use {
ZipDowngrader.downgradeZip(it, apiJar.get().toPath(), emptySet(), downgradedPath.toPath())
if (!downgradedPath.exists() || project.gradle.startParameter.isRefreshDependencies) {
ClassDowngrader.downgradeTo(this.toFlags()).use {
ZipDowngrader.downgradeZip(it, apiJar.get().toPath(), emptySet(), downgradedPath.toPath())
}
}
downgradedPath
}
Expand Down

0 comments on commit f5dde94

Please sign in to comment.