Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expressing optional @InputFile and @InputDirectory properties #2016

Open
big-guy opened this issue May 11, 2017 · 20 comments
Open

Expressing optional @InputFile and @InputDirectory properties #2016

big-guy opened this issue May 11, 2017 · 20 comments
Labels
a:feature A new functionality in:writing-tasks task option

Comments

@big-guy
Copy link
Member

big-guy commented May 11, 2017

I'd like to express "this is a directory/file that is an input to my task, if it exists" with default values. This means that if the input exists, my task will use it. If it doesn't exist, that's OK. If the input is the wrong type (directory instead of a file or vice versa), I'd like to get an error.

Due to the way we validate @InputFile and @InputDirectory, it's not simple to define a property this way because we require that the file or directory exists. If a plugin doesn't define a default value, you can use @Optional and a null value for the property.

Expected Behavior

I should be able to have a property with a default value that is only validated if it exists.

Current Behavior

Property validation fails before the task executes when the directory/file does not exist.

Context

I can work around this by using @InputFiles or conditionally returning null if the path does not exist. If I use @InputFiles, it's inconvenient to use File as my property type because it makes it easy for someone to pass the wrong thing (a file vs a directory) and it looks a little odd to have @InputFiles File someProp. I could also use two properties. One that's just the File that's ignored by up-to-date checks and another that's a @InputFiles FileCollection. This still has the problem that the wrong thing could be used (file vs directory) and it's strange that I would need to use two properties.

Steps to Reproduce (for bugs)

Here's an example task that fails:

class CustomTask extends DefaultTask {
    @InputDirectory
    @Optional
    File inputDir = project.file("does-not-exist")

    @OutputFile
    File outputFile = new File(temporaryDir, "output.txt")

    @TaskAction
    void generate() {
       outputFile.text = "done"
    }
}

task customTask(type: CustomTask)

The same would apply for @InputFile.

Your Environment

This always happens.

@big-guy big-guy added a:feature A new functionality from:member in:core DO NOT USE labels May 11, 2017
@robbie-demuth
Copy link

Just ran into this today and I think this would be a nice improvement

@stewartbryson
Copy link

Yeah... I have to write a lot of code to get around this. I write getters that go through the logic of which parameters to use. It's really nasty.

Pokechu22 added a commit to Pokechu22/ForgeGradle-extensions that referenced this issue Feb 25, 2018
…t exist

It's perfectly valid for one of them to not exist; we'll just generate it.  It isn't valid for the apply- or generate- tasks, though, so I've left them unchanged.

The optional annotation doesn't work for this, see gradle/gradle#2016.  This issue was noted in Pokechu22/WorldDownloader#75.
cy6erGn0m pushed a commit to Kotlin/kotlin-frontend-plugin that referenced this issue Feb 27, 2018
This is required due to missing @optional support for directories
see gradle/gradle#2016
SUPERCILEX added a commit to Triple-T/gradle-play-publisher that referenced this issue Jun 22, 2018
See gradle/gradle#2016

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
bhurling pushed a commit to Triple-T/gradle-play-publisher that referenced this issue Jun 27, 2018
* Release notes fixes and other annotation improvements

- Make release notes dir optional (aka don't crash if it isn't there)
  - Remove pointless network call updating tracks
- Update out-of-date credentials annotations

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix much deeper problem due to poor Gradle APIs

See gradle/gradle#2016

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Add comment

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Make root creds file optional

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
bhurling pushed a commit to Triple-T/gradle-play-publisher that referenced this issue Jul 3, 2018
* Add support for Gradle cache

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix crash if not all listing details are provided

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Add incremental compilation support

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Finalize multidimensional resource merge support

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Tidy

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* More tests and cleanup

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Add support for Android App Bundles

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Docs

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Minor tidy

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Default to APKs since bundles require app signing

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Make validation incremental

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Small tidy

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Refactor release notes out of listings folder

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Slight perf optimization

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Narrow cache invalidation

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix broken release notes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Remove unnecessary comment

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix test naming

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Support applying plugin to dynamic-feature modules

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Update

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix more merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Add progress logger

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* More merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Final merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Downgrade AGP

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Remove `All` suffix

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* publishBundleRelease -> publishReleaseBundle

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Add CLI option

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Add changelog

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix broken warning logs

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Release notes fixes and other annotation improvements

- Make release notes dir optional (aka don't crash if it isn't there)
  - Remove pointless network call updating tracks
- Update out-of-date credentials annotations

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix much deeper problem due to poor Gradle APIs

See gradle/gradle#2016

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Add comment

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Upgrade to AGP 3.2 beta+ bundle naming conventions

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Prep for review

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Review feedback

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
bhurling pushed a commit to Triple-T/gradle-play-publisher that referenced this issue Jul 3, 2018
* Add support for Gradle cache

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix crash if not all listing details are provided

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Add incremental compilation support

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Finalize multidimensional resource merge support

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Tidy

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* More tests and cleanup

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Add support for Android App Bundles

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Docs

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Minor tidy

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Default to APKs since bundles require app signing

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Make validation incremental

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Small tidy

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Refactor release notes out of listings folder

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Slight perf optimization

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Narrow cache invalidation

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix broken release notes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Remove unnecessary comment

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix test naming

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Support applying plugin to dynamic-feature modules

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Update

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix more merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Add progress logger

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* More merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Final merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Downgrade AGP

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Remove `All` suffix

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* publishBundleRelease -> publishReleaseBundle

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Add CLI option

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Add changelog

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix broken warning logs

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Release notes fixes and other annotation improvements

- Make release notes dir optional (aka don't crash if it isn't there)
  - Remove pointless network call updating tracks
- Update out-of-date credentials annotations

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix much deeper problem due to poor Gradle APIs

See gradle/gradle#2016

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Add comment

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Upgrade to AGP 3.2 beta+ bundle naming conventions

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Prep for review

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Review feedback

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Don't upload 0 byte mapping files

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
@SUPERCILEX
Copy link
Contributor

@wolfs @big-guy Actually, this seemed pretty easy to do. See #5866

@johndevs
Copy link

Until we get this cool feature, I've been working around it like so:

@Optional
@InputDirectory
final Closure<File> dir = { new File('/path/to/dir').with { it.exists() ? it : null } }

Not pretty, but is a one-liner and does the job as far as I can tell.

@wolfs
Copy link
Member

wolfs commented Aug 28, 2018

I think that the current Gradle behaviour is consistent also with respect to properties - @optional means null for them. There is an easy workaround for returning null for a non-existant input file. It seems to be different to not specify an input file and specifying an input file which is not there.

I'll close this issue now since we don't want to change the meaning of @optional for file inputs. If you want an easier way to specify that missing input files are OK, a simple method on RegularFileProperty should be enough, right? That would instruct the RegularFileProperty to return null if the file does not exist. WDYT?

@wolfs wolfs closed this as completed Aug 28, 2018
@SUPERCILEX
Copy link
Contributor

@wolfs That sounds reasonable. And actually, the bug I was trying to solve was related to my property being a singleton:

val releaseNotesDir by lazy {
    File(resDir, RELEASE_NOTES_PATH).orNull()
}

That doesn't work because Gradle resolves properties multiple times. BTW, is that documented somewhere?

Instead, this is correct:

val releaseNotesDir
    get() = File(resDir, RELEASE_NOTES_PATH).orNull()

bhurling pushed a commit to Triple-T/gradle-play-publisher that referenced this issue Sep 11, 2018
* Release notes fixes and other annotation improvements

- Make release notes dir optional (aka don't crash if it isn't there)
  - Remove pointless network call updating tracks
- Update out-of-date credentials annotations

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix much deeper problem due to poor Gradle APIs

See gradle/gradle#2016

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Add comment

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Minimize mutability

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Small tidy

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Small fix

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
bhurling pushed a commit to Triple-T/gradle-play-publisher that referenced this issue Sep 11, 2018
* Add support for Gradle cache

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix crash if not all listing details are provided

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Add incremental compilation support

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Finalize multidimensional resource merge support

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Tidy

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* More tests and cleanup

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Minor tidy

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Support in-app products

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Make validation incremental

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Small tidy

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Refactor release notes out of listings folder

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Slight perf optimization

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Narrow cache invalidation

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix broken release notes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix parsing

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Rename for consistency

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix test naming

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Address review feedback

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Rename files

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Determine winner of conflicting flavor by order of dimension

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Add tests

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Tidy

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Massively simplify IAP parsing

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Tidy

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Add changelog

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Release notes fixes and other annotation improvements

- Make release notes dir optional (aka don't crash if it isn't there)
  - Remove pointless network call updating tracks
- Update out-of-date credentials annotations

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix much deeper problem due to poor Gradle APIs

See gradle/gradle#2016

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Add comment

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Small fixes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Support global CLI options

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Remove release notes, will update later to not conflict

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Fix merge mistakes

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

* Move product dir input initialization to task instead of plugin

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
@netvl
Copy link

netvl commented Mar 28, 2019

How do you express this for DirectoryProperty? Or even for mutable properties? As far as I understand, the above example with Closure cannot be used if the property can be set by the user.

My use case is to provide a default directory for the plugin users to write to, but if they don't need it, it shouldn't even be created, and the task can handle its absence just fine. If I just use @get:InputDirectory val someDirectory: DirectoryProperty, it fails with a validation exception if the directory does not exist.

I guess it might be possible to use a special provider which would return a null value if the directory does not exist, but it is really hacky if you want to rely on another property to compute the default value:

someDirectory.set(project.layout.buildDirectory("some-directory").flatMap {
    project.provider { if (it.asFile.exists()) it else null }
})

@adammurdoch
Copy link
Member

