From 577b0697e103ec12e1b68aba02adfcc3949e13d0 Mon Sep 17 00:00:00 2001 From: Ole Osterhagen Date: Sat, 23 Dec 2023 14:00:18 +0100 Subject: [PATCH] Show menu entry "Refresh Gradle Project" for Kotlin DSL scripts As for Groovy DSL scripts show the "Refresh Gradle Project" action when a .gradle.kts file is selected in the Package/Project Explorer or opened in an editor. The common property tests have been refactored out into a separate expression definition. --- .../configuration/GradleResourceTester.java | 3 +- org.eclipse.buildship.ui/plugin.xml | 66 +++++++++++-------- 2 files changed, 40 insertions(+), 29 deletions(-) diff --git a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/configuration/GradleResourceTester.java b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/configuration/GradleResourceTester.java index cae1d2291..1e2e3bcb8 100644 --- a/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/configuration/GradleResourceTester.java +++ b/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/configuration/GradleResourceTester.java @@ -19,6 +19,7 @@ * * @author Stefan Oehme @@ -32,7 +33,7 @@ public boolean test(Object receiver, String property, Object[] args, Object expe IResource resource = (IResource) receiver; IProject project = resource.getProject(); if (GradleProjectNature.isPresentOn(project)) { - return resource instanceof IProject || "gradle".equals(resource.getFileExtension()) || "gradle.properties".equals(resource.getName()); + return resource instanceof IProject || "gradle".equals(resource.getFileExtension()) || resource.getName().endsWith(".gradle.kts") || "gradle.properties".equals(resource.getName()); } } return false; diff --git a/org.eclipse.buildship.ui/plugin.xml b/org.eclipse.buildship.ui/plugin.xml index 277c85051..4719cd31e 100644 --- a/org.eclipse.buildship.ui/plugin.xml +++ b/org.eclipse.buildship.ui/plugin.xml @@ -201,21 +201,16 @@ - - - - - - - - + + + + + + @@ -455,22 +450,17 @@ - - - - - - - - + + + + + + @@ -665,4 +655,24 @@ + + + + + + + + + + + +