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

gaelykPrecompile error with 2 includes with params #39

Open
sergerehem opened this issue Oct 26, 2014 · 1 comment
Open

gaelykPrecompile error with 2 includes with params #39

sergerehem opened this issue Oct 26, 2014 · 1 comment

Comments

@sergerehem
Copy link

Exception when you have 2 includes, one of them with params, like this:

<% include "/WEB-INF/includes/header.gtpl?title=My Page Title" %>
<......>
<% include "/WEB-INF/includes/footer.gtpl %>


serge@serge-vaio:~/git/site$ ./gradlew gaelykPrecompileTemplates --stacktrace
Changed groovy version because running on Linux
:compileJava UP-TO-DATE
:compileGroovy UP-TO-DATE
:gaelykConvertTemplates FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':gaelykConvertTemplates'.

    java.lang.reflect.UndeclaredThrowableException (no error message)

  • Try:
    Run with --info or --debug option to get more log output.

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':gaelykConvertTemplates'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:289)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$1.run(DefaultTaskPlanExecutor.java:33)
    at org.gradle.internal.Factories$1.create(Factories.java:22)
    at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:198)
    at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:266)
    at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:135)
    at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:95)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:31)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
    at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
    at org.gradle.launcher.Main.doAction(Main.java:46)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at org.gradle.launcher.Main.main(Main.java:37)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
    at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:58)
    Caused by: java.lang.reflect.UndeclaredThrowableException
    at com.sun.proxy.$Proxy41.visitFile(Unknown Source)
    at org.gradle.api.internal.file.collections.DirectoryFileTree.walkDir(DirectoryFileTree.java:154)
    at org.gradle.api.internal.file.collections.DirectoryFileTree.walkDir(DirectoryFileTree.java:169)
    at org.gradle.api.internal.file.collections.DirectoryFileTree.walkDir(DirectoryFileTree.java:169)
    at org.gradle.api.internal.file.collections.DirectoryFileTree.visitFrom(DirectoryFileTree.java:122)
    at org.gradle.api.internal.file.collections.DirectoryFileTree.visit(DirectoryFileTree.java:112)
    at org.gradle.api.internal.file.collections.FileTreeAdapter.visit(FileTreeAdapter.java:96)
    at org.gradle.api.internal.file.AbstractFileTree.visit(AbstractFileTree.java:113)
    at org.gradle.api.internal.file.CompositeFileTree.visit(CompositeFileTree.java:47)
    at org.gradle.api.file.FileTree$visit.call(Unknown Source)
    at org.gradle.api.plugins.gaelyk.tasks.ConvertTemplatesToScriptsTask.compile(ConvertTemplatesToScriptsTask.groovy:23)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:219)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:212)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:201)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:533)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:516)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    ... 52 more
    Caused by: java.io.FileNotFoundException: /home/serge/git/site/src/main/webapp/WEB-INF/includes/header.gtpl?title=My Page Title" ;
    out.print("""

    <div class=\"jumbotron center\">
        <a href=\"http:/gaelyk.appspot.com\"><img alt=\"Gaelyk Logo\" src=\"/images/gaelyk.png\"/></a>
        <br/>
        <p>
            Congratulations, you've just created your first
            <a href=\"http:/gaelyk.appspot.com\">Gaelyk</a> application.
        </p>
    
        <p>
            <a href=\"/datetime\" class=\"btn btn-primary btn-large\">Show current time &raquo;</a>
        </p>
    </div>
    <div class=\"row\">
        <div class=\"col-md-4\">
            <h2>Start Experimenting</h2>
            <p>This template contains following sample files<ul><li><code>datetime.groovy</code></li><li><code>WEB-INF/pages/datetime.gtpl</code></li></ul>Try to edit them and watch the changes.</p>
        </div>
        <div class=\"col-md-4\">
            <h2>Learn More</h2>
            <p>All <a href=\"http:/gaelyk.appspot.com\">Gaelyk</a> features are well documented. If you are new to <a href=\"http:/gaelyk.appspot.com\">Gaelyk</a> best place to learn more is the <a href=\"http:/gaelyk.appspot.com/tutorial\">Tutorial</a>.</p>
            <p><a class=\"btn\" href=\"http:/gaelyk.appspot.com/tutorial\">Read Tutorial &raquo;</a></p>
        </div>
        <div class=\"col-md-4\">
            <h2>Work Less</h2>
            <p>Take advantage of existing plugins. You can for example unleash the power of <a href=\"http:/developer.google.com/appengine/\">Google App Engine</a> using <a href=\"https:/github.com/musketyr/gpars-appengine\">GPars App Engine</a> integration library</p>
            <p><a class=\"btn\" href=\"http:/gaelyk.appspot.com/plugins\">More about plugins &raquo;</a></p>
        </div>
    </div>
    

"""); include "/WEB-INF/includes/footer.gtpl (Arquivo ou diretório não encontrado)
at org.gradle.api.plugins.gaelyk.util.TemplateToScriptConverter$_inlineIncludes_closure1.doCall(TemplateToScriptConverter.groovy:69)
at org.gradle.api.plugins.gaelyk.util.TemplateToScriptConverter.inlineIncludes(TemplateToScriptConverter.groovy:57)
at org.gradle.api.plugins.gaelyk.util.TemplateToScriptConverter.this$2$inlineIncludes(TemplateToScriptConverter.groovy)
at org.gradle.api.plugins.gaelyk.util.TemplateToScriptConverter$this$2$inlineIncludes.callCurrent(Unknown Source)
at org.gradle.api.plugins.gaelyk.util.TemplateToScriptConverter.getTemplateAsScript(TemplateToScriptConverter.groovy:50)
at org.gradle.api.plugins.gaelyk.util.TemplateToScriptConverter$getTemplateAsScript.call(Unknown Source)
at org.gradle.api.plugins.gaelyk.tasks.ConvertTemplatesToScriptsTask$_compile_closure1.doCall(ConvertTemplatesToScriptsTask.groovy:42)
... 71 more

