Skip to content

Commit

Permalink
Fix MergeAccessWideners issue when no access wideners
Browse files Browse the repository at this point in the history
  • Loading branch information
MsRandom committed Feb 16, 2025
1 parent 15b672e commit 80d409b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ org.gradle.configuration-cache=true
# org.gradle.unsafe.isolated-projects=true

group=net.msrandom
version=0.5.11
version=0.5.13
kotlin.code.style=official
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.provider.Property
import org.gradle.api.tasks.*
import kotlin.io.path.bufferedWriter
import kotlin.io.path.deleteIfExists

@CacheableTask
abstract class MergeAccessWideners : DefaultTask() {
Expand Down Expand Up @@ -37,7 +39,14 @@ abstract class MergeAccessWideners : DefaultTask() {

@TaskAction
fun generate() {
output.get().asFile.bufferedWriter().use {
val output = output.get().asFile.toPath()

if (input.isEmpty) {
output.deleteIfExists()
return
}

output.bufferedWriter().use {
val writer = AccessWidenerWriter()
val reader = AccessWidenerReader(writer)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ abstract class RemapAction : TransformAction<RemapAction.Parameters> {
@Input get

abstract val modFiles: ConfigurableFileCollection
@PathSensitive(PathSensitivity.ABSOLUTE)
@PathSensitive(PathSensitivity.NONE)
@InputFiles
get

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.gradle.api.plugins.ApplicationPlugin
import org.gradle.api.plugins.PluginAware
import org.gradle.api.tasks.JavaExec
import org.gradle.api.tasks.SourceSet
import org.gradle.configurationcache.extensions.serviceOf
import org.gradle.internal.extensions.core.serviceOf
import org.gradle.jvm.toolchain.JavaLanguageVersion
import org.gradle.jvm.toolchain.JavaToolchainService
import org.gradle.util.internal.GUtil
Expand Down

0 comments on commit 80d409b

Please sign in to comment.