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

Spring boot gradle plugin default encoding #1032

Conversation

rwinch
Copy link
Member

@rwinch rwinch commented Jun 4, 2014

This commit converts SpringBootPlugin into a Groovy based plugin (to ease the UTF-8 default encoding) and adds default UTF-8 encoding. The reasoning for this is based upon spring-guides/gs-spring-boot#7

Rob Winch added 2 commits June 4, 2014 10:25
We also convert the SpringBootPlugin to be .groovy to ease defaulting
the encoding to UTF-8. We do not make the file any "more groovy" to leave
this to a distinct commit.
- Remove ;
- Remove unnecessary public modifiers
- Remove unnecessary .class suffixes
@wilkinsona
Copy link
Member

I'm not convinced of the need to convert SpringBootPlugin to Groovy just to make this change. This, I believe, is the same change but in Java:

project.getTasks().withType(Compile.class).all(new Action<Compile>() {
    @Override
    public void execute(Compile compileTask) {
        if (!StringUtils.hasText(compileTask.getOptions().getEncoding())) {
            compileTask.getOptions().setEncoding("UTF-8");
        }
    }
});

@rwinch
Copy link
Member Author

rwinch commented Jun 4, 2014

@wilkinsona That is true, but why aren't we using Groovy is the better question? It makes the PR much cleaner, it is much more concise, simple, etc.... Are you not in favor of using Groovy or just that it should be distinct PR / Commit?

@wilkinsona
Copy link
Member

I'm not sure of the reasons behind not using Groovy for the plugin. I think it was @philwebb who took the original decision. If we're going to move the plugin to Groovy, I think it'd be better done as a separate piece of work. I'd also expect us to convert most if not all of the code to Groovy as part of that change.

@dsyer
Copy link
Member

dsyer commented Jun 5, 2014

Agree that it's a separate topic. The reason we don't use groovy is probably because of the pain involved in building groovy projects with Maven (which is not a justification for migrating to gradle, by the way). But it looks like we already have groovy code in there, so I see no reason not to merge this.

@rwinch rwinch closed this in adb2205 Jun 5, 2014
@philwebb
Copy link
Member

philwebb commented Jun 5, 2014

There was no real logic behind not using Groovy other than the rest of the project was pure Java. Many many parts of the Gradle plugin could probably be improved if we switched.

mdeinum pushed a commit to mdeinum/spring-boot that referenced this pull request Jun 6, 2014
- Remove ;
- Remove unnecessary public modifiers
- Remove unnecessary .class suffixes

Fixes spring-projectsgh-1032
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants