gradle-execfork-plugin icon indicating copy to clipboard operation
gradle-execfork-plugin copied to clipboard

Conflict with DefaultTask.getTimeout()

Open NicolasRouquette opened this issue 3 years ago • 1 comments

To develop a task that extends JavaExecFork in a buildSrc folder, I have to define buildSrc/build.gradle like this:

plugins {
    id 'java-gradle-plugin'
}

repositories {
    mavenLocal()
    mavenCentral()
}

dependencies {
    implementation 'com.github.psxpaul:gradle-execfork-plugin:0.1.4'
}

Version 0.1.4 from 2016 is the latest version available on Maven Central.

With current Gradle 7.5.1, I get a conflict because of the definition of timeout in AbstractExecFork:

    @Input
    var timeout: Long = 60

(see: https://github.com/psxpaul/gradle-execfork-plugin/blob/master/src/main/kotlin/com/github/psxpaul/task/AbstractExecFork.kt#L86-L87)

The compiler detects a conflict with Gradle's DefaultTask.getTimeout: https://docs.gradle.org/current/javadoc/org/gradle/api/DefaultTask.html#getTimeout--

Unfortunately, due to the way Kotlin generates final properties, one cannot even override getTimeout() to be compatible with Gradle's DefaultTask.

NicolasRouquette avatar Aug 20 '22 00:08 NicolasRouquette

Versions 0.1.5 and up are in the gradle plugins repository, so I think you can add gradlePluginPortal() to your repositories and depend on a newer version. In the latest version, AbstractExecFork already extends DefaultTask, so I wouldn't think there would be any conflict.

psxpaul avatar Nov 01 '22 21:11 psxpaul