Grails Auto-format Line wrap - grails

I was trying to using Crtl+shift+F to format a groovy class in springsource suite tool. However, it doesn't split lines that are very long (more than 80 characters) as it does with java files.
I would appreciate if anybody could recommend me a tool for perform wrapping of lines in groovy files and generally grails projects.
Thanks in advance.

IntelliJ does a very nice job of formatting Groovy code. The free version of IntelliJ includes Groovy support, but not Grails support (last time I checked)

What version of STS are you using? We have recently fixed a few issues regarding formatting of Groovy code in the latest release of Groovy-Eclipse (2.1.1). The update site is here:
http://dist.springsource.org/release/GRECLIPSE/e3.6/
This should solve your problem, but if it doesn't, then I'd suggest raising a bug on the issue tracker:
http://jira.codehaus.org/browse/GRECLIPSE

Related

Intellij does not show autocompletion for groovy methods

So, i have intllij 2016.1.3 (professional)
I imported an existing grails 2.5 project, created a grails 2.5 library by pointing to grails installation. Every thing seem to work, other then the suggestions for groovy methods (eg default groovy methods collect, find, sort, eachWithIndex etc). Intellij does not show suggestions for this groovy methods, and does not even recognize it, even if i manually write the method name. Surprizingly it shows suggestions for collectParallel, eachParallel.
Tried setting up a groovy library, used groovy-eclipse compiler, but not luck.
What could be going wrong?
The solution was to remove dslActivationStatus.xml from ~/Library/Preferences/<IntellijVersion>/options/ (OSX El capitan)
This was suggested by intellij support team after investigating it for few days.

How to Configure SonarQube for delphi?

I want to configure SonarQube so it can analyze Delphi project too, and when I search online I saw there used to be a delphi plugin for SonarQube. But when I look at the plugins with the latest build it doesn't show the delphi plugin.
Is the plugin still available in an other way?
Or is it possible to configure SonarQube for delphi without the plugin?
As of G. Ann response was actually discontinued puglin for Sonar, but searching the internet, and recently (3 days) the developer Fabricio Columbus made it happen!
We tested and is running the current version of Sonar:
Compatible with SonarQube 4.5.x and SonarQube 5.1.2
https://github.com/fabriciocolombo/sonar-delphi
Release: https://github.com/fabriciocolombo/sonar-delphi/releases
JAR: https://github.com/fabriciocolombo/sonar-delphi/releases/download/0.3.3-SNAPSHOT/sonar-delphi-plugin-0.3.3-SNAPSHOT.jar
PS: Translated from Portuguese to English by Google Translate.
To analyze the files of language X, you need a plugin for language X that recognize's X's structure, syntax &etc. Without that you can't derive metrics (LOC, complexity, &etc.) or recognize bad code (i.e. raise issues for antipatterns.) So to answer your second question first, you won't be able to analyze Delphi code without some kind of Delphi plugin.
The Delphi plugin was deprecated quite a while ago because it seemed to suffer from a lack of interest all around & didn't evolve to maintain compatibility with the platform as it evolved.
If you look, you can find downloads of the old plugin, but to use it, you'd have to retrogress to a quite old version of the platform, & I don't recommend that. I'm not sure how far back you'd have to go - you could crack open the jar and get that from the pom - but it looks like the last mailing list activity on this plugin was Feb. 2012. So again, I don't recommend going this route.

Grails Project Not Auto Reloading

I have a larger Grails project for which I have taken over development. I have used Grails before and one of the features that I found really nice-to-have is the auto-compilation/reloading when developing.
I haven't had to do anything special to make this work in the past, however for some reason it is not triggered for this project.
I do a simple "grails run-app" and modify a file when server is started - nothing! Any suggestions?
Windows 7, Grails 2.0.1, Java 1.6u35
IDE: Groovy Grails Tool Suite 3.1.0.M1 - Based on Eclipse Juno 4.2
Grails command line doesn't seem to properly handle spaces in directory names of GRAILS_HOME or HOME directory.
see:
http://jira.grails.org/browse/GRAILS-7936
it has links to various other related issues.
This comment has a workaround: http://jira.grails.org/browse/GRAILS-7936?focusedCommentId=72170&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-72170 .
Are you using eventCompileStart in scripts/_Events.groovy? That was my problem, see GRAILS-8776 (please comment and vote on that issue if this is your problem so we can get it resolved!).
Commenting out that block cause auto-reloading to start working again for me.
My solution:
Right click on project -> Properties -> Project Facets -> check Java and set it's correct version -> OK
Bingo!

Grails Rendering Plugin error when trying to render PDF?

When using the Grails Rendering plugin i am getting an error java.lang.NoSuchMethodError: com.lowagie.text.pdf.BaseFont.getCharBBox[C] . We are also using the Jasper Plugin which uses a new version of the iText library. I guess there is a mismatch between the 2 plugins..
Any idea how to fix this?
/Marco
Your probably right there with the assumption there are two versions of iText. I have had lots of fun with iText conflicts in the past. I don't use the Jasper Plugin so I can't give you the direct answer, but I can recommend a couple of things to try:
Use the command grails dependency report to see what exactly is going on, which version of iText is kept, and which is being kicked out.
In your build config you can manage the dependencies of a particular plugin. So might be able to get away with removing the Jasper Plugin dependency on itext. Here is an example from mine for the export plugin:
runtime(':export:1.1') {
excludes 'itext', 'itext-rtf'
}

Command to change package name in Grails

I have created my application under package music. Now I want to change my package to com.mp3.songs.music.
One way is I can manually create the package for grails-app. Is there anything else that I need to take care while changing the package name.
Alternatively, is there a command in grails which can be used to change the package.
I found a way out in the below link. But this works only when you create new files. What if you want to change the package of the older files.
http://www.goto20.nl/tech/groovy/configuring-the-default-package-name-for-a-grails-project/
Thanks!
IntelliJ IDEA has very good support for rename refactoring. I believe it is currently the best (9.0.3 stable) chance you'll have of any major refactoring jobs in Grails. They have a 30 day trial, so it is worth a try.
Why not use Spring Source Tool Suite. Its a great IDE with solid support for Groovy n Grails.

Resources