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

Allow specifying CompilationCustomizer for Groovy based beans [SPR-14585] #19154

Closed
spring-projects-issues opened this issue Aug 13, 2016 · 4 comments
Assignees
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Aug 13, 2016

Alexander Zobkov opened SPR-14585 and commented

Groovy (since 1.8) supports customizing compilation process. For example:

Adding support for this feature allows to increase expressiveness of source files for groovy beans by hiding "noise" of explicit imports and AST annotations. With usage of DSL and groovy syntax sugar, source files for groovy beans can look like plain text in english that can be used and understandable for non programmers.

I tried to enable Import customizer with existing Spring API but failed to to do so, see attachment for code snippet.


Affects: 4.3 GA

Attachments:

Issue Links:

  • #9888 ScriptFactory for JSR-223
  • #15635 ScriptExecutor for JSR-223

Referenced from: commits da56758, 53819c4, fbeff47, 433764d, 6a0d9d3

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 16, 2016

Juergen Hoeller commented

Since our existing customizer-ref mechanism in the spring-lang namespace allows for arbitrary customizer types already, I've simply added a corresponding GroovyScriptFactory(scriptSourceLocator, compilationCustomizer) constructor which means that both GroovyObjectCustomizer and any CompilationCustomizer type are accepted there now.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 17, 2016

Juergen Hoeller commented

I've revised GroovyScriptFactory to allow for multiple CompilationCustomizers as well as for a full CompilerConfiguration object and added analogous configuration options to GroovyScriptEvaluator.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 17, 2016

Alexander Zobkov commented

Thanks for implementing this improvement request!

I think one thing left. The note you originally added in src/asciidoc/integration.adoc needs to be updated according to the "Consistent support for CompilationCustomizers as well as custom CompilerConfiguration" commit.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 17, 2016

Juergen Hoeller commented

Good point, I've updated it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants