Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show menu entry "Refresh Gradle Project" for Kotlin DSL scripts #1287

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* <ul>
* <li>a Gradle project</li>
* <li>a .gradle file</li>
* <li>a .gradle.kts file</li>
* <li>a gradle.properties file</li>
* </ul>
* @author Stefan Oehme
Expand All @@ -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;
Expand Down
66 changes: 38 additions & 28 deletions org.eclipse.buildship.ui/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -201,21 +201,16 @@
<iterate
operator="or"
ifEmpty="false">
<adapt
type="org.eclipse.core.resources.IResource">
<and>
<test
forcePluginActivation="true"
property="org.eclipse.core.resources.projectNature"
value="org.eclipse.buildship.core.gradleprojectnature">
</test>
<test
forcePluginActivation="true"
property="org.eclipse.buildship.core.isGradleResource">
</test>
</and>
</adapt>
<reference
definitionId="org.eclipse.buildship.ui.GradleResourceInGradleProject">
</reference>
</iterate>
<with
variable="activeEditorInput">
<reference
definitionId="org.eclipse.buildship.ui.GradleResourceInGradleProject">
</reference>
</with>
</or>
</activeWhen>
</handler>
Expand Down Expand Up @@ -455,22 +450,17 @@
<iterate
operator="or"
ifEmpty="false">
<adapt
type="org.eclipse.core.resources.IResource">
<and>
<test
forcePluginActivation="true"
property="org.eclipse.core.resources.projectNature"
value="org.eclipse.buildship.core.gradleprojectnature">
</test>
<test
forcePluginActivation="true"
property="org.eclipse.buildship.core.isGradleResource">
</test>
</and>
</adapt>
<reference
definitionId="org.eclipse.buildship.ui.GradleResourceInGradleProject">
</reference>
</iterate>
</with>
<with
variable="activeEditorInput">
<reference
definitionId="org.eclipse.buildship.ui.GradleResourceInGradleProject">
</reference>
</with>
</or>
</visibleWhen>
</menu>
Expand Down Expand Up @@ -665,4 +655,24 @@
</part>
</actionSetPartAssociation>
</extension>
<extension
point="org.eclipse.core.expressions.definitions">
<definition
id="org.eclipse.buildship.ui.GradleResourceInGradleProject">
<adapt
type="org.eclipse.core.resources.IResource">
<and>
<test
forcePluginActivation="true"
property="org.eclipse.core.resources.projectNature"
value="org.eclipse.buildship.core.gradleprojectnature">
</test>
<test
forcePluginActivation="true"
property="org.eclipse.buildship.core.isGradleResource">
</test>
</and>
</adapt>
</definition>
</extension>
</plugin>