-
Notifications
You must be signed in to change notification settings - Fork 270
Added GraalVM native support to Apache FreeMarker #121
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
base: 2.3-gae
Are you sure you want to change the base?
Changes from all commits
ac93570
4634f93
e742a30
91a80a7
d0012c0
4ad7311
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| Args = --initialize-at-run-time=freemarker.ext.jython.JythonWrapper,\ | ||
| --initialize-at-run-time=freemarker.ext.jython.JythonModel |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| [ { | ||
| "condition" : { | ||
| "typeReachable" : "freemarker.template.Configuration" | ||
| }, | ||
| "name" : "freemarker.log._SLF4JLoggerFactory", | ||
| "methods" : [ { | ||
| "name" : "<init>", | ||
| "parameterTypes" : [ ] | ||
| } ] | ||
| }, { | ||
| "condition" : { | ||
| "typeReachable" : "freemarker.template.Configuration" | ||
| }, | ||
| "name" : "freemarker.log.SLF4JLoggerFactory", | ||
| "methods" : [ { | ||
| "name" : "<init>", | ||
| "parameterTypes" : [ ] | ||
| } ] | ||
| }, { | ||
| "condition" : { | ||
| "typeReachable" : "freemarker.template.Configuration" | ||
| }, | ||
| "name" : "freemarker.log._AvalonLoggerFactory.java", | ||
| "methods" : [ { | ||
| "name" : "<init>", | ||
| "parameterTypes" : [ ] | ||
| } ] | ||
| }, { | ||
| "condition" : { | ||
| "typeReachable" : "freemarker.template.Configuration" | ||
| }, | ||
| "name" : "freemarker.log._CommonsLoggingLoggerFactory.java", | ||
| "methods" : [ { | ||
| "name" : "<init>", | ||
| "parameterTypes" : [ ] | ||
| } ] | ||
| }, { | ||
| "condition" : { | ||
| "typeReachable" : "freemarker.template.Configuration" | ||
| }, | ||
| "name" : "freemarker.log._JULLoggerFactory.java", | ||
| "methods" : [ { | ||
| "name" : "<init>", | ||
| "parameterTypes" : [ ] | ||
| } ] | ||
| }, { | ||
| "condition" : { | ||
| "typeReachable" : "freemarker.template.Configuration" | ||
| }, | ||
| "name" : "freemarker.log._Log4jLoggerFactory.java", | ||
| "methods" : [ { | ||
| "name" : "<init>", | ||
| "parameterTypes" : [ ] | ||
| } ] | ||
| }, { | ||
| "condition" : { | ||
| "typeReachable" : "freemarker.template.Configuration" | ||
| }, | ||
| "name" : "freemarker.log._Log4jOverSLF4JTester.java", | ||
| "methods" : [ { | ||
| "name" : "<init>", | ||
| "parameterTypes" : [ ] | ||
| } ] | ||
| }, { | ||
| "condition" : { | ||
| "typeReachable" : "freemarker.template.Configuration" | ||
| }, | ||
| "name" : "freemarker.log._NullLoggerFactory.java", | ||
| "methods" : [ { | ||
| "name" : "<init>", | ||
| "parameterTypes" : [ ] | ||
| } ] | ||
| }, { | ||
| "condition" : { | ||
| "typeReachable" : "freemarker.template.Configuration" | ||
| }, | ||
| "name" : "freemarker.log.CommonsLoggingLoggerFactory.java", | ||
| "methods" : [ { | ||
| "name" : "<init>", | ||
| "parameterTypes" : [ ] | ||
| } ] | ||
| } ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| { | ||
| "bundles": [], | ||
| "resources": { | ||
| "includes": [ | ||
| { | ||
| "pattern": "\\Qfreemarker/ext/beans/DefaultMemberAccessPolicy-rules\\E", | ||
| "condition": { | ||
| "typeReachable": "freemarker.ext.beans.DefaultMemberAccessPolicy" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we also need to add
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe 'freemarker/ext/beans/unsafeMethods.properties' when freemarker.ext.beans.LegacyDefaultMemberAccessPolicy is reachable? (just commited it this way) do you think is it better to squash commits? |
||
| } | ||
| }, | ||
| { | ||
| "pattern": "\\Qfreemarker/ext/beans/unsafeMethods.properties\\E", | ||
| "condition": { | ||
| "typeReachable": "freemarker.ext.beans.LegacyDefaultMemberAccessPolicy" | ||
| } | ||
| }, | ||
| { | ||
| "pattern": "\\Qfreemarker/version.properties\\E", | ||
| "condition": { | ||
| "typeReachable": "freemarker.template.utility.ClassUtil" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that still prefers Log4J API instead of SLF4J API when we have
log4j-over-slf4j, under GrallVM Native only, and it should prefer SLF4J in that case. I know, thisLoggerclass is a mess. Anyway, I looked into more, and the easiest way to achieve what I said is just changingisAutoDetectedso that ifIS_GRAALVM_NATIVEistrue, then we returntrueforLIBRARY_SLF4J. Actually, even better long term, let's returntrueforLIBRARY_COMMONStoo, and that way for GraalVM Native we just brought ahead what's planned for 2.4 anyway.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having a deeper look at it.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ddekany let's see if this is ok for you.
I preferred to create separate methods so maybe it's easier to understand than complex conditional statements, do you agree?
At beginning didn't fully grasped the meaning of all logger detection logic. I hope that now it is ok.