2222
2323import org .gradle .api .Action ;
2424import org .gradle .api .Project ;
25+ import org .gradle .util .ConfigureUtil ;
2526
2627import com .inet .gradle .setup .abstracts .AbstractSetupBuilder ;
2728import com .inet .gradle .setup .abstracts .DesktopStarter ;
@@ -124,6 +125,15 @@ public void setRunAfter( String runAfter ) {
124125 this .runAfter .setExecutable ( runAfter );
125126 }
126127
128+ /**
129+ * Set a command that run after the installer.
130+ *
131+ * @param closure the command
132+ */
133+ public void runAfter ( Closure <?> closure ) {
134+ runAfter = ConfigureUtil .configure ( closure , new DesktopStarter ( this ) );
135+ }
136+
127137 /**
128138 * Set a command that run after the installer.
129139 *
@@ -153,6 +163,15 @@ public void setRunBeforeUninstall( String runAfter ) {
153163 this .runBeforeUninstall .setExecutable ( runAfter );
154164 }
155165
166+ /**
167+ * Set a command that run run before the uninstaller.
168+ *
169+ * @param closue the command
170+ */
171+ public void runBeforeUninstall ( Closure <DesktopStarter > closue ) {
172+ runBeforeUninstall = ConfigureUtil .configure ( closue , new DesktopStarter ( this ) );
173+ }
174+
156175 /**
157176 * Set a command that run run before the uninstaller.
158177 *
@@ -163,6 +182,16 @@ public void runBeforeUninstall( Action<? super DesktopStarter> action ) {
163182 action .execute (runBeforeUninstall );
164183 }
165184
185+ /**
186+ * Register a service.
187+ *
188+ * @param closue the closure of the service definition
189+ */
190+ public void service ( Closure <Service > closue ) {
191+ Service service = ConfigureUtil .configure ( closue , new Service ( this ) );
192+ services .add ( service );
193+ }
194+
166195 /**
167196 * Register a service.
168197 *
@@ -183,6 +212,16 @@ public List<Service> getServices() {
183212 return services ;
184213 }
185214
215+ /**
216+ * Register a desktop starter.
217+ *
218+ * @param closue the closure of the desktop starter's definition
219+ */
220+ public void desktopStarter ( Closure <?> closue ) {
221+ DesktopStarter service = ConfigureUtil .configure ( closue , new DesktopStarter ( this ) );
222+ desktopStarters .add ( service );
223+ }
224+
186225 /**
187226 * Register a desktop starter.
188227 *
0 commit comments