[OFBIZ-11976] svg files not removed on clean

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[OFBIZ-11976] svg files not removed on clean

Jacques Le Roux
Administrator
Hi,

While looking at this issue I found that a simple "gradlew config" generates the files which are used by generatePluginDocumentation and
generateAllPluginsDocumentation.

So somehow these tasks are "activated" just launching any task. Does somebody knows why it's so?

Thanks

Jacques

grv
Reply | Threaded
Open this post in threaded view
|

Re: [OFBIZ-11976] svg files not removed on clean

grv
Hi Jacques -

This explains it nicely -
https://blog.softwaremill.com/my-task-whats-wrong-with-your-gradle-task-82312100c595

Turns out that gradle's configuration phase appears to be "running" the
tasks.

Best,
Girish




On Thu, Aug 27, 2020 at 3:12 PM Jacques Le Roux <
[hidden email]> wrote:

> Hi,
>
> While looking at this issue I found that a simple "gradlew config"
> generates the files which are used by generatePluginDocumentation and
> generateAllPluginsDocumentation.
>
> So somehow these tasks are "activated" just launching any task. Does
> somebody knows why it's so?
>
> Thanks
>
> Jacques
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [OFBIZ-11976] svg files not removed on clean

Jacques Le Roux
Administrator
Thanks Girish,

Yes, I found that too.

The weird part is if I run "gradlew generateAllPluginsDocumentation" then the OFBiz-Logo.svg in plugins are deleted. Not when I run any other task.

So it seems that config does not run completely the tasks. But if I put a

println("======================================================================")

just above

doLast { delete "${component}/src/docs/asciidoc/images/OFBiz-Logo.svg" }

Then running any tasks show the println.

So why Gradle does not then run

doLast { delete "${component}/src/docs/asciidoc/images/OFBiz-Logo.svg" }

is still a mystery to me.

Could be the component part missing. But it does not make more sense to me :D

Jacques

Le 27/08/2020 à 12:16, Girish Vasmatkar a écrit :

> Hi Jacques -
>
> This explains it nicely -
> https://blog.softwaremill.com/my-task-whats-wrong-with-your-gradle-task-82312100c595
>
> Turns out that gradle's configuration phase appears to be "running" the
> tasks.
>
> Best,
> Girish
>
>
>
>
> On Thu, Aug 27, 2020 at 3:12 PM Jacques Le Roux <
> [hidden email]> wrote:
>
>> Hi,
>>
>> While looking at this issue I found that a simple "gradlew config"
>> generates the files which are used by generatePluginDocumentation and
>> generateAllPluginsDocumentation.
>>
>> So somehow these tasks are "activated" just launching any task. Does
>> somebody knows why it's so?
>>
>> Thanks
>>
>> Jacques
>>
>>
grv
Reply | Threaded
Open this post in threaded view
|

Re: [OFBIZ-11976] svg files not removed on clean

grv
Hi Jacques

When you run "gradlew generateAllPluginsDocumentation", all "actions"
defined in the task '"generateAllPluginsDocumentation" get executed as part
of execution phase. doFirst and doLast are the actions defined hence they
get executed.

And when you run any other tasks, all tasks present in the project
(including subprojects) are just configured not executed*. *So when we run
say ./gradlew config, everything that is not defined an an action (doFirst,
doLast or any other action) gets executed as part of configuration phase
for generateAllPluginsDocumentation task.

doLast { delete "${component}/src/docs/asciidoc/images/OFBiz-Logo.svg" }
Above is supposed to be executed during execution phase of the task
because doLast is an action for the task.  If you define your print
statements inside doLast, you won't see it printed if you run any other
task.

The problem is the part that is generating the docs, should be defined in
an action but at present is part of configuration. That's why when other
tasks run, docs are generated but never deleted (deletion part being
defined in doLast).

Best Regards,
- Girish
Reply | Threaded
Open this post in threaded view
|

Re: [OFBIZ-11976] svg files not removed on clean

Jacques Le Roux
Administrator
Thanks Girish!

I'll have a look...

Jacques

Le 27/08/2020 à 14:21, Girish Vasmatkar a écrit :

> Hi Jacques
>
> When you run "gradlew generateAllPluginsDocumentation", all "actions"
> defined in the task '"generateAllPluginsDocumentation" get executed as part
> of execution phase. doFirst and doLast are the actions defined hence they
> get executed.
>
> And when you run any other tasks, all tasks present in the project
> (including subprojects) are just configured not executed*. *So when we run
> say ./gradlew config, everything that is not defined an an action (doFirst,
> doLast or any other action) gets executed as part of configuration phase
> for generateAllPluginsDocumentation task.
>
> doLast { delete "${component}/src/docs/asciidoc/images/OFBiz-Logo.svg" }
> Above is supposed to be executed during execution phase of the task
> because doLast is an action for the task.  If you define your print
> statements inside doLast, you won't see it printed if you run any other
> task.
>
> The problem is the part that is generating the docs, should be defined in
> an action but at present is part of configuration. That's why when other
> tasks run, docs are generated but never deleted (deletion part being
> defined in doLast).
>
> Best Regards,
> - Girish