Strumenta / antlr-kotlin

Support for Kotlin as a target for ANTLR 4
Apache License 2.0
227 stars 47 forks source link

Support for Gradle 6 #52

Closed Jakobeha closed 3 years ago

Jakobeha commented 4 years ago

I recently updated my project to Gradle 6.6 (in order to update to Kotlin 1.4.0) and whenever I build it I get an error with this stack trace. Downgrading gradle back to 5.5.1 fixes the issue:

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':generateKotlinCommonGrammarSource'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:208)
        <32 internal calls>
Caused by: java.lang.NoSuchMethodError: org.gradle.process.internal.worker.WorkerProcessFactory.singleRequestWorker(Ljava/lang/Class;Ljava/lang/Class;)Lorg/gradle/process/internal/worker/SingleRequestWorkerProcessBuilder;
    at com.strumenta.antlrkotlin.gradleplugin.internal.AntlrWorkerManager.createWorkerProcess(AntlrWorkerManager.java:39)
    at com.strumenta.antlrkotlin.gradleplugin.internal.AntlrWorkerManager.runWorker(AntlrWorkerManager.java:34)
    at com.strumenta.antlrkotlin.gradleplugin.AntlrKotlinTask.execute(AntlrKotlinTask.java:230)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        <93 internal calls>

It seems like the plugin is trying to reference a method singleRequestWorker which was removed in the lastest gradle version, so the plugin will need a different API to create workers. A bit of googling suggests that SpotBugs had a similar issue. Maybe I will look into this later.

drieks commented 3 years ago

@ftomassetti: this ticket can be closed, we are already using Gradle 6.7

ftomassetti commented 3 years ago

Right!

koreQAQ commented 3 years ago

Thanks, i changed my gradle version to 5.x , then i fixed this issue.