buildship icon indicating copy to clipboard operation
buildship copied to clipboard

The "Refresh Gradle Project" command does not reload .settings/org.eclipse.jdt.apt.core.prefs

Open nakamura-to opened this issue 9 months ago • 1 comments

Expected Behavior

When the "Refresh Gradle Project" command is executed, the Processor options specified in build.gradle are displayed on the Annotation Processing screen.

Current Behavior

When the "Refresh Gradle Project" command is executed, the Processor options specified in build.gradle are reflected in the .settings/org.eclipse.jdt.apt.core.prefs file, but they are not reflected on the Annotation Processing screen.

Context

I want to use synchronizationTasks to ensure that all settings related to annotation processing are reflected from Gradle to Eclipse.

Steps to Reproduce

  • Create a Gradle Project.
  • Replace the contents of build.gradle with the following:
plugins {
    id 'java-library'
    id 'com.diffplug.eclipse.apt' version '3.44.0'
}

compileJava {
    aptOptions {
        processorArgs = ['myOption' : 'hello']
    }
}

eclipse {
    synchronizationTasks 'cleanEclipse', 'eclipse'
}
  • Execute the "Refresh Gradle Project" command.
  • 0pen the .settings/org.eclipse.jdt.apt.core.prefs file and verify that the processor options specified in build.gradle are reflected in it:
#
#Mon May 20 21:44:34 JST 2024
org.eclipse.jdt.apt.aptEnabled=true
org.eclipse.jdt.apt.genTestSrcDir=.apt_generated_tests
org.eclipse.jdt.apt.reconcileEnabled=true
org.eclipse.jdt.apt.genSrcDir=.apt_generated
eclipse.preferences.version=1
org.eclipse.jdt.apt.processorOptions/myOption=hello
  • 0pen the Annotation Processing screen.

You will notice that the processorOptions remain empty in the Annotation Processing screen.

Your Environment

  • Eclipse IDE for Java Developers
    • Version: 2024-03 (4.31.0)
    • Build id: 20240307-1437

nakamura-to avatar May 20 '24 13:05 nakamura-to