You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/howto.adoc
+72
Original file line number
Diff line number
Diff line change
@@ -92,10 +92,82 @@ A recipe can be defined as Spring bean using @Bean annotated method, see link:{r
92
92
NOTE: Remember to provide a description to all Actions to display the description to the user when the Action is applied.
93
93
94
94
=== Create a Condition
95
+
Every `Action` and every `Recipe` must have a `Condition` which defines if the `Recipe` or `Action` is applicable.
96
+
Therefore the `Condition` interface must be implemented which defines a `evaluate(ProjectContext)` method which must return true if the Recipe or Action is applicable and false otherwise.
97
+
A condition should only read from the `ProjectContext` and never modify the AST.
98
+
99
+
[source, java]
100
+
....
101
+
public class MyCondition implements Condition {
102
+
@Override
103
+
public boolean evaluate(ProjectContext context) {
104
+
// analyze ProjectContext to evaluate condition
105
+
}
106
+
}
107
+
....
108
+
109
+
=== Single and Multi module projects
110
+
Projects can come as single module or multi-module project.
111
+
Working with single module projects is significantly easier because only one `BuildFile` exists.
112
+
With multi-module projects the application modules play a central role and there must be means to
113
+
select a module.
114
+
115
+
==== Application Modules
116
+
A common multi-module project has a root modules which consists of one or more child modules which again can consist of multiple child modules and so on.
117
+
118
+
* The root module
119
+
* The application module(s), bundle all modules of an application and define the composition of deployable artifact buulding a runnable application, e.g. a war module
120
+
* The component module(s), define reusable components which are not deployable in isolation
121
+
122
+
[source, java]
123
+
....
124
+
public void apply(ProjectContext context) {
125
+
// Retrieve ApplicationModules
126
+
// TODO: Maybe ProjectModules ?
127
+
Modules modules = context.getModules();
128
+
129
+
// TODO: is this sufficient --> must all child modules share same groupId?
0 commit comments