You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/08/28 04:20:27 UTC

[GitHub] [netbeans] lkishalmi opened a new pull request #3135: [NETBEANS-5941] Add generic execute.task action to Gradle projects

lkishalmi opened a new pull request #3135:
URL: https://github.com/apache/netbeans/pull/3135


   My current work is based on the delivery branch, however I do not think this one would be required for 12.5.
   This one would assign a real action to the GradleTask-s on the Navigator nodes.
   
   I'm sorry I pushed a reformat on ActionProviderImpl.java...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] lkishalmi commented on a change in pull request #3135: [NETBEANS-5941] Add generic execute.task action to Gradle projects

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on a change in pull request #3135:
URL: https://github.com/apache/netbeans/pull/3135#discussion_r699457049



##########
File path: extide/gradle/src/org/netbeans/modules/gradle/ActionProviderImpl.java
##########
@@ -500,14 +503,12 @@ Action forProject(Project p, FileObject fo) {
     private final class CustomPopupActions extends AbstractAction implements Presenter.Popup {
 
         private final boolean onFile;
-        private final boolean onGradle;
         private final Lookup lookup;
 
         @SuppressWarnings("OverridableMethodCallInConstructor")
         private CustomPopupActions(boolean onFile, boolean onGradleFile, FileObject fo) {

Review comment:
       Well it is not used, but calculated earlier. This one is a copy+paste left over from the maven plugin. Probably have to check why we calculate that on the first place, also check that in the "original" maven plugin code as well.

##########
File path: extide/gradle/src/org/netbeans/modules/gradle/nodes/TaskNode.java
##########
@@ -45,6 +46,8 @@
     @StaticResource
     private static final String TASK_ICON = "org/netbeans/modules/gradle/resources/gradle-task.gif";
 
+    public static final String EXECUTE_TASK_ACTION = "execute.task"; //NOI18N

Review comment:
       Good catch! I've put the constant in different places initially all around the source code. RunUtils might be not the final place.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] lkishalmi commented on pull request #3135: [NETBEANS-5941] Add generic execute.task action to Gradle projects

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on pull request #3135:
URL: https://github.com/apache/netbeans/pull/3135#issuecomment-909367806


   Ad of ```RunTaskActionMapping()``` you are right, I changed the code first to get the mapping for ```execute.task```, then it included the replacement token, then I changed the code doing this unnecessary custom action mapping class. Thanks for the review! Really useful! I'm trying to get back to the game after a long pause...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on a change in pull request #3135: [NETBEANS-5941] Add generic execute.task action to Gradle projects

Posted by GitBox <gi...@apache.org>.
sdedic commented on a change in pull request #3135:
URL: https://github.com/apache/netbeans/pull/3135#discussion_r697812774



##########
File path: extide/gradle/src/org/netbeans/modules/gradle/actions/DefaultActionMapping.java
##########
@@ -146,6 +146,12 @@ public boolean equals(Object obj) {
         return Objects.equals(this.withPlugins, other.withPlugins);
     }
 
+    @Override
+    public String toString() {
+        return name + " [" + args + ']';
+    }
+
+    

Review comment:
       Great for debugging !

##########
File path: extide/gradle/src/org/netbeans/modules/gradle/nodes/TaskNode.java
##########
@@ -45,6 +46,8 @@
     @StaticResource
     private static final String TASK_ICON = "org/netbeans/modules/gradle/resources/gradle-task.gif";
 
+    public static final String EXECUTE_TASK_ACTION = "execute.task"; //NOI18N

Review comment:
       Possibly use `RunUtils.EXECUTE_TASK_ACTION` API constant ?

##########
File path: extide/gradle/src/org/netbeans/modules/gradle/api/execute/RunUtils.java
##########
@@ -90,6 +90,9 @@
     public static final String PROP_INCLUDE_OPEN_PROJECTS = "include.open.projects"; //NOI18N
     public static final String PROP_DEFAULT_CLI = "gradle.cli"; //NOI18N
 
+    /** Action to execute specific Gradle Tasks from the IDE (Eg. from Navigator). */
+    public static final String EXECUTE_TASK_ACTION = "execute.task"; //NOI18N

Review comment:
       API change -- `@since` and mention in `apichanges.xml`.

##########
File path: extide/gradle/src/org/netbeans/modules/gradle/ActionProviderImpl.java
##########
@@ -500,14 +503,12 @@ Action forProject(Project p, FileObject fo) {
     private final class CustomPopupActions extends AbstractAction implements Presenter.Popup {
 
         private final boolean onFile;
-        private final boolean onGradle;
         private final Lookup lookup;
 
         @SuppressWarnings("OverridableMethodCallInConstructor")
         private CustomPopupActions(boolean onFile, boolean onGradleFile, FileObject fo) {

Review comment:
       is `onGradleFile` parameter used ?

##########
File path: extide/gradle/src/org/netbeans/modules/gradle/actions/GradleTaskTokenProvider.java
##########
@@ -0,0 +1,80 @@
+/*
+ * 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.actions;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import org.netbeans.modules.gradle.api.GradleTask;
+import org.netbeans.modules.gradle.api.NbGradleProject;
+import org.netbeans.modules.gradle.spi.actions.ReplaceTokenProvider;
+import org.netbeans.spi.project.ProjectServiceProvider;
+import org.openide.util.Lookup;
+
+/**
+ *
+ * @author lkishalmi
+ */
+@ProjectServiceProvider(service = ReplaceTokenProvider.class, projectType = NbGradleProject.GRADLE_PROJECT_TYPE)
+public class GradleTaskTokenProvider implements ReplaceTokenProvider {
+
+    private static Set<String> SUPPORTED = Collections.unmodifiableSet(new HashSet(Arrays.asList(
+       "taskName",
+       "taskPath",
+       "taskNames",
+       "taskPaths"
+    )));

Review comment:
       Should be mentioned in `apichanges.xml`, possibly in some generated doc for Gradle actions ? Technically it becomes part of API ... or make a comment note the tokens are never meant to be used widely.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] lkishalmi commented on a change in pull request #3135: [NETBEANS-5941] Add generic execute.task action to Gradle projects

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on a change in pull request #3135:
URL: https://github.com/apache/netbeans/pull/3135#discussion_r699460818



##########
File path: extide/gradle/src/org/netbeans/modules/gradle/actions/DefaultActionMapping.java
##########
@@ -146,6 +146,12 @@ public boolean equals(Object obj) {
         return Objects.equals(this.withPlugins, other.withPlugins);
     }
 
+    @Override
+    public String toString() {
+        return name + " [" + args + ']';
+    }
+
+    

Review comment:
       Yes. It seems I was debugging the code...




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] lkishalmi commented on a change in pull request #3135: [NETBEANS-5941] Add generic execute.task action to Gradle projects

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on a change in pull request #3135:
URL: https://github.com/apache/netbeans/pull/3135#discussion_r699444508



##########
File path: extide/gradle/src/org/netbeans/modules/gradle/actions/GradleTaskTokenProvider.java
##########
@@ -0,0 +1,80 @@
+/*
+ * 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.actions;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import org.netbeans.modules.gradle.api.GradleTask;
+import org.netbeans.modules.gradle.api.NbGradleProject;
+import org.netbeans.modules.gradle.spi.actions.ReplaceTokenProvider;
+import org.netbeans.spi.project.ProjectServiceProvider;
+import org.openide.util.Lookup;
+
+/**
+ *
+ * @author lkishalmi
+ */
+@ProjectServiceProvider(service = ReplaceTokenProvider.class, projectType = NbGradleProject.GRADLE_PROJECT_TYPE)
+public class GradleTaskTokenProvider implements ReplaceTokenProvider {
+
+    private static Set<String> SUPPORTED = Collections.unmodifiableSet(new HashSet(Arrays.asList(
+       "taskName",
+       "taskPath",
+       "taskNames",
+       "taskPaths"
+    )));

Review comment:
       Well, yes these are never meant to be used widely, though it would be good to find some place for the documentation of Replacement Token Providers. It would interest power users as well.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on a change in pull request #3135: [NETBEANS-5941] Add generic execute.task action to Gradle projects

Posted by GitBox <gi...@apache.org>.
sdedic commented on a change in pull request #3135:
URL: https://github.com/apache/netbeans/pull/3135#discussion_r697812774



##########
File path: extide/gradle/src/org/netbeans/modules/gradle/actions/DefaultActionMapping.java
##########
@@ -146,6 +146,12 @@ public boolean equals(Object obj) {
         return Objects.equals(this.withPlugins, other.withPlugins);
     }
 
+    @Override
+    public String toString() {
+        return name + " [" + args + ']';
+    }
+
+    

Review comment:
       Great for debugging !

##########
File path: extide/gradle/src/org/netbeans/modules/gradle/nodes/TaskNode.java
##########
@@ -45,6 +46,8 @@
     @StaticResource
     private static final String TASK_ICON = "org/netbeans/modules/gradle/resources/gradle-task.gif";
 
+    public static final String EXECUTE_TASK_ACTION = "execute.task"; //NOI18N

Review comment:
       Possibly use `RunUtils.EXECUTE_TASK_ACTION` API constant ?

##########
File path: extide/gradle/src/org/netbeans/modules/gradle/api/execute/RunUtils.java
##########
@@ -90,6 +90,9 @@
     public static final String PROP_INCLUDE_OPEN_PROJECTS = "include.open.projects"; //NOI18N
     public static final String PROP_DEFAULT_CLI = "gradle.cli"; //NOI18N
 
+    /** Action to execute specific Gradle Tasks from the IDE (Eg. from Navigator). */
+    public static final String EXECUTE_TASK_ACTION = "execute.task"; //NOI18N

Review comment:
       API change -- `@since` and mention in `apichanges.xml`.

##########
File path: extide/gradle/src/org/netbeans/modules/gradle/ActionProviderImpl.java
##########
@@ -500,14 +503,12 @@ Action forProject(Project p, FileObject fo) {
     private final class CustomPopupActions extends AbstractAction implements Presenter.Popup {
 
         private final boolean onFile;
-        private final boolean onGradle;
         private final Lookup lookup;
 
         @SuppressWarnings("OverridableMethodCallInConstructor")
         private CustomPopupActions(boolean onFile, boolean onGradleFile, FileObject fo) {

Review comment:
       is `onGradleFile` parameter used ?

##########
File path: extide/gradle/src/org/netbeans/modules/gradle/actions/GradleTaskTokenProvider.java
##########
@@ -0,0 +1,80 @@
+/*
+ * 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.actions;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import org.netbeans.modules.gradle.api.GradleTask;
+import org.netbeans.modules.gradle.api.NbGradleProject;
+import org.netbeans.modules.gradle.spi.actions.ReplaceTokenProvider;
+import org.netbeans.spi.project.ProjectServiceProvider;
+import org.openide.util.Lookup;
+
+/**
+ *
+ * @author lkishalmi
+ */
+@ProjectServiceProvider(service = ReplaceTokenProvider.class, projectType = NbGradleProject.GRADLE_PROJECT_TYPE)
+public class GradleTaskTokenProvider implements ReplaceTokenProvider {
+
+    private static Set<String> SUPPORTED = Collections.unmodifiableSet(new HashSet(Arrays.asList(
+       "taskName",
+       "taskPath",
+       "taskNames",
+       "taskPaths"
+    )));

Review comment:
       Should be mentioned in `apichanges.xml`, possibly in some generated doc for Gradle actions ? Technically it becomes part of API ... or make a comment note the tokens are never meant to be used widely.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] lkishalmi commented on a change in pull request #3135: [NETBEANS-5941] Add generic execute.task action to Gradle projects

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on a change in pull request #3135:
URL: https://github.com/apache/netbeans/pull/3135#discussion_r699457354



##########
File path: extide/gradle/src/org/netbeans/modules/gradle/api/execute/RunUtils.java
##########
@@ -90,6 +90,9 @@
     public static final String PROP_INCLUDE_OPEN_PROJECTS = "include.open.projects"; //NOI18N
     public static final String PROP_DEFAULT_CLI = "gradle.cli"; //NOI18N
 
+    /** Action to execute specific Gradle Tasks from the IDE (Eg. from Navigator). */
+    public static final String EXECUTE_TASK_ACTION = "execute.task"; //NOI18N

Review comment:
       Yes, that's true, I'm aware of it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] lkishalmi commented on a change in pull request #3135: [NETBEANS-5941] Add generic execute.task action to Gradle projects

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on a change in pull request #3135:
URL: https://github.com/apache/netbeans/pull/3135#discussion_r699444508



##########
File path: extide/gradle/src/org/netbeans/modules/gradle/actions/GradleTaskTokenProvider.java
##########
@@ -0,0 +1,80 @@
+/*
+ * 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.actions;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import org.netbeans.modules.gradle.api.GradleTask;
+import org.netbeans.modules.gradle.api.NbGradleProject;
+import org.netbeans.modules.gradle.spi.actions.ReplaceTokenProvider;
+import org.netbeans.spi.project.ProjectServiceProvider;
+import org.openide.util.Lookup;
+
+/**
+ *
+ * @author lkishalmi
+ */
+@ProjectServiceProvider(service = ReplaceTokenProvider.class, projectType = NbGradleProject.GRADLE_PROJECT_TYPE)
+public class GradleTaskTokenProvider implements ReplaceTokenProvider {
+
+    private static Set<String> SUPPORTED = Collections.unmodifiableSet(new HashSet(Arrays.asList(
+       "taskName",
+       "taskPath",
+       "taskNames",
+       "taskPaths"
+    )));

Review comment:
       Well, yes these are never meant to be used widely, though it would be good to find some place for the documentation of Replacement Token Providers. It would interest power users as well.

##########
File path: extide/gradle/src/org/netbeans/modules/gradle/ActionProviderImpl.java
##########
@@ -500,14 +503,12 @@ Action forProject(Project p, FileObject fo) {
     private final class CustomPopupActions extends AbstractAction implements Presenter.Popup {
 
         private final boolean onFile;
-        private final boolean onGradle;
         private final Lookup lookup;
 
         @SuppressWarnings("OverridableMethodCallInConstructor")
         private CustomPopupActions(boolean onFile, boolean onGradleFile, FileObject fo) {

Review comment:
       Well it is not used, but calculated earlier. This one is a copy+paste left over from the maven plugin. Probably have to check why we calculate that on the first place, also check that in the "original" maven plugin code as well.

##########
File path: extide/gradle/src/org/netbeans/modules/gradle/nodes/TaskNode.java
##########
@@ -45,6 +46,8 @@
     @StaticResource
     private static final String TASK_ICON = "org/netbeans/modules/gradle/resources/gradle-task.gif";
 
+    public static final String EXECUTE_TASK_ACTION = "execute.task"; //NOI18N

Review comment:
       Good catch! I've put the constant in different places initially all around the source code. RunUtils might be not the final place.

##########
File path: extide/gradle/src/org/netbeans/modules/gradle/api/execute/RunUtils.java
##########
@@ -90,6 +90,9 @@
     public static final String PROP_INCLUDE_OPEN_PROJECTS = "include.open.projects"; //NOI18N
     public static final String PROP_DEFAULT_CLI = "gradle.cli"; //NOI18N
 
+    /** Action to execute specific Gradle Tasks from the IDE (Eg. from Navigator). */
+    public static final String EXECUTE_TASK_ACTION = "execute.task"; //NOI18N

Review comment:
       Yes, that's true, I'm aware of it.

##########
File path: extide/gradle/src/org/netbeans/modules/gradle/actions/DefaultActionMapping.java
##########
@@ -146,6 +146,12 @@ public boolean equals(Object obj) {
         return Objects.equals(this.withPlugins, other.withPlugins);
     }
 
+    @Override
+    public String toString() {
+        return name + " [" + args + ']';
+    }
+
+    

Review comment:
       Yes. It seems I was debugging the code...




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] lkishalmi commented on pull request #3135: [NETBEANS-5941] Add generic execute.task action to Gradle projects

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on pull request #3135:
URL: https://github.com/apache/netbeans/pull/3135#issuecomment-909367806


   Ad of ```RunTaskActionMapping()``` you are right, I changed the code first to get the mapping for ```execute.task```, then it included the replacement token, then I changed the code doing this unnecessary custom action mapping class. Thanks for the review! Really useful! I'm trying to get back to the game after a long pause...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on a change in pull request #3135: [NETBEANS-5941] Add generic execute.task action to Gradle projects

Posted by GitBox <gi...@apache.org>.
sdedic commented on a change in pull request #3135:
URL: https://github.com/apache/netbeans/pull/3135#discussion_r697812774



##########
File path: extide/gradle/src/org/netbeans/modules/gradle/actions/DefaultActionMapping.java
##########
@@ -146,6 +146,12 @@ public boolean equals(Object obj) {
         return Objects.equals(this.withPlugins, other.withPlugins);
     }
 
+    @Override
+    public String toString() {
+        return name + " [" + args + ']';
+    }
+
+    

Review comment:
       Great for debugging !

##########
File path: extide/gradle/src/org/netbeans/modules/gradle/nodes/TaskNode.java
##########
@@ -45,6 +46,8 @@
     @StaticResource
     private static final String TASK_ICON = "org/netbeans/modules/gradle/resources/gradle-task.gif";
 
+    public static final String EXECUTE_TASK_ACTION = "execute.task"; //NOI18N

Review comment:
       Possibly use `RunUtils.EXECUTE_TASK_ACTION` API constant ?

##########
File path: extide/gradle/src/org/netbeans/modules/gradle/api/execute/RunUtils.java
##########
@@ -90,6 +90,9 @@
     public static final String PROP_INCLUDE_OPEN_PROJECTS = "include.open.projects"; //NOI18N
     public static final String PROP_DEFAULT_CLI = "gradle.cli"; //NOI18N
 
+    /** Action to execute specific Gradle Tasks from the IDE (Eg. from Navigator). */
+    public static final String EXECUTE_TASK_ACTION = "execute.task"; //NOI18N

Review comment:
       API change -- `@since` and mention in `apichanges.xml`.

##########
File path: extide/gradle/src/org/netbeans/modules/gradle/ActionProviderImpl.java
##########
@@ -500,14 +503,12 @@ Action forProject(Project p, FileObject fo) {
     private final class CustomPopupActions extends AbstractAction implements Presenter.Popup {
 
         private final boolean onFile;
-        private final boolean onGradle;
         private final Lookup lookup;
 
         @SuppressWarnings("OverridableMethodCallInConstructor")
         private CustomPopupActions(boolean onFile, boolean onGradleFile, FileObject fo) {

Review comment:
       is `onGradleFile` parameter used ?

##########
File path: extide/gradle/src/org/netbeans/modules/gradle/actions/GradleTaskTokenProvider.java
##########
@@ -0,0 +1,80 @@
+/*
+ * 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.actions;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import org.netbeans.modules.gradle.api.GradleTask;
+import org.netbeans.modules.gradle.api.NbGradleProject;
+import org.netbeans.modules.gradle.spi.actions.ReplaceTokenProvider;
+import org.netbeans.spi.project.ProjectServiceProvider;
+import org.openide.util.Lookup;
+
+/**
+ *
+ * @author lkishalmi
+ */
+@ProjectServiceProvider(service = ReplaceTokenProvider.class, projectType = NbGradleProject.GRADLE_PROJECT_TYPE)
+public class GradleTaskTokenProvider implements ReplaceTokenProvider {
+
+    private static Set<String> SUPPORTED = Collections.unmodifiableSet(new HashSet(Arrays.asList(
+       "taskName",
+       "taskPath",
+       "taskNames",
+       "taskPaths"
+    )));

Review comment:
       Should be mentioned in `apichanges.xml`, possibly in some generated doc for Gradle actions ? Technically it becomes part of API ... or make a comment note the tokens are never meant to be used widely.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] ebarboni closed pull request #3135: [NETBEANS-5941] Add generic execute.task action to Gradle projects

Posted by GitBox <gi...@apache.org>.
ebarboni closed pull request #3135:
URL: https://github.com/apache/netbeans/pull/3135


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists