This message was deleted.
# community-support
s
This message was deleted.
m
> it is not shown in the list. What list are you talking about? Never mind got it, the task is not scheduled for execution, right?
Double check your task has a single output directory?
I usually pas a
TaskProvider
but I would expect this to work with a
Task
as well
j
it is only one
Copy code
@OutputDirectory public val outputDir: DirectoryProperty = objects.directoryProperty()

    @Internal
    public val outputFile: RegularFileProperty =
        objects.fileProperty().convention {
            val fileName = objectName.map { objectName -> "$objectName.kt" }.get()
            outputDir.get().file(fileName).asFile
        }
generateProjectDataTask
is a task provider indeed
Copy code
val generateProjectDataTask = project.tasks.register<GenerateProjectDataTask>(NAME)
šŸ‘ 1
m
The problem is the task depdency that is not setup right?
Maybe call
generateProjectDataTask.flatMap { it.outputFile }
? I don't believe in this too much but 🤷
j
mmm I am checking now the package and looks like it is not correct, I am going to execute the task manually and see where it is the output
m
Wait,
RegularFileProperty
is no good is?
Shouldn't
srcDir()
take
DirectoryProperty
instead?
j
the issue is I have mixed somehow the correct dirs, I did a huge refactor and I didn’t touch this part so it is really weird
m
Ah never mind, you have
outputDir
j
I am going to check why I have • hubdle/hubdle-gradle-plugin/build/generated/main/kotlin/hubdle/hubdle/gradle/plugin instead of • /Volumes/Dev/repos/gradle/hubdle/hubdle-gradle-plugin/build/generated/main/kotlin/com/javiersc/hubdle/hubdle/gradle/plugin
šŸ‘ 1
I think I know where it is the problem… I am setting the group from a
-P
property, it is only working in the root project, probably the subprojects are not looking for it correctly
m
šŸ‘ But even if the generated package was wrong, I would still expect the task dependency to be correctly setup
(so the task to appear in the list)
(but maybe that's another problem...-
j
yeah, I have another problem
I would like all APIs would be Lazy
SourceSets not being Lazy is annoying
I have moved it to the new
named
API
Copy code
internal val Project.kotlinSourceSetMainOrCommonMain: NamedDomainObjectSet<KotlinSourceSet>?
    get() =
        extensions.findByType<KotlinProjectExtension>()?.sourceSets?.named { name ->
            name == "main" || name == "commonMain"
        }
not sure if
onEach
is the way to add lazily the task outputs
m
sourceSets.all {}
maybe? (if you want to react to source sets being added?)
But
commonMain
and
main
are added quite early IIRC
j
the problem is I am removing them later with
setSrcDir
to delete the original ones (I use
main/kotlin
instead of
src/main/kotlin
) I am not sure how to ā€œdelete all default onesā€ lazily without affecting the new ones
m
Why remove them? Just leave them empty?
In my experience, the Gradle model is pretty much additive
j
because creating new dir in IDEA would show them
now they are hidden as they are deleted
m
Fun stuff šŸ˜…
j
I will check it tomorrow, too late to think clearly… probably I can just pick the existing ones, filter the default ones by checking if they include
src
, and add the new ones
to avoid ordering problems
m
The whole "generated sources IDE support" is not really working if you ask me. I lost countless hours trying to get lint to skip generated sources
j
whay do you mean with lint to skip generated?
Android linter?
or IDEA autocomplete
m
Yea, Android
I want IDEA autocomplete for all symbols, even autogenerated ones
I've given up on search scopes that exclude auto-generated files though, that would also be a nice one to have
But anyways, let me know how that works tomorrow!
j
That is weird, I want the opposite and all the dagger symbols are there hahah
šŸ˜„ 1
m
I mean they're technically callable from the main source set, right? The "good" fix is to refactor the Dagger code to hide the implementation details.
j
yeah, they are. But how do you want to avoid that? only by internal modifier and suppressing the issue in the generated component
m
Yea, easier said than done. Maybe some
@OptIn
magic
j
Deprecated hidden too
TBH I would like a bunch of good annotations added to the kotlin stdlib
Generated, Hidden, Language (to avoid using the intellij one)
And more I don’t remember now