Hi. A question about the FQNs that start with 'jav...
# gradle
j
Hi. A question about the FQNs that start with 'java', So in my build.gradle.kts I want to set timeout of some task. There is this property in DefaultTask
Copy code
@Override
    public Property<Duration> getTimeout() {
        return super.getTimeout();
    }
neat, right? But to set it, I need to construct Duration object:
Copy code
timeout.set(java.time.Duration.ofSeconds(10))
legit, right? Unfortunately, because gradle exposes the top level property named `java`(plugin extension). I simply cannot create such Duration object (
Unresolved reference: time
) What is the best-practice here, how to work around it?
v
Don't use FQCN but use an import
That also makes your code much more readable
j
👍 yeah that'll work.