-
Notifications
You must be signed in to change notification settings - Fork 194
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
When I install this plugin, gradle scripts show up with an Error icon. #277
Comments
If you add the Groovy nature to your project, this will cease.
|
I'll confirm that adding And it seems wrong to have to do it. My project might have no connection to groovy other than its build script being written in gradle. It might be something like a project that packages a bunch of shell scripts into an RPM for example. If anything should add this nature it should be the Gradle project importer or else the Gradle project nature should somehow imply the groovy nature. |
That icon indicates that the file will not be compiled when/if you run Build Project.
|
What would it take to just leave the original gradle elephant icon in place, as it would be if the Groovy plugin were not installed? |
If you follow the directions in issue #275, I think you can restore the association between the Gradle editor and *.gradle files.
|
Another odd thing is that the elephant shows up in other views such as the Git Repositories view. |
So you would like the Groovy Editor to be used for .gradle files, but the icon determined by the non-default Gradle Editor? It seems that if you want the Groovy Editor that its icon should be used.
|
I guess you've made the assumption that icon maps to editor choice. Is that correct? I'm not sure it is, given that many file types have several "Open With" choices. To me, the elephant icon is highly desirable because it makes the build scripts for a project stand out from other files, regardless of what editor may be chosen to edit them. In any case, as it stands now,, once the groovy plugin is installed, I lose the elephant icon, no matter what editor I choose. So I would be satisfied if
|
In Eclipse, the icon used for a resource is the summation of all the contributors that are asked if they wish to provide an icon for a resource. It is not trivial to control this behavior from the UI. Groovy-Eclipse was written to find *.gradle files interesting and so to provide an icon (and editor).
I could try setting the priority to `normal` instead of `high`. Or separate out Gradle as its own content type with a low priority so that if you have Buildship installed, it takes precedence.
```xml
<extension point="org.eclipse.core.contenttype.contentTypes">
<content-type
base-type="org.eclipse.jdt.core.javaSource"
file-extensions="groovy,gradle,gpp,grunit"
id="org.eclipse.jdt.groovy.core.groovySource"
name="Groovy Source File (for Groovy projects)"
priority="high"/>
</extension>
```
|
Yes. While I was tempted to say, I want everything exactly the way I want it, I realized that you as developer could be whipsawed by competing demands. So I tried to keep mine reasonable. I would say the groovy plugin should find *.gradle files interesting enough to provide the groovy editor as a non-default choice. Gradle editor would be default choice (if Buildship is installed), and the icon would show up as the elephant (either always, if that is possible, or at the very least when groovy has not been defined as the default editor). Often build scripts are simple enough that syntax highlighting etc. are not required. But they occasionally get more complex, when the syntax highlighting becomes a real help. Those cases could be handled with alternate Open With groovy editor. If you don't mind, I'll stay out of the question of how you implement this. But thanks for your efforts. |
I split Gradle files out as a separate content type with a low priority. This should be enough for Buildship to take precedence. The build will take about 30ish minutes. Then you can run update and try it out.
|
Thanks. Please tell me how/where I can get this new version? |
Once build completes (you can monitor it at https://build.springsource.org/browse/GRECLIPSE), you run Help > Check for Updates.
|
OK, your fix didn't help, sorry. I have the new plugin installed: org.codehaus.groovy25.feature (2.9.2.xx-201704041513-e46) "Groovy-Eclipse" and I still get the exclamation point icon even though gradle editor is the default editor for these files. |
Can you send a screenshot of your Preferences > General > Content Types > Java Source File > Groovy Source File > *
|
and here are the file associations |
So it looks like the Gradle plug-in has taken precedence. Is this not what you are seeing?
|
This is what I see: The editor panes show the icon of whatever editor is active. In this view I have settings gradle open twice, one with the default gradle editor and once with groovy editor It would be nice if the groovy editor didn't show the error icon, but at least the gradle editor shows it correctly. In the project explorer, it shows the error icon for all gradle scripts, even though groovy is the default editor.. |
Eh, why is this closed? Your fix didn't solve the issue. |
I did not close. I was wondering why you closed it yesterday.
|
Don't know how it got closed. I didn't do it, or at least not knowingly. :-) |
Can you send me the update site link for the Gradle plug-ins? |
Could you let Buildship project know that they have an unresolved dependency in their manifest for org.eclipse.buildship.core? I'll try to find a way around this, but it is slowing me down.
![buildship-dependency](https://cloud.githubusercontent.com/assets/18193802/24717376/dfb60c04-19f7-11e7-9014-c5e046760e67.png)
|
I will but your image is not readable by me and may not be readable by the Gradle folks. |
Can you retest with the latest snapshot? |
With the latest snapshot, the following error occurs several times in our logs on startup. We don't have the buildship plugin installed.
|
Well, I DO, of course, have the buildship plugin installed and this release fixes my original issue. Everything looks good. .gradle build scripts open by default with the gradle script editor or optionally (Open with) the groovy editor. No matter which editor they are opened with, the Elephant icon is shown. This is all good. But I suppose I will have to do one more test when aax's issue is addressed. |
Something had to give somewhere. I checked for the existence of the buildship icon and if it is found it is used. If not found, there will be a couple entries in the log. I may find a way to clean that up in the future, but I have already put way more time into this than I planned on. |
Thanks! I appreciate the effort! |
My need for this plugin is primarily to write Gradle plugins in groovy.
There is an issue, mostly cosmetic, that I can't solve. When this plugin is NOT installed, but the Buildship plugin IS installed, then the display of gradle buildscripts in the Project Explorer is correct (the gradle scripts have elephant icons).
But after installing this plugin then the display of gradle buildscripts in Project Explorer is incorrect (Big fat ugly exclamation mark for the gradle scripts in project explorer, but no error messages in the Markers tab or Problems tab).
This seems to be purely cosmetic but it's annoying. The gradle building within Eclipse is not affected. But, since I need to edit code for a gradle plugin, I want the groovy editor support, but it seems to mess up at least the cosmetics of the Eclipse Project Explorer.
The text was updated successfully, but these errors were encountered: