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

Fix compatibility between Buildship/Gradle and Groovy 2.5 #370

Closed
donat opened this issue Nov 6, 2017 · 47 comments
Closed

Fix compatibility between Buildship/Gradle and Groovy 2.5 #370

donat opened this issue Nov 6, 2017 · 47 comments
Assignees
Labels
Milestone

Comments

@donat
Copy link

donat commented Nov 6, 2017

Based on following user report it seems that the latest groovy-eclipse version broke the Gradle support in Eclipse: https://discuss.gradle.org/t/seemingly-trivial-additions-to-build-gradle-cause--buildscript--error/24386/9 Are you aware any changes in the codebase that might be related?

@oehme
Copy link

oehme commented Nov 6, 2017

Specifically it seems groovy-eclipse is deleting compiled scripts from Gradles script cache. Downgrading resolved the issue for all users.

@eric-milles
Copy link
Member

I can't think of anything that would be interfering with Buildship/Gradle script cache. Is it using any org.codehaus.groovy packages? If importing via Import-Package instead of Require-Bundle, the patched Groovy bundle may be referenced.

@oehme
Copy link

oehme commented Nov 6, 2017

The issue is not about code running inside Eclipse. Buildship does not interact with Groovy at all. The Gradle daemon (a different process) compiles Groovy scripts into a cache. These files are being deleted and it seems that is happening because of groovy-eclipse. I have no idea why it would be doing that or how it would even find those classes. But downgrading to an older version of groovy-eclipse fixed the issue for our users, so there must be some obscure connection.

I'll ask the users who reported that issue to provide more details, maybe they can debug a bit.

@arihunta
Copy link

arihunta commented Nov 7, 2017

Ok, so I'm running Eclipse 4.7.1a, and I reproduced it with the following steps:

  • Install Groovy-Eclipse from the following site: http://dist.springsource.org/snapshot/GRECLIPSE/e4.7/
  • In Eclipse, find a Gradle project and right-click -> Gradle -> Refresh Gradle Project, and it works. I'm using a project with a wrapper targeting Gradle 4.3.
  • Make a change to the Gradle build script for that project (e.g. add/remove a dependency).
  • Now right-click -> Gradle -> Refresh Gradle Project, and the following error appears:

image

  • Stopping Gradle daemons and deleting [gradle user home]\caches\4.3 makes the refresh work.
  • If, before running the refresh, a gradlew clean build is run outside of Eclipse, then the refresh works.

Let me know if I can provide any further information. I'm not sure how exactly to interpret the contents of [gradle user home]\caches\4.3, to find out what's going on there.

@eric-milles
Copy link
Member

Does anyone have more detail -- an Error Log entry perhaps? The steps above worked for me using Gradle 4.3.1.

@eric-milles
Copy link
Member

One thing you can check: Are script filters enabled for *.gradle files? This will shut down some processing that Groovy-Eclipse does on a perceived Groovy file.

script-filters

