2020import java .util .ArrayList ;
2121import java .util .List ;
2222
23+ import org .gradle .api .Action ;
2324import org .gradle .api .Project ;
24- import org .gradle .util .ConfigureUtil ;
2525
2626import com .inet .gradle .setup .abstracts .AbstractSetupBuilder ;
2727import com .inet .gradle .setup .abstracts .DesktopStarter ;
@@ -127,10 +127,11 @@ public void setRunAfter( String runAfter ) {
127127 /**
128128 * Set a command that run after the installer.
129129 *
130- * @param closure the command
130+ * @param action the command
131131 */
132- public void runAfter ( Closure <?> closure ) {
133- runAfter = ConfigureUtil .configure ( closure , new DesktopStarter ( this ) );
132+ public void runAfter ( Action <? super DesktopStarter > action ) {
133+ runAfter = new DesktopStarter ( this );
134+ action .execute (runAfter );
134135 }
135136
136137 /**
@@ -155,19 +156,21 @@ public void setRunBeforeUninstall( String runAfter ) {
155156 /**
156157 * Set a command that run run before the uninstaller.
157158 *
158- * @param closue the command
159+ * @param action the command
159160 */
160- public void runBeforeUninstall ( Closure <DesktopStarter > closue ) {
161- runBeforeUninstall = ConfigureUtil .configure ( closue , new DesktopStarter ( this ) );
161+ public void runBeforeUninstall ( Action <? super DesktopStarter > action ) {
162+ runBeforeUninstall = new DesktopStarter ( this );
163+ action .execute (runBeforeUninstall );
162164 }
163165
164166 /**
165167 * Register a service.
166168 *
167- * @param closue the closure of the service definition
169+ * @param action the closure of the service definition
168170 */
169- public void service ( Closure <Service > closue ) {
170- Service service = ConfigureUtil .configure ( closue , new Service ( this ) );
171+ public void service ( Action <? super Service > action ) {
172+ Service service = new Service ( this );
173+ action .execute (service );
171174 services .add ( service );
172175 }
173176
@@ -183,10 +186,11 @@ public List<Service> getServices() {
183186 /**
184187 * Register a desktop starter.
185188 *
186- * @param closue the closure of the desktop starter's definition
189+ * @param action the closure of the desktop starter's definition
187190 */
188- public void desktopStarter ( Closure <?> closue ) {
189- DesktopStarter service = ConfigureUtil .configure ( closue , new DesktopStarter ( this ) );
191+ public void desktopStarter ( Action <? super DesktopStarter > action ) {
192+ DesktopStarter service = new DesktopStarter ( this );
193+ action .execute (service );
190194 desktopStarters .add ( service );
191195 }
192196
0 commit comments