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

Handle Java keywords in folder names gracefully #33

Open
garyhodgson opened this issue Apr 3, 2013 · 3 comments
Open

Handle Java keywords in folder names gracefully #33

garyhodgson opened this issue Apr 3, 2013 · 3 comments

Comments

@garyhodgson
Copy link

Hi,

Whilst assembling my app I encountered a strange exception (stacktrace below) whilst running the gaelykPrecompileTemplate task. It appears to stem from a template folder being named "static". It can be recreated easily in the gaelyk template project by moving the index.gtpl into a sub-folder called static and running "gradlew assemble".

Also, and possibly related, it appears that packages starting with numbers throw the same exception, i.e. changing the template folder to 123 throws the same exception as above.

Cheers,
Gary

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':gaelykPrecompileTemplate'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:68)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
        ... snip ...
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:47)
Caused by: : Compilation Failed
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        ... snip ...
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:60)
        ... 57 more
Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
C:\Tools\Cygwin\tmp\gtpl-staging--786316078\WEB-INF\pages\static\$gtpl$index.groovy: 1: expecting an identifier, found 'static' @ line 1, column 23.
   package web_inf.pages.static;out.print(""""""); include '/WEB-INF/includes/header.gtpl' ;
                         ^
1 error

        ... 74 more
@musketyr
Copy link
Contributor

musketyr commented Apr 3, 2013

Hi,

The reason is obvious. Gaelyk compiles template to the packages according
to their folders and static isn't allowed name for java packages.

I'll try to figure out if I can do any solution which can handle java
keywords in folder names gracefully.

Cheers,
Vladimír
Dne 3.4.2013 23:26 "Gary Hodgson" [email protected] napsal(a):

Hi,

Whilst assembling my app I encountered a strange exception (stacktrace
below) whilst running the gaelykPrecompileTemplate task. It appears to stem
from a template folder being named "static". It can be recreated easily in
the gaelyk template project by moving the index.gtpl into a sub-folder
called static and running "gradlew assemble".

Also, and possibly related, it appears that packages starting with numbers
throw the same exception, i.e. changing the template folder to 123 throws
the same exception as above.

Cheers,
Gary

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':gaelykPrecompileTemplate'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:68)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    ... snip ...
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:47)
    Caused by: : Compilation Failed
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    ... snip ...
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:60)
    ... 57 more
    Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
    C:\Tools\Cygwin\tmp\gtpl-staging--786316078\WEB-INF\pages\static$gtpl$index.groovy: 1: expecting an identifier, found 'static' @ line 1, column 23.
    package web_inf.pages.static;out.print(""""""); include '/WEB-INF/includes/header.gtpl' ;
    ^
    1 error

    ... 74 more
    


Reply to this email directly or view it on GitHubhttps://github.com//issues/33
.

@garyhodgson
Copy link
Author

I hadn't realised that keywords, nor numbers, were not allowed as package names in Java.

@musketyr
Copy link
Contributor

musketyr commented Apr 3, 2013

No problem. I've updated the issue name that it will more correspond the desired state.

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

No branches or pull requests

2 participants