Gradle version after update from 6.10 to 7.2.17

Hi team,

I update a project from Cuba Platform version 6.10 to 7.2.17 and when I try to assemble I get the following error:

Execution failed for task ‘:app-web:buildScssThemes’.

org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(Ljava/lang/Iterable;Lgroovy/lang/Closure;)Ljava/util/List;

I understand this is a Gradle version Issue, I checked the content of gradle/wrapper/gradle-wrapper.properties and it has:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-5.6.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

I deleted everything from the .gradle folder and run Cuba \ Build Tasks \ Assemble and it download 4.10.3 inside the .gradle folder and get the mentioned error

If I delete everything again and run ./gradlew --version I get:

------------------------------------------------------------
Gradle 5.6.4
------------------------------------------------------------

Build time:   2019-11-01 20:42:00 UTC
Revision:     dd870424f9bd8e195d614dc14bb140f43c22da98

Kotlin:       1.3.41
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.14 compiled on March 12 2019
JVM:          1.8.0_201 (Oracle Corporation 25.201-b09)
OS:           Windows 10 10.0 amd64

if I run ./gradlew clean assemble than 5.6.4 appears in the .gradle folder and I get this error:

Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
25 errors

> Task :app-web:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app-web:compileJava'.

Why does it use 2 versions of Gradle? How do I fix this?

Thank you
George

The problem was actually that IntelliJ and Project were using different versions of Java … I set them bot to 1.8.0_201 and it assembles

The problem left is that the Run button in IntelliJ is grayed out. I have invalidated caches and restarted but with no effect.

Any suggestions?
Thanks
George

Hi,
Normally CUBA 7.2 project should use Gradle 5.6.4, and either Java 8 or 11.

If you have compilation errors in your build.gradle script, there may be problems in your build.gradle file, maybe some legacy code that doesn’t work anymore in CUBA 7.2.
You can create a fresh 7.2 project, add custom themes / theme extensions there and check how the clean build.gradle will look like.

Here is part of my build script with custom themes, I present only webModule configuration:

configure(webModule) {
    configurations {
        webcontent
    }

    dependencies {
        compileOnly(servletApi)
        compile(globalModule)
    }

    jar {
        with copySpec {
            from sourceSets.main.allJava
            include "com/company/playground/web/toolkit/ui/client/**"
        }
    }

    task webArchive(type: Zip) {
        from file("$buildDir/web")
        from file('web')
        classifier = 'web'
    }

    artifacts {
        archives webArchive
    }

    task deployConf(type: Copy) {
        from file('src')
        include "com/company/playground/**"
        into "$cuba.appHome/${modulePrefix}/conf"
    }

    task clearMessagesCache(type: CubaClearMessagesCache) {
        appName = "${modulePrefix}"
    }
    deployConf.dependsOn clearMessagesCache

    task cleanConf(description: 'Cleans up conf directory', type: Delete) {
        delete "$cuba.appHome/${modulePrefix}/conf"
    }

    task deploy(dependsOn: [assemble, cleanConf], type: CubaDeployment) {
        appName = "${modulePrefix}"
        appJars(modulePrefix + '-global', modulePrefix + '-web')
    }

    task buildScssThemes(type: CubaWebScssThemeCreation)

    task deployThemes(type: CubaDeployThemeTask, dependsOn: buildScssThemes)

    assemble.dependsOn buildScssThemes

    task themesJar(type: Jar) {
        from file('themes')
        classifier = 'themes'
    }

    artifacts {
        archives themesJar
    }
}