grails / grails-gradle-plugin

Apache License 2.0
6 stars 9 forks source link

7.x GspCompileOptions Currently Broken #314

Closed codeconsole closed 5 days ago

codeconsole commented 1 month ago

https://github.com/grails/grails-gradle-plugin/blob/7.0.x/src/main/groovy/org/grails/gradle/plugin/web/gsp/GspCompileOptions.groovy

https://github.com/grails/grails-gradle-plugin/commit/46ffc01adead46a4dfe422670b19292450ab6c02#diff-d42544013c3ef28d9a899aa97c700376cca65606e62ec1daf6da8e98ea9b66a9

git clone https://github.com/codeconsole/website.git -b 7.0.0-SNAPSHOT website7 && cd website7 && ./gradlew compileGroovyPages

Replication instructions:
git clone https://github.com/codeconsole/website.git -b 7.0.0-SNAPSHOT website7
cd website7
./gradlew compileGroovyPages

> Configure project :
Cannot resolve reloading agent JAR: Failed to resolve imported Maven boms: Cannot resolve external dependency org.springframework.boot:spring-boot-dependencies:3.2.6 because no repositories are defined.
Required by:
    project :

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/sheiberg/Documents/workspace/website7/build.gradle' line: 4

* What went wrong:
An exception occurred applying plugin request [id: 'org.grails.grails-gsp', version: '7.0.0-SNAPSHOT']
> Failed to apply plugin 'org.grails.grails-gsp'.
   > Could not create task ':compileGroovyPages'.
      > Could not create task of type 'GroovyPageForkCompileTask'.
         > java.lang.InstantiationException (no error message)
matrei commented 1 month ago

During the discussion, I got the impression that the changes discussed were regarding making the 6.2.1 release compatible with Gradle 8.9 (without actually upgrading). Did I misunderstand?

codeconsole commented 1 month ago

@matrei Gradle wouldn't be upgraded in 6.x, but the incompatible gsp task could. Right now 7.x grails-gradle-plugin doesn't work with any version of Gradle.

jamesfredley commented 3 weeks ago

diff where Gradle changed GroovyForkOptions to an abstract class. "Make more types that are visible in the DSL abstract"

https://github.com/gradle/gradle/commit/35123b2323864033525762b70d8c092975884238#diff-d13e1e7cb89d94720da2d445e9b474ed4033fc829485f6ae177657aa3bc7729c

jamesfredley commented 3 weeks ago

@codeconsole @davydotcom Here is my wild guess https://github.com/grails/grails-gradle-plugin/compare/7.0.x...jamesfredley/GroovyForkOptionsFor7?expand=1

This does get https://github.com/codeconsole/website.git -b 7.0.0-SNAPSHOT website7 past the GroovyPageForkCompileTaskissue and then it runs into two versions of groovy-xml. I am not sure about it passing config, since I couldn't find an example where it was being used for GroovyPageForkCompileTask

This code will also compile on Gradle 7.6.4, if we want it for Grails 6.2.1.