I tried using `task.named` to create my bits but I...
# community-support
b
I tried using
task.named
to create my bits but I get an error:
The task '...' (org....Task) is not a subclass of the given type
๐Ÿงต 1
v
Please do not split topics across several threads. This makes following the conversation in the threads view very hard as the context of the other messages is missing. If you have additional information either edit the original message or post to its thread. Regarding the question, as you said
dependsOn
,
myBits
must run before
originalTask
as
originalTask
depends on
myBits
. The
shouldRunAfter
or also
mustRunAfter
are only ordering constraints in case no
dependsOn
exists between those tasks. How to do it right heavily depends on what you want to do. If you for example want to run
myBits
after
originalTask
automatically but only if
originalTask
was successful, configure
myBits
as
finalizedBy
of
originalTask
and make
myBits
depends on
orignalTask
. But if
myBits
modifies the output of
originalTask
then you should not even ever consider doing that. No two task should ever touch the same output files. For that, you could for example simply register a
doLast
action to the
originalTask
, so that your "additional bits" are actually part of the task action(s) of
originalTask
.
b
> you could for example simply register a
doLast
action to the
originalTask
What I'm asking is: how do I do that? ๐Ÿ™‚
I'm not sure what you mean by an "action", or how one "register"s an action to a Task
v
Copy code
tasks.named("originalTask") {
    doLast {
        ...
    }
}
Please have a look at the documentation. ๐Ÿ˜‰
b
> taks.named I already said I tried that and it causes an error
n
it's
tasks
not
task
v
I already said I tried that and it causes an error
No, you did not. You tried
Copy code
tasks.named<MyBits>("originalTask")
But the task
orignalTask
is not of type
MyBits
and that is what that error tells you.
@Niels Doucet that was probably a typo by him just here, or the error message would be different. ๐Ÿ™‚
๐Ÿ‘Œ 1
b
You tried
Copy code
tasks.named<MyBits>("originalTask")
No, I did not
I tried
tasks.named("originalTask", PythonTask) {
v
That's the same, just in Groovy DSL
orignalTask
is not of type
PythonTask
b
But the task
orignalTask
is not of type
MyBits
and that is what that error tells you.
So the question is outstanding: how do I "simply register a
doLast
action to the
originalTask
"?
v
The question is not outstanding but answered, you just ignore me ๐Ÿคทโ€โ™‚๏ธ
b
LOL
dude you're not helping
v
Am I not?
I told you exactly what to do, "dude"
b
how can I get my bits, which are a PythonTask, to run after an existing task?
v
I already told you above
b
> I told you exactly what to do, "dude" Where?
v
Right in my first reply
Btw. I strongly recommend switching to Kotlin DSL. By now it is the default DSL, you immediately get type-safe build scripts, actually helpful error messages if you mess up the syntax, and amazingly better IDE support if you use a good IDE like IntelliJ IDEA or Android Studio.
b
Right in my first reply
Again, that's not helpful
we're not communicating
v
Seems so. You ask a question, I answer it right in the first answer, you say I did not answer. Find the error ๐Ÿ˜‰
b
@Vampire perhaps walk away for a few minutes, stop participating in this thread, and let others chime in?
v
Slack has an ignore function, if you don't want to be helped, just use it. ๐Ÿ˜‰
b
that won't stop other people seeing your responses and coming to the conclusion that my question has been dealt with
v
Well, if they open the thread and read the first reply, they come to the same conclusion ๐Ÿ™‚
b
my task is modifying the output of the original task
so that doesn't answer my question
v
Ah, so now we are communicating, because you did not mention that with one whimp before. Then the answer is, don't do it. A task must never modify the outputs of another task.
Add your bits as
doLast
action instead.
b
you're not making any sense
v
Just as I also said
b
"don't do it"?
don't do what?
v
Don't have a task that modifies the outputs of another task. A task must never modify the outputs of another task in-place.
b
woah there
you've changed your tune
v
That is a sub-genre of "overlapping task outputs" and that is extremely bad.
b
you've added a new qualifier to what you said before
your new words are "in-place"
v
If it is not in-place, it does not modify the outputs, it processes them ๐Ÿ™‚
b
jesus christ man
v
So just make your task have inputs that you configure from the outputs of the original task. Then you don't even need a
dependsOn
which is bad-practice for such cases anyway.
b
when you think of yourself as being helpful to other people, please remember what I'm about to tell you: there's a difference between helping people and putting yourself above others by hoarding information
seriously, please give some thought to what your goals are when you interact with people on Slack and whether you're really helping other people or just helping yourself
v
I'm not hoarding any information, I'm giving you all information that is relevant given the details you shared of your problem. If you get insufficient answers, maybe think about whether you shared too few information to get a good answer. ๐Ÿ˜‰
b
I'm not hoarding any information
I disagree.
just give it some thought perhaps
for consideration
v
I did give it a thought and I don't see your point at all. And the maaany people I helped here already and were extremely grateful, sometimes even sending me some bucks form their own initiative shows that your evaluation of my helpfulness is incorrect. But well, you seem to not want be helped by me and that's fine, I don't have to waste my sparse spare time in trying to help you if you don't want do. ๐Ÿ‘‹
โž• 1
b
I don't see your point at all
Maybe a little bit more time than just a couple of minutes. Maybe let it percolate for a few days.
v
Sure, I will give it a few days and then say exactly the same. You are not the first not being able to cope with direct answers and questions. But just because 1-2% of people I genuinely try to help with my best effort cannot cope with my way of helping I don't see how that should cause me to change my way. Remember, I'm not paid supported or anything. I'm just a user like you in a user community that is trying to help fellow users in his spare time. In such cases, maybe you should also give the communication a few days thought and decide for yourself whether it was really me that was the problem. ๐Ÿ˜‰
b
I will give it a few days and then say exactly the same.
If you've already decided that you won't change your mind then you aren't actually considering.
% of people I genuinely try to help with my best effort cannot cope with my way of helping
That's very telling. Maybe pay attention to the fact that any such people at all exist.
maybe you should also give the communication a few days thought and decide for yourself whether it was really me that was the problem
I will. I'll even come back and tell you about my thoughts.
n
Let's take a step back: @Bob Ham could you reread this part of Vampire's original response? I believe the answer to your question is in there (2nd paragraph).
Regarding the question, as you said
dependsOn
,
myBits
must run before
originalTask
as
originalTask
depends on
myBits
.
The
shouldRunAfter
or also
mustRunAfter
are only ordering constraints in case no
dependsOn
exists between those tasks.
How to do it right heavily depends on what you want to do.
If you for example want to run
myBits
after
originalTask
automatically but only if
originalTask
was successful, configure
myBits
as
finalizedBy
of
originalTask
and make
myBits
depends on
orignalTask
.
If you need any specific guidance on how to configure this dependency relation between your
myBits
task and the
originalTask
, please show what you tried and the specific error you're getting. For reference: https://docs.gradle.org/current/userguide/controlling_task_execution.html#sec:ordering_tasks
b
Thanks but I'm now past the technical issue here, I don't need any help with that.
๐Ÿ‘ 1
v
If you've already decided that you won't change your mind then you aren't actually considering.
So you are calling me a liar now? Do you really think this is the best way to act in an open community (or any group of people)? If I say I'll think about it, I will. That I came to a conclusion once does not mean I come to the same conclusion again, even though it's possible. But your behavior makes it hard to come to a different conclusion.
That's very telling. Maybe pay attention to the fact that any such people at all exist.
That doesn't mean anything, because none can communicate in a way that targets each and every person in the world, that's just impossible. So no matter what you do, there will always be people that cannot cope with it, that's a simple fact. Also, when having similar conversations there are usually also people sympathizing in private messages, asking how I can stay that calm and that they agree to me. They just don't say it in the open because they don't want to become a target themselves.
b
maybe you should also give the communication a few days thought and decide for yourself whether it was really me that was the problem
So I gave it some thought. I think it was definitely you that was the problem. I only just saw your last comment from Friday so I'll respond:
So you are calling me a liar now?
No, just pointing out that if you decide the outcome of some planned thinking beforehand then the planned thinking will only lead to the decided outcome.
Do you really think this is the best way to act in an open community (or any group of people)?
I don't know what the best way to act is in the face of people like yourself. I'm just doing the best I can in the challenging circumstances of interacting with people like you.
๐Ÿ’Š 1
v
> So I gave it some thought. I think it was definitely you that was the problem.
Me too, and I'm also pretty confident still, that the problem is not me.
> So you are calling me a liar now?
No, just pointing out that if you decide the outcome of some planned thinking beforehand then the planned thinking will only lead to the decided outcome.
Ok, you did not say I'm a liar, you implied I'm a liar. Because if you would not have thought that I decided already, you would not have written that comment. So by writing that comment you implied (at least that is what receivers of that statement most likely interpret) that I decided already and thus implied that I'm a liar when saying I will think about it and consider. If it walks like a duck and sounds like a duck, it usually is a duck, even if someone states it is something different.
I don't know what the best way to act is in the face of people like yourself. I'm just doing the best I can in the challenging circumstances of interacting with people like you.
If that was the best you can do when communicating in an open community with people trying to help you with your problems in their spare time, then you should maybe take some communications training. ๐Ÿ˜‰ Anyway, as we now clarified our outcomes of thinking about it, I'm back to my originally last statement and will not continue this discussion any further. ๐Ÿ™‚
b
if you would not have thought that I decided already
You stated what your conclusion would be ahead of time:
I will give it a few days and then say exactly the same.
I'm not sure where the confusion is.
you implied ... that I decided already and thus implied that I'm a liar
There's no implication, I'm just reflecting what you've said yourself. I don't think you're a liar but I do think you're deluded.
v
That was a prediction, not a predecision, and you inteepreting it in a way that suits your arguments best. Also your words don't make it any better. Whether you call me a liar for assuming I don't do what I say I will do, or whether you call me dumb or deluded because you take slightly different assumptions, your words and behavior do not match your intent to get free help by fellow users in their spare time. If you want first-class pampering with high-trained communicators that adapt their behavior 100% to you as receiver and how you expect to be treated and talked to, I strongly suggest you search for someone that does this for money, where you then get exactly what you expect and pay for. :-)
b
I thought you weren't going to continue this discussion any further.
๐Ÿ™„ 1