libgdx/gdx-liftoff

html build with lombok

sakolesnikov opened this issue · 5 comments

clean a cache and then recompile empty project does not work.
It gives me an error about out of memory.
Recorded a video
I also tried to use -Dgwt.extraJvmArgs="-Xms1g -Xmx2g" in VM options after recorded video.

If I remove the following configuration

configurations { lom }
dependencies {
    lom "org.projectlombok:lombok:${lombokVersion}"
    implementation configurations.lom.dependencies
    annotationProcessor configurations.lom.dependencies
}

draftCompileGwt {
    doFirst {
        jvmArgs "-javaagent:${configurations.lom.asPath}=ECJ"
    }
}

compileGwt {
    doFirst {
        jvmArgs "-javaagent:${configurations.lom.asPath}=ECJ"
    }
}

superDev {
    doFirst {
        jvmArgs "-javaagent:${configurations.lom.asPath}=ECJ"
    }
}

recompile works flawlessly.

Huh, strange... that config may have been needed in an older Lombok version, and isn't now; I have no idea how Lombok works. For me, adding the Lombok Gradle plugin as a buildscript dependency seems to help:

I added classpath "io.freefair.gradle:lombok-plugin:6.5.0.3" next to classpath "org.wisepersist:gwt-gradle-plugin:$gwtPluginVersion" in the root build.gradle, and put apply plugin: "io.freefair.lombok" next to apply plugin: 'idea' under allprojects just below.

This enabled various Lombok-related Gradle tasks, including delombok, but I'm not sure how it works, really.

I didn't have to change the ECJ configuration you did when I used this, but I wasn't totally sure how to replicate the issue in the first place... Have you tried adding code that uses Lombok features to the empty project?

Recorded new video for you
I tried all approaches with brand new project. Hope it will be helpful.

Agh... I need to test while using Builder... There may be something I can add to the config for the freefair Lombok Gradle plugin. It's possible the config was correct before, but just used more memory than usual when starting the server with Debug, and it already uses a lot.

This doesn't seem to affect any projects I've created at all... Do you have low available RAM when you run the Gradle tasks?

I guess we can close this issue for while for further details