The presence in the list indicates that **/*.gradle is recognized as a script. The checkbox being unchecked merely indicates Gradle files will not be copied into output directories.

@oehme
Copy link

oehme commented Nov 17, 2017

It only seems to happen when using Groovy 2.5 in Eclipse, maybe that's what's really causing the problem, not a change in the groovy-eclipse plugin per se.

@eric-milles
Copy link
Member

Sure enough, when I switch to Groovy 2.5 I get this exception:

org.gradle.tooling.BuildException: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.3.1-bin.zip'.
	at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
	at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
	at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41)
	at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)
	at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
	at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter.run(DefaultBuildActionExecuter.java:60)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.buildship.core.workspace.internal.ConnectionAwareLauncherProxy.invokeRun(ConnectionAwareLauncherProxy.java:170)
	at org.eclipse.buildship.core.workspace.internal.ConnectionAwareLauncherProxy.invoke(ConnectionAwareLauncherProxy.java:160)
	at com.sun.proxy.$Proxy39.run(Unknown Source)
	at org.eclipse.buildship.core.workspace.internal.DefaultModelProvider$1.get(DefaultModelProvider.java:112)
	at org.eclipse.buildship.core.workspace.internal.DefaultModelProvider$3.call(DefaultModelProvider.java:142)
	at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4724)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3522)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2315)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2278)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2193)
	at com.google.common.cache.LocalCache.get(LocalCache.java:3932)
	at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4721)
	at org.eclipse.buildship.core.workspace.internal.DefaultModelProvider.getFromCache(DefaultModelProvider.java:153)
	at org.eclipse.buildship.core.workspace.internal.DefaultModelProvider.executeOperation(DefaultModelProvider.java:138)
	at org.eclipse.buildship.core.workspace.internal.DefaultModelProvider.executeBuildActionExecuter(DefaultModelProvider.java:108)
	at org.eclipse.buildship.core.workspace.internal.DefaultModelProvider.fetchModels(DefaultModelProvider.java:78)
	at org.eclipse.buildship.core.workspace.internal.DefaultModelProvider.fetchEclipseGradleProjects(DefaultModelProvider.java:99)
	at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildsJob.fetchEclipseProjects(SynchronizeGradleBuildsJob.java:91)
	at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildsJob.synchronizeBuild(SynchronizeGradleBuildsJob.java:81)
	at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildsJob.runToolingApiJob(SynchronizeGradleBuildsJob.java:73)
	at org.eclipse.buildship.core.util.progress.ToolingApiJob$1.run(ToolingApiJob.java:73)
	at org.eclipse.buildship.core.util.progress.ToolingApiInvoker.invoke(ToolingApiInvoker.java:62)
	at org.eclipse.buildship.core.util.progress.ToolingApiJob.run(ToolingApiJob.java:70)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Caused by: org.gradle.internal.exceptions.LocationAwareException: Could not create an instance of type settings_dmhj7wyyisfas3mkl7xdvt41w.
	at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
	at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
	at org.gradle.initialization.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:30)
	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:137)
	at org.gradle.initialization.DefaultGradleLauncher.getConfiguredBuild(DefaultGradleLauncher.java:104)
	at org.gradle.internal.invocation.GradleBuildController$2.call(GradleBuildController.java:87)
	at org.gradle.internal.invocation.GradleBuildController$2.call(GradleBuildController.java:84)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
	at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)
	at org.gradle.internal.invocation.GradleBuildController.configure(GradleBuildController.java:84)
	at org.gradle.tooling.internal.provider.runner.ClientProvidedBuildActionRunner.run(ClientProvidedBuildActionRunner.java:65)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
	at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
	at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:57)
	at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
	at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
	at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:45)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
	at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
	at org.gradle.util.Swapper.swap(Swapper.java:38)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
	at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.api.reflect.ObjectInstantiationException: Could not create an instance of type settings_dmhj7wyyisfas3mkl7xdvt41w.
	at org.gradle.internal.reflect.DirectInstantiator.newInstance(DirectInstantiator.java:55)
	at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.getScript(DefaultScriptRunnerFactory.java:55)
	at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:85)
	at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$2.run(DefaultScriptPluginFactory.java:209)
	at org.gradle.configuration.DefaultScriptTarget.addConfiguration(DefaultScriptTarget.java:74)
	at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:214)
	at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:61)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
	at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:58)
	at org.gradle.initialization.ScriptEvaluatingSettingsProcessor.applySettingsScript(ScriptEvaluatingSettingsProcessor.java:73)
	at org.gradle.initialization.ScriptEvaluatingSettingsProcessor.process(ScriptEvaluatingSettingsProcessor.java:63)
	at org.gradle.initialization.PropertiesLoadingSettingsProcessor.process(PropertiesLoadingSettingsProcessor.java:37)
	at org.gradle.initialization.NotifyingSettingsProcessor$1.call(NotifyingSettingsProcessor.java:45)
	at org.gradle.initialization.NotifyingSettingsProcessor$1.call(NotifyingSettingsProcessor.java:42)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:350)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:340)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:120)
	at org.gradle.initialization.NotifyingSettingsProcessor.process(NotifyingSettingsProcessor.java:42)
	at org.gradle.initialization.DefaultSettingsLoader.findSettingsAndLoadIfAppropriate(DefaultSettingsLoader.java:90)
	at org.gradle.initialization.DefaultSettingsLoader.findAndLoadSettings(DefaultSettingsLoader.java:47)
	at org.gradle.internal.composite.CompositeBuildSettingsLoader.findAndLoadSettings(CompositeBuildSettingsLoader.java:49)
	at org.gradle.initialization.NotifyingSettingsLoader.findAndLoadSettings(NotifyingSettingsLoader.java:31)
	at org.gradle.initialization.DefaultGradleLauncher$LoadBuild.run(DefaultGradleLauncher.java:235)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
	at org.gradle.initialization.DefaultGradleLauncher.loadSettings(DefaultGradleLauncher.java:159)
	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:122)
	... 62 more
Caused by: java.lang.NoClassDefFoundError: _BuildScript_
	at org.gradle.internal.reflect.DirectInstantiator$ConstructorCache.create(DirectInstantiator.java:80)
	at org.gradle.internal.reflect.DirectInstantiator$ConstructorCache.create(DirectInstantiator.java:75)
	at org.gradle.internal.reflect.ReflectionCache$WeaklyClassReferencingCache.get(ReflectionCache.java:56)
	at org.gradle.internal.reflect.ReflectionCache.get(ReflectionCache.java:36)
	at org.gradle.internal.reflect.DirectInstantiator.newInstance(DirectInstantiator.java:49)
	... 94 more
Caused by: java.lang.ClassNotFoundException: _BuildScript_
	at org.gradle.groovy.scripts.internal.DefaultScriptCompilationHandler$ScriptClassLoader.loadClass(DefaultScriptCompilationHandler.java:399)
	... 99 more

@mauromol
Copy link

I personally do not have any problem to run even the latest Greclipse snapshot with Gradle up to 4.3 and Groovy 2.4.12, on both Oxygen.1 and Neon.3.
I never tested them with Groovy 2.5.x.

@oehme
Copy link

oehme commented Nov 17, 2017

Now the odd part is that the Gradle daemon is a completely separate process, so the version of Groovy used in Eclipse shouldn't influence what happens in Gradle. However, the error message above indicates that a compiled script has been deleted from Gradle's caches.

@eric-milles
Copy link
Member

eric-milles commented Nov 17, 2017 via email

@eric-milles
Copy link
Member

Not sure if this helps anyone, but _BuildScript_.class is found in .gradle\caches\4.3.1\scripts\d1jpu1000axj28wj6ocu5taq8\settings\settings83b741245ea72a40d718756d5d973aaa\classes and settings_dmhj7wyyisfas3mkl7xdvt41w.class is found in .gradle\caches\4.3.1\scripts-remapped\settings_dmhj7wyyisfas3mkl7xdvt41w\d1jpu1000axj28wj6ocu5taq8\settings83b741245ea72a40d718756d5d973aaa\classes.

gradle-cache

@regrog
Copy link

regrog commented Nov 21, 2017

Same error here.
I downloaded a stand alone gradle wrapper 4.3.1 and executed as command line and the error keeps showing up.
Deleting gradle cache in my user home fixed the problem.

@eric-milles
Copy link
Member

@regrog Can you confirm that command-line build with Gradle 4.3 and Groovy 2.5 fails (no Groovy-Eclipse in the picture)?

@regrog
Copy link

regrog commented Nov 22, 2017

Sorry, I omitted that....
I have latest Groovy-Eclipse installed that broke my build, then I tried with the wrapper as described previously

@eric-milles eric-milles changed the title Latest groovy-eclipse snapshot might broke Gradle support Fix compatibility between Buildship/Gradle and Groovy 2.5 Jan 9, 2018
@eric-milles eric-milles added the bug label Jan 9, 2018
@eric-milles eric-milles added this to the v3.0.0 milestone Jan 9, 2018
@Kanti1702
Copy link

Same issue occurred in my case when I try to install groovy-eclipse snapshot plugin it breaks gradle, deleting cache resolve issue though. Is there any fix for this?

@eric-milles
Copy link
Member

eric-milles commented Feb 16, 2018 via email

@oehme
Copy link

oehme commented Mar 6, 2018

I saw you opened https://bugs.eclipse.org/bugs/show_bug.cgi?id=532075 for Buildship. I don't think we need a second issue to discuss this (@donat and I are the Buildship team). Let's keep the discussion here.

We don't know what Groovy 2.5 is doing, but it seems to delete compiled scripts from Gradle's cache. This is really odd because the Groovy version installed in Eclipse should have 0 influence on the Gradle daemon, which is a completely separate process with its own version of Groovy inside.

@eric-milles
Copy link
Member

eric-milles commented Mar 6, 2018 via email

@fofocx
Copy link

fofocx commented Apr 26, 2018

Buildship run failed, I installed groovy-eclipse plugin, groovy compiler version is 2.6.0. Refresh gradle project error is here:
u0 o q80 1a1 6f r lg l

And gradle crashed when switch groovy compiler version from 2.6.0 to 2.4.15. Gradle menu has been remove from project and task view and executions view were broken. It shows message on workspace startup: An internal error occurred during: "Decoration Calculation".
Invalid registry object

And task view error message:

java.lang.Exception
	at org.eclipse.ui.internal.ViewReference.createErrorPart(ViewReference.java:112)
	at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:98)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPart(CompatibilityPart.java:293)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:331)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:990)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:955)
	at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:124)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:399)
	at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:318)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:105)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:74)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:56)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:129)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:992)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:661)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$1.run(PartRenderingEngine.java:546)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:530)
	at org.eclipse.e4.ui.workbench.renderers.swt.ElementReferenceRenderer.createWidget(ElementReferenceRenderer.java:70)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:992)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:661)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:767)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:738)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:732)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:716)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$1.handleEvent(PartServiceImpl.java:109)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:233)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:144)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4889)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:212)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:36)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:201)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:52)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:60)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:173)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:620)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:584)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:769)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:743)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:681)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:676)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1179)
	at org.eclipse.ui.internal.WorkbenchPage.showPart(WorkbenchPage.java:1287)
	at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1278)
	at org.eclipse.ui.internal.WorkbenchPage$12.run(WorkbenchPage.java:4329)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:4325)
	at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:4305)
	at org.eclipse.ui.handlers.ShowViewHandler.openView(ShowViewHandler.java:132)
	at org.eclipse.ui.handlers.ShowViewHandler.openOther(ShowViewHandler.java:110)
	at org.eclipse.ui.handlers.ShowViewHandler.execute(ShowViewHandler.java:77)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:291)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:92)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:305)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:239)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:494)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:390)
	at org.eclipse.ui.internal.ShowViewMenu$1.run(ShowViewMenu.java:139)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:565)
	at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:397)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4238)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3817)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1499)

Eclipse version Oxygen.3 Release, sts plugin version 3.9.3.201803200843-RELEASE, Eclipse Groovy Development Tools 3.0.0.xx-201804052043-e47

@andycarlsonuk
Copy link

I'm running Eclipse 4.6.3. The workaround suggested here did not help.

Today I updated all my plugins to try to cure an issue with running Cucumber tests and I hit this error.

Tried removing and reinstalling Buildship - no help
Tried switching Groovy compiler version to 2.4 - no help
Tried removing Groovy 2.5 early access compiler - no help
Tried removing Groovy compilers and all other plugins with Groovy in the name - no help
Tried config revert back to the previous working setup - failed. I think it could not find the right EclEmma version.
Tried (again) removing and reinstalling Buildship - no help

So right now my Eclipse is broken for the projects that I work on :(

Tomorrow I will try installing from scratch with a more recent version and hope that gets me back to a working setup.

@andycarlsonuk
Copy link

`Thought that command line builds should still work... WRONG. They are broken too :(

`>.\gradlew clean

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not create an instance of type settings_8oefo9b7macofq1zmwsalx1nr.

BuildScript

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 0s`

So it looks like something is messed up with Gradle, even outside of Eclipse. Any suggestions for how to get myself out of this situation?

@oehme
Copy link

oehme commented Apr 26, 2018

Stopping the daemon should help. If that doesn't fix it, you'll have to clear out the cache in ~/.gradle.

@andycarlsonuk
Copy link

Thanks for your help - it got me out of the problem.

For the benefit of others, here is what I did...

I found a couple of gradle daemon (Java) processes using the Procexp tool and killed them. This tool lets me see the command line easily to find the right process.

Killing the daemons did not fix the issue but it was a necessary step.

The gradle internal files on my Windows 10 machine are in c:\Users\<username>\.gradle

Below here is a directory 'caches' and below this are multiple directories with different version numbers. These correspond to the Gradle wrapper version. Below the version directory are several directories. The ones affected by this issue seem to be 'scripts' and 'scripts-remapped'

So for example...

C:\Users\andy\.gradle\caches\4.5\scripts
C:\Users\andy\.gradle\caches\4.5\scripts-remapped

I renamed these directories by adding an underscore to the end of the file name (this is easier to undo that deleting them). All of the gradle daemons need to be stopped before doing this.

I repeated this for each version of the wrapper that has been affected and still in use by projects (I had more than one version in use)

After doing this the problem was gone and I was able to run gradlew on the command line. The builds in Eclipse also started working again (but remember that I had previously uninstalled all of the groovy plugins - perhaps more than I needed to do but preventing groovy 2.5 from being used also seems to be a required step). In each case it took some time for the tools to rebuild their internal state - tens of minutes for Eclipse.

To find the wrapper version... it may be visible in the Eclipse error dialog. If not, look at each project. Each of mine has a file 'gradle/wrapper/gradle-wrapper.properties' containing a setting distributionUrl which includes the version number

@fofocx
Copy link

fofocx commented Apr 27, 2018

Delete those directories will fix problem, they will re-create after next running. And.. must to run gradlew in command line once for each version(version number in properties)... Now it work fine with groovy plugin and compiler level 2.6...

@andycarlsonuk
Copy link

But I updated just yesterday and got groovy '2.5 (early access)' if I recall correctly... and walked unwittingly into a mess that burned up several hours to resolve.

Is 2.6 in the auto update yet? Did I maybe hit this because my Eclipse version is not the latest?

@oehme
Copy link

oehme commented Apr 27, 2018

Just to clarify: Everything works with 2.6?

@fofocx
Copy link

fofocx commented Apr 27, 2018

No. It seems working just using the cache generated by command line, but not the plugin, get "BuildScript" when there is no cache(change file and rebuild).
Buildship will use jre automatically.
khcbt tk 3hpc hplawrx
compile, build and jar will get error cause cannot find tool.jar in jdk.

And Gradle wrapper version of new project is 4.3 always( I have selected wrapper to 4.7 in window->performance->gradle ).
I tried to find more, so I deleted .gradle directories and start buildship to build, and the error again.
There is the file comparison between the generated .gradle of their, left is generated by running gradlew in cmd, and right is buildship
fgs c_ttde k zqkhmx5th
r5ss zjfytc6 uw10 b kfx
w8tthrr2 29i 0by my1
ev9 c qt 41kd_64oc1cecd
njc4ic2 58sr4p b d_r 8
The directories of wrapper, workers and native are totally the same, and others are different obviously.
Hope this would be helpful for you.

@gpaglia
Copy link

gpaglia commented Jul 2, 2018

Hello,
I'm experiencing the same problem with:

  • Windows 10
  • Eclipse Photon 4.8
  • Java jdk 10.0.1
  • Buildship v2.2.1 / Gradle 4.8.1 (no wrapper)

After iInstalling GRECLIPSE from site http://dist.springsource.org/snapshot/GRECLIPSE/e4.8/ any gradle refresh on any project will fail with the error:

Could not create an instance of type settings_xxxxx.
_BuildScript_

Changing the groovy compiler (2.4, 2.5 or 2.6 alpha) or erasing the .gradle directories both in project home as well as in gradle user home or changing the gradle release does not resolve.

Only removal of GRECPLISE from Eclipse brings the system back to correct operation.

In my case and in my environment it seems that coexistence of GRECLIPSE with buildship is impossible.

Is this issue being looked into?

Regards
Gianni

@eric-milles
Copy link
Member

@donat I'd like to resolve this issue between Buildship and Greclipse. Are you the developer contact from the Gradle side? I've investigated to the best of my abilities and found that the _BuildScript_ class is created in the cache directory tree, but may be under an unexpected hash. The Gradle Daemon log does not really contain anything interesting.

@donat
Copy link
Author

donat commented Jul 24, 2018

@eric-milles yes, I am that person, although I won't be able to look into it this month as I'm just about to go on vacation. I'll investigate further once I come back.

@eric-milles
Copy link
Member

Something I just noticed is that when I comment this out in GroovyActivator the Gradle project refresh works properly. Has Gradle been tried with InvokeDynamic enabled for the gradle/daemon process?

        // enable InvokeDynamic support across the board
        System.setProperty("groovy.target.indy", "true");

@eric-milles
Copy link
Member

When I set this system property for Groovy 2.4, I get the same error. So the real issue is indy support and not Groovy 2.4 vs 2.5.

eric-milles added a commit that referenced this issue Jul 24, 2018
- search for groovy "indy" jar within a project's GROOVY_SUPPORT (aka
"Groovy Libraries") classpath container
@eric-milles eric-milles self-assigned this Jul 24, 2018
@mauromol
Copy link

Hi Eric, does your applied workaround prevent Eclipse/Gradle projects in the workspace to use Indy Groovy on their own classpath? Because I was using it regularly with no issue at all...

@oehme
Copy link

oehme commented Jul 25, 2018

@eric-milles Thank you for the analysis and glad you found a fix!

@donat We should check why this could affect Gradle. Do we just pass all system properties to the daemon?

@eric-milles
Copy link
Member

@mauromol You can still use any jars that were compiled indy. If the Groovy Libraries classpath container is found for your project, indy will be enabled for compilation automatically. Otherwise, you will need to enable indy using a compiler config script.

I could not find a quick way to access the Gradle project model; Buildship did not appear to expose it through an adapter or something else. I think this is how you enable indy compilation for the gradle build:
gradle-project

@eric-milles
Copy link
Member

@oehme or @donat Is it Buildship or the eclipse gradle plugin that creates/populates the .classpath and .project files when I run Refresh Gradle Project? I'd like to see the test source folders and testCompile dependencies marked with the new "test" classpath entry attribute (new to Eclipse Photon).

@oehme
Copy link

oehme commented Jul 25, 2018

@eric-milles Gradle provides the data model, Buildship configures the project from that model. So Gradle would have to add that "test" attribute.

If the Groovy Libraries classpath container is found for your project, indy will be enabled for compilation automatically.

It would be great if this was not bound to the Groovy container, since neither Gradle nor Maven use that. They provide their own classpath container containing the dependencies configured in the build. Why not look on the resolved classpath, matching on the "indy" in the jar's name?

@mauromol
Copy link

@eric-milles I do not use the Groovy container at all, I disabled it, I'm just configuring the Eclipse project classpath by adding the Groovy Indy jar to the compile configuration of the corresponding Gradle project (through the Buildship "project and external dependencies" classpath container). This should be enough to enable the Indy compilation (AFAIK... Am I wrong?). My question was due to the fact I had a quick look at your commit and I saw you're searching for the Indy jar in the classpath (to do something I don't know), so I was wondering whether your workaround weren't going to break my configuration. I can't check right now because I'm on holiday.

@eric-milles
Copy link
Member

eric-milles commented Jul 25, 2018

@oehme Does Buildship expose computed Gradle model through an IAdapter? For example, can I take an IProject or IJavaProject and call project.adapt(org.gradle.api.Project.class)?

@mauromol and @oehme I was pressed for time and so I went for the quick check. If a project has Groovy Libraries classpath container and it contains groovy-x.y.x-indy.jar, then enable indy compilation. I did not want to pay the expense of scanning resolved classpath of any java project for a groovy-x.y.x-indy.jar or groovy-all-x.y.x-indy.jar. Besides, you may use the indy variants of Groovy jars but compile your own sources without indy enabled. The best option I could think of was to allow any project that wanted indy and uses Ivy/Maven/Gradle for dependencies to add a config script that sets the indy option.

There should be no breakage for any existing workspaces/projects. If you are using Groovy 2.5+ compiler within Eclipse, compilation may not use indy in all cases it did before. However, you may still enable it. And for the separate Gradle build, you would have already needed to enable indy from within build.gradle. Hope this helps.

@oehme
Copy link

oehme commented Jul 25, 2018

Does Buildship expose computed Gradle model through an IAdapter? For example, can I take an IProject or IJavaProject and call project.adapt(org.gradle.api.Project.class)?

You can't get the Project, the tooling models are decoupled from the Gradle API and are specific to what the tool needs. This allows us to have forward and backward compatibility across multiple major Gradle versions. Since Buildship doesn't deal with Groovy, there is nothing about Groovy in the model that Buildship uses. You can write your own model however. What would be your use case?

The best option I could think of was to allow any project that wanted indy and uses Ivy/Maven/Gradle for dependencies to add a config script that sets the indy option.

That sounds like a reasonable workaround.

@eric-milles
Copy link
Member

The use case is to see if "indy" optimization option is set within GroovyCompile.groovyOptions.optimizationOptions, like this:

compileGroovy {
  groovyOptions.optimizationOptions.indy = true
}

I don't want to scan the file contents or deal with the many ways in which this may get set. It is probably better if the gradle eclipse plug-in pushes this state into the eclipse project settings instead.

@donat
Copy link
Author

donat commented Aug 30, 2018

@eric-milles Currently it's a bit painful to implement, but that's about to change. We're going to implement a project configurator extension point for Buildship where external plugins can hook into the project synchronization and can access arbitrary information from the Gradle build. I can imagine dogfooding this extension point in Buildship and reading the groovyOptions.optimizationOptions.indy from the Groovy plugin config.

I'm not familiar with the groovy-eclipse codebase, so what exactly should Buildship do with this configuration?

@eric-milles
Copy link
Member

What I was looking at doing was accessing the Gradle/Groovy model to see if compiler config was changed. If it was, the eclipse project could be auto-configured with a compiler config script. This would give closer parity between Gradle build and Eclipse build.

@donat
Copy link
Author

donat commented Aug 30, 2018

I think I understand. Is there an API or a file where Buildship can configure the compiler config script for a project?

@eric-milles
Copy link
Member

Oh, you are thinking Buildship could do it? If "compileGroovy.groovyOptions.optimizationOptions.indy" is true, I was going to try and set preference "org.eclipse.jdt.core.compiler.groovy.projectFlags=2" (in .settings/org.eclipse.jdt.groovy.core.prefs) as a minimal first step.

@donat
Copy link
Author

donat commented Aug 31, 2018

Well, since the solution will be an extension, it can be implemented both in Buildship and in groovy-eclipse. On the second thought, the latter makes more sense. I can open a PR with the solution once the Buildship-side is ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants