Slackbot
08/16/2023, 11:15 AMVamsh S
08/16/2023, 11:16 AMVamsh S
08/16/2023, 11:18 AMprintln "\nConfiguring jacoco reports for project: " + name;
in outputVampire
08/16/2023, 11:34 AMsubprojects { ... }
is highly disouraged as it adds project coupling and thus works against more sophisticated Gradle features and optimizations, besides that it makes builds less readable and less maintainable.
Instead you should use convention plugins - for example implemented as precompiled script plugins - to have the common logic and then apply those convention plugins directly in the projects where their effect should be present.Vampire
08/16/2023, 11:35 AM{ Project subProject ->
looks fishy.
I think you test the if
condition and if it is true define a closure that is just not used. If you remove the Project subProject ->
, you probably get the result you intendedVamsh S
08/16/2023, 11:50 AM{ Project subProject ->
is fishy.. removed it and things work as expectedVamsh S
08/16/2023, 3:13 PMVampire
08/16/2023, 3:43 PM*{* Project subProject *-> not a closure but a code block* }
is a closure, not a code block.
So if (name == 'abcProject') *{* Project subProject *-> not a closure but a code block* }
is like when you do if (name == 'abcProject') "foo"
.
If the condition holds, the statement is evaluated. In the latter the statement is just defining a String literal. In the former, the statement is just defining a closure instance. But neither version does any more work than that.Vamsh S
08/16/2023, 4:32 PMVampire
08/16/2023, 4:37 PMVamsh S
08/16/2023, 4:52 PMVampire
08/16/2023, 5:03 PMVampire
08/16/2023, 5:03 PM