We should reopen this issue, as the original use case hasn't been addressed. "optional" in the title doesn't mean @Optional, it means "I don't care if it does not exist". That is, I want a way to say, for example: This property references an input file. The property must have a value, but it's ok if the location that the value points to does not exist, I'll deal with it in the task. The location must not point to a directory.

I should be able to do the same for the other kinds of inputs, such directories, collections of regular files, etc. This way, I can apply a convention to each task for things where it's ok for the thing to not exist, or I can wire in an output from some other task where it's ok for the task to not produce anything.

I'd also like a way to say "the file that this property refers to represents the 'source' or primary input of this task, so skip the task and remove old outputs if the file does not exist". This isn't quite the same as the behaviour of @SkipWhenEmpty, but is definitely the same intent.

@dsvoronin
Copy link

We should reopen this issue, as the original use case hasn't been addressed.

Yes, please!
My case is the task that could produce file, but it's also completely normal if it doesn't.
I should define outputs during configuration anyway, so it's not an @Optional RegularFileProperty,
but @Optional with "map-hack" @Input

@lacasseio lacasseio reopened this May 17, 2019
@lacasseio
Copy link
Contributor

I reopen the issue to avoid being ignored. We can summarize the work left to do in another issue and close this one later.

@realdadfish
Copy link

realdadfish commented Feb 5, 2020

Just for the people who stumble upon this and need to know how the "current" way of doing things there looks like, it's this:

open class SomeTask @Inject constructor(objects: ObjectFactory) : DefaultTask() {
    @InputFile
    @Optional
    val someOptionalFile: RegularFileProperty = objects.fileProperty()

    @TaskAction
    fun run() {
        val optionalFile: File? = someOptionalFile.orNull?.asFile
        // do your stuff here
    }
}

So, this means that if someOptionalFile is given, it must exist. If it is not given, it is null. Furthermore, RegularFileProperty has a convention(RegularFile) method that allows you to specify a default file in case it is not given.

@ZakTaccardi
Copy link

    @InputFile
    @Optional
    abstract val someOptionalFile: RegularFileProperty

@bamboo this solution does not work for me because if RegularFileProperty contains a null value, then the task dependency fails to wire up dependant tasks because the @Optional annotation treats it like there was no input provided.

@ZakTaccardi
Copy link

ZakTaccardi commented Aug 20, 2020

@pun-ky 's solution was the best workaround (as it allows you to continue to use providers on your APIs between tasks. But it shouldn't be needed!

I also used a noOp dir

@Internal
val compiledKotlinSource = objects.property(FileSystemLocation::class.java)
    .convention(layout.emptyDir)

@InputFiles
val _compiledKotlinSource = objects
    .fileCollection()
    .from(compiledKotlinSource)

private val ProjectLayout.emptyDir: Provider<Directory>
    get() = buildDir
        .map { it.dir("noOp") }
        .map {
            it.asFile.mkdirs()
            it
        }

@pun-ky
Copy link

pun-ky commented Aug 20, 2020

@ZakTaccardi thanks for the confirmation

@Clashsoft
Copy link

All the workarounds presented here are either Groovy or Kotlin. Is there an idiomatic alternative in plain Java?

@wolfs
Copy link
Member

wolfs commented Nov 10, 2021

Regarding all the workarounds above, I realized that you can add the @InputFiles annotation directly to the RegularFileProperty/RegularDirectoryProperty. So this should work:

@InputFiles
val configDir = project.objects.directoryProperty().convention("/a/b/c")

@TaskAction
fun process() {
    configDir.get().asFile.copyTo(otherDir) // as example
}

That means we have a way to express an input file which doesn't need to exist: Use @InputFiles. What Gradle doesn't have is then some additional validation that if the file exists that it is actual a file/directory.

@octylFractal octylFractal added in:writing-tasks task option and removed in:core DO NOT USE labels Dec 13, 2021
@twarner-sofi
Copy link

I worked around this using onlyIf:

onlyIf { inputFile.orNull?.asFile?.exists() ?: false }

Because the onlyIf block runs at execution time it is safe to get() or getOrNull() on the file property.

petershin added a commit to petershin/liferay-portal that referenced this issue May 18, 2022
petershin added a commit to petershin/liferay-portal that referenced this issue May 18, 2022
petershin added a commit to petershin/liferay-portal that referenced this issue May 18, 2022
petershin added a commit to petershin/liferay-portal that referenced this issue May 18, 2022
petershin added a commit to petershin/liferay-portal that referenced this issue May 18, 2022
petershin added a commit to petershin/liferay-portal that referenced this issue May 19, 2022
brianchandotcom pushed a commit to brianchandotcom/liferay-portal that referenced this issue May 19, 2022
eliasantosf pushed a commit to eliasantosf/liferay-portal that referenced this issue May 20, 2022
@Malinskiy
Copy link

For Kotlin: you can also pass a sealed class without the nullable/optional types with more specific details on everything that is needed. The classes need to implement Serializable AFAIU though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature A new functionality in:writing-tasks task option
Projects
None yet
Development

Successfully merging a pull request may close this issue.