You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by lk...@apache.org on 2019/02/10 05:29:34 UTC
[incubator-netbeans] branch master updated: [NETBEANS-2039] Added
run and debug action to Spring Boot Applications
This is an automated email from the ASF dual-hosted git repository.
lkishalmi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new 13e8db7 [NETBEANS-2039] Added run and debug action to Spring Boot Applications
13e8db7 is described below
commit 13e8db7d4f1bb01ab31c0a243b0506c2d7d89f90
Author: Laszlo Kishalmi <la...@gmail.com>
AuthorDate: Fri Feb 1 00:47:40 2019 -0800
[NETBEANS-2039] Added run and debug action to Spring Boot Applications
---
.../gradle/spring/SpringActionProvider.java | 41 ++++++++++++++++++++++
.../modules/gradle/spring/action-mapping.xml | 33 +++++++++++++++++
.../gradle/tooling/NbProjectInfoBuilder.groovy | 7 ++--
3 files changed, 79 insertions(+), 2 deletions(-)
diff --git a/groovy/gradle.spring/src/org/netbeans/modules/gradle/spring/SpringActionProvider.java b/groovy/gradle.spring/src/org/netbeans/modules/gradle/spring/SpringActionProvider.java
new file mode 100644
index 0000000..189db5f
--- /dev/null
+++ b/groovy/gradle.spring/src/org/netbeans/modules/gradle/spring/SpringActionProvider.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.gradle.spring;
+
+import org.netbeans.modules.gradle.spi.actions.DefaultGradleActionsProvider;
+import org.netbeans.modules.gradle.spi.actions.GradleActionsProvider;
+import org.openide.util.lookup.ServiceProvider;
+import static org.netbeans.spi.project.ActionProvider.*;
+
+/**
+ * Provides run and debug action for spring boot apps out-of-the-box.
+ * @author lkishalmi
+ */
+@ServiceProvider(service = GradleActionsProvider.class)
+public class SpringActionProvider extends DefaultGradleActionsProvider {
+ private static final String[] SUPPORTED = new String[]{
+ COMMAND_RUN,
+ COMMAND_DEBUG,
+ };
+
+ public SpringActionProvider() {
+ super(SUPPORTED);
+ }
+
+}
diff --git a/groovy/gradle.spring/src/org/netbeans/modules/gradle/spring/action-mapping.xml b/groovy/gradle.spring/src/org/netbeans/modules/gradle/spring/action-mapping.xml
new file mode 100644
index 0000000..e438ad4
--- /dev/null
+++ b/groovy/gradle.spring/src/org/netbeans/modules/gradle/spring/action-mapping.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<!DOCTYPE actions SYSTEM "action-mapping.dtd">
+<actions>
+ <apply-for plugins="org.springframework.boot">
+ <action name="run" priority="100">
+ <args>bootRun</args>
+ </action>
+
+ <action name="debug" priority="100">
+ <args>bootRun --debug-jvm</args>
+ </action>
+ </apply-for>
+</actions>
diff --git a/groovy/gradle/netbeans-gradle-tooling/src/main/groovy/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.groovy b/groovy/gradle/netbeans-gradle-tooling/src/main/groovy/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.groovy
index 4b90a52..885b5e1 100644
--- a/groovy/gradle/netbeans-gradle-tooling/src/main/groovy/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.groovy
+++ b/groovy/gradle/netbeans-gradle-tooling/src/main/groovy/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.groovy
@@ -108,7 +108,7 @@ class NbProjectInfoBuilder {
sp.put(p.name, p.projectDir);
}
model.info.project_subProjects = sp;
-
+
Map<String, File> ib = new HashMap<>();
println "Gradle Version: $gradleVersion"
if (gradleVersion.compareTo(VersionNumber.parse('3.1')) >= 0) {
@@ -118,7 +118,7 @@ class NbProjectInfoBuilder {
}
}
model.info.project_includedBuilds = ib;
-
+
try {
model.info.buildClassPath = storeSet(project.buildscript.configurations.classpath.files)
} catch (Exception e) {
@@ -140,6 +140,9 @@ class NbProjectInfoBuilder {
'scala-base', 'scala', 'groovy-base', 'groovy',\
'distribution', 'application', 'maven', 'osgi', \
'jacoco', 'checkstyle', 'pmd', 'findbugs', 'ear', \
+ 'play', 'java-library-distribution', 'maven-publish',
+ 'ivy-publish', 'antlr', \
+ 'org.springframework.boot', \
'com.github.lkishalmi.gatling', \
'com.android.library', 'com.android.application']) {
if (project.plugins.hasPlugin(plugin)) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists