Skip to content

Commit 3aa43d5

Browse files
committed
gradle run
1 parent fe11034 commit 3aa43d5

File tree

6 files changed

+138
-0
lines changed

6 files changed

+138
-0
lines changed

org.nodeclipse.enide.gradle/plugin.xml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,64 @@
297297
</shortcut>
298298
</extension>
299299

300+
<!-- for gradle run @since 0.15 -->
301+
<extension
302+
point="org.eclipse.debug.core.launchConfigurationTypes">
303+
<launchConfigurationType
304+
delegate="org.nodeclipse.enide.gradle.launch.run.LaunchConfigurationDelegate"
305+
id="org.nodeclipse.enide.gradle.launch.run.LaunchConfigurationType"
306+
modes="run"
307+
name="gradle run">
308+
</launchConfigurationType>
309+
</extension>
310+
<extension
311+
point= "org.eclipse.debug.ui.launchConfigurationTypeImages" >
312+
<launchConfigurationTypeImage
313+
configTypeID= "org.nodeclipse.enide.gradle.launch.run.LaunchConfigurationType"
314+
icon= "icons/gradle-icon-16x16_bottom_right_corner_run_half_size.png"
315+
id= "org.nodeclipse.enide.gradle.launch.run.LaunchConfigurationTypeImage" >
316+
</launchConfigurationTypeImage>
317+
</extension>
318+
<extension
319+
point="org.eclipse.debug.ui.launchConfigurationTabGroups">
320+
<launchConfigurationTabGroup
321+
class= "org.nodeclipse.enide.gradle.launch.run.LaunchConfigurationTabGroup"
322+
id= "org.nodeclipse.enide.gradle.launch.run.LaunchConfigurationTabGroup"
323+
type= "org.nodeclipse.enide.gradle.launch.run.LaunchConfigurationType" >
324+
</launchConfigurationTabGroup>
325+
</extension>
326+
<extension
327+
point= "org.eclipse.debug.ui.launchShortcuts" >
328+
<shortcut
329+
class= "org.nodeclipse.enide.gradle.launch.run.LaunchShortcut"
330+
icon= "icons/gradle-icon-16x16_bottom_right_corner_run_half_size.png"
331+
id= "org.nodeclipse.enide.gradle.launch.run.LaunchShortcut"
332+
label= "gradle run"
333+
modes= "run" >
334+
<configurationType
335+
id= "org.nodeclipse.enide.gradle.launch.run.LaunchConfigurationType" >
336+
</configurationType>
337+
<contextualLaunch>
338+
<enablement>
339+
<with
340+
variable= "selection" >
341+
<count
342+
value= "1" >
343+
</count>
344+
<iterate>
345+
<or>
346+
<test
347+
property= "org.eclipse.debug.ui.matchesPattern"
348+
value= "*.gradle" >
349+
</test>
350+
</or>
351+
</iterate>
352+
</with>
353+
</enablement>
354+
</contextualLaunch>
355+
</shortcut>
356+
</extension>
357+
300358

301359
<!-- for gradle task1 @since 0.15 -->
302360
<extension
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package org.nodeclipse.enide.gradle.launch.run;
2+
3+
import java.util.List;
4+
5+
import org.eclipse.core.runtime.CoreException;
6+
import org.eclipse.debug.core.ILaunchConfiguration;
7+
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
8+
import org.eclipse.jface.preference.IPreferenceStore;
9+
import org.nodeclipse.enide.gradle.preferences.GradleConstants;
10+
11+
/**
12+
* `build.gradle` Run As gradle run
13+
*
14+
* @since 0.15
15+
* @author Paul Verest
16+
*/
17+
public class LaunchConfigurationDelegate
18+
extends org.nodeclipse.enide.gradle.launch.LaunchConfigurationDelegate
19+
implements ILaunchConfigurationDelegate {
20+
21+
@Override
22+
protected void specialOptions(ILaunchConfiguration configuration,
23+
IPreferenceStore preferenceStore, List<String> cmdLine) throws CoreException {
24+
cmdLine.add("run");
25+
}
26+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package org.nodeclipse.enide.gradle.launch.run;
2+
3+
import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
4+
import org.eclipse.debug.ui.CommonTab;
5+
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
6+
import org.eclipse.debug.ui.ILaunchConfigurationTab;
7+
//import org.nodeclipse.debug.launch.LaunchConfigurationEnvironmentTab;
8+
9+
10+
/**
11+
* Using "Run"-->"Run Configurations"--> "New Configuration"-- > "Run" will lead
12+
* here.
13+
* @author Paul Verest
14+
**/
15+
public class LaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup {
16+
17+
@Override
18+
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
19+
ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
20+
// new LaunchConfigurationMainTab(),
21+
// new NodeArgumentsTab(),
22+
// new LaunchConfigurationEnvironmentTab(),
23+
new CommonTab()
24+
};
25+
setTabs(tabs);
26+
}
27+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package org.nodeclipse.enide.gradle.launch.run;
2+
3+
public class LaunchConfigurationType {
4+
5+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package org.nodeclipse.enide.gradle.launch.run;
2+
3+
import org.eclipse.debug.ui.ILaunchShortcut;
4+
import org.nodeclipse.enide.gradle.preferences.GradleConstants;
5+
6+
//import org.nodeclipse.ui.util.NodeclipseConsole;
7+
8+
/**
9+
* Using "Run As" --> gradle run
10+
**/
11+
public class LaunchShortcut
12+
extends org.nodeclipse.enide.gradle.launch.LaunchShortcut
13+
implements ILaunchShortcut
14+
{
15+
16+
@Override
17+
protected String getLaunchConfigurationTypeConstant() {
18+
return GradleConstants.LAUNCH_RUN_CONFIGURATION_TYPE_ID;
19+
}
20+
21+
}

org.nodeclipse.enide.gradle/src/org/nodeclipse/enide/gradle/preferences/GradleConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public class GradleConstants {
88
public static final String LAUNCH_DAEMON_CONFIGURATION_TYPE_ID = "org.nodeclipse.enide.gradle.launch.daemon.LaunchConfigurationType";
99
public static final String LAUNCH_JETTY_CONFIGURATION_TYPE_ID = "org.nodeclipse.enide.gradle.launch.jetty.LaunchConfigurationType";
1010
public static final String LAUNCH_JETTYECLIPSE_CONFIGURATION_TYPE_ID = "org.nodeclipse.enide.gradle.launch.jettyeclipse.LaunchConfigurationType";
11+
public static final String LAUNCH_RUN_CONFIGURATION_TYPE_ID = "org.nodeclipse.enide.gradle.launch.run.LaunchConfigurationType";
1112
public static final String LAUNCH_TASK1_CONFIGURATION_TYPE_ID = "org.nodeclipse.enide.gradle.launch.task1.LaunchConfigurationType";
1213
public static final String LAUNCH_TASK2_CONFIGURATION_TYPE_ID = "org.nodeclipse.enide.gradle.launch.task2.LaunchConfigurationType";
1314
public static final String LAUNCHGUI_CONFIGURATION_TYPE_ID = "org.nodeclipse.enide.gradle.launchgui.LaunchConfigurationType";

0 commit comments

Comments
 (0)