BUILD FAILED

Total time: 7.237 secs
serge@serge-vaio:~/git/site$


<% include "/WEB-INF/includes/header.gtpl?title=My Page Title" %>

    <div class="jumbotron center">
        <a href="http://gaelyk.appspot.com"><img alt="Gaelyk Logo" src="/images/gaelyk.png"/></a>
        <br/>
        <p>
            Congratulations, you've just created your first
            <a href="http://gaelyk.appspot.com">Gaelyk</a> application.
        </p>

        <p>
            <a href="/datetime" class="btn btn-primary btn-large">Show current time &raquo;</a>
        </p>
    </div>
    <div class="row">
        <div class="col-md-4">
            <h2>Start Experimenting</h2>
            <p>This template contains following sample files<ul><li><code>datetime.groovy</code></li><li><code>WEB-INF/pages/datetime.gtpl</code></li></ul>Try to edit them and watch the changes.</p>
        </div>
        <div class="col-md-4">
            <h2>Learn More</h2>
            <p>All <a href="http://gaelyk.appspot.com">Gaelyk</a> features are well documented. If you are new to <a href="http://gaelyk.appspot.com">Gaelyk</a> best place to learn more is the <a href="http://gaelyk.appspot.com/tutorial">Tutorial</a>.</p>
            <p><a class="btn" href="http://gaelyk.appspot.com/tutorial">Read Tutorial &raquo;</a></p>
        </div>
        <div class="col-md-4">
            <h2>Work Less</h2>
            <p>Take advantage of existing plugins. You can for example unleash the power of <a href="http://developer.google.com/appengine/">Google App Engine</a> using <a href="https://github.com/musketyr/gpars-appengine">GPars App Engine</a> integration library</p>
            <p><a class="btn" href="http://gaelyk.appspot.com/plugins">More about plugins &raquo;</a></p>
        </div>
    </div>

<% include "/WEB-INF/includes/footer.gtpl" %>

@musketyr
Copy link
Contributor

Gaelyk Gradle Plugin is trying to inline the includes when bulding the website. Currently if the include looks like

<% include <path to template> %>

it is trying to inline it. You can try to add some comment to break the regular expression rule

<% /* skip this */ include <path to template> %>

or pass the parameters to the template as the request attribute.

// groovlet
request.title = "Hello World!"
<% /* template */ %>
<title>$request.title</title>

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