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

Add twirl toolchain support #174

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sineaggi
Copy link
Contributor

Allows for the overriding of the java version used to invoke the twirl template compiler.

Resulting build.gradle.kts syntax would look like

tasks.compilePlayTwirlTemplates {
    javaLauncher.set(javaToolchains.launcherFor {
        languageVersion.set(JavaLanguageVersion.of(8))
    })
}

Note that if you're using a new version of java already, you can set the version of java used by the scala compiler via

tasks.compileScala {
    javaLauncher.set(javaToolchains.launcherFor {
        languageVersion.set(JavaLanguageVersion.of(8))
    })
}

@Sineaggi Sineaggi force-pushed the add-twirl-toolchain-support branch 3 times, most recently from 9c527f3 to a1a4945 Compare January 14, 2022 20:10
@Sineaggi
Copy link
Contributor Author

Sineaggi commented Jan 14, 2022

I've updated the mr to not directly depend on the JavaLauncher class being available, and have moved the code to a new extended TwirlCompile class. The code should now be compatible with the full gradle range currently supported.

@Sineaggi
Copy link
Contributor Author

So it looks like the integration tests are failing for this reason

Property 'javaLauncher' annotated with @Internal should not be also annotated with @Optional. This behaviour has been deprecated and is scheduled to be removed in Gradle 7.0. See https://docs.gradle.org/6.8/userguide/more_about_tasks.html#sec:up_to_date_checks for more details.

I had fixed a similar issue in #175

Signed-off-by: Clayton Walker <cwalker@sofi.org>
@Sineaggi Sineaggi force-pushed the add-twirl-toolchain-support branch from a1a4945 to 6317b33 Compare January 18, 2022 22:56
@Sineaggi
Copy link
Contributor Author

I misread, that error was about optional and not nullable. I've removed the @Optional annotation.

@Sineaggi
Copy link
Contributor Author

@JLLeitschuh any chance somebody at https://github.com/gradle can check a look?

@JLLeitschuh
Copy link
Contributor

Unfortunately, I'm not with Gradle anymore

@Sineaggi
Copy link
Contributor Author

@JLLeitschuh Sorry for the ping then.

@Sineaggi
Copy link
Contributor Author

@big-guy hello! Any chance somebody at gradle can review these changes?

@Sineaggi
Copy link
Contributor Author

So toolchains were added in gradle 6.7, so versions under that would now be unsupported.

Example failure on Gradle 6.6

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not create task ':app:compilePlayTwirlTemplates'.
   > Could not create task of type 'TwirlCompile'.
      > Could not generate a decorated class for type TwirlCompile.
         > org/gradle/jvm/toolchain/JavaLauncher

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

Successfully merging this pull request may close these issues.

2 participants