Skip to content
This repository has been archived by the owner on Jan 27, 2020. It is now read-only.

Property to change "Generated test source directory" #95

Closed
jmeierhofer opened this issue Jan 23, 2019 · 7 comments
Closed

Property to change "Generated test source directory" #95

jmeierhofer opened this issue Jan 23, 2019 · 7 comments
Milestone

Comments

@jmeierhofer
Copy link

Hello,

is it possible to change the Eclipse configuration where the "Generated test source directory" is?
Eclipse generates a folder with the name ".apt_generated_tests" in the project's directory.

I know there is a property in the net.ltgt.gradle.apt.EclipseJdtApt with name "genSrcDir" which I changed to another directory. Is there a chance to do this also for the ".apt_generated_tests"?

grafik

Regards
jmeierhofer

@tbroyer
Copy link
Owner

tbroyer commented Jan 23, 2019

Oh wow, this is news to me! For years Eclipse only had a single output directory for both main and test, and I'm not an Eclipse user so…

Could you tell me the configuration key in .settings/org.eclipse.jdt.apt.core.prefs for that other directory? (single output dir used to be org.eclipse.jdt.apt.genSrcDir)

Also, as you're at it, which other keys are there in this file? Currently, the plugin will generate:

org.eclipse.jdt.apt.aptEnabled=true
org.eclipse.jdt.apt.genSrcDir=.apt_generated
org.eclipse.jdt.apt.reconcileEnabled=true

(and org.eclipse.jdt.core.compiler.processAnnotations=true in .settings/org.eclipse.jdt.core.prefs).
IIRC, aptEnabled is obsolete (replaced by processAnnotations), and reconcileEnabled corresponds to Enable processing in editor.

@jmeierhofer
Copy link
Author

Had to rename the test src dir, to see the changes in the org.eclipse.jdt.apt.core.prefs file
The content is:
eclipse.preferences.version=1 org.eclipse.jdt.apt.aptEnabled=true org.eclipse.jdt.apt.genSrcDir=bin\\.apt_generated org.eclipse.jdt.apt.genTestSrcDir=.apt_generated_tests2 org.eclipse.jdt.apt.reconcileEnabled=false

@jmeierhofer
Copy link
Author

There is of course a new line after the version property, but somehow the format got corrupted. Sorry for that.

@jmeierhofer
Copy link
Author

Eclipse version I use is 2018-12 with Buildship 3.0.1

@tbroyer
Copy link
Owner

tbroyer commented Jan 23, 2019

Thanks, will add this (possibly not before this weekend though, and I have no idea when I'll cut the next release)

@tbroyer tbroyer added this to the 0.21 milestone Jan 23, 2019
@jmeierhofer
Copy link
Author

Thank you very much. Hope you will release soon ;-)

@tbroyer
Copy link
Owner

tbroyer commented Jan 24, 2019

Pending v0.21, you should be able to configure it from the build using something like:

eclipse {
  jdt {
    apt {
      withProperties { properties ->
        properties["org.eclipse.jdt.apt.genTestSrcDir"] = project.file("bin/.apt_generated_tests")
      }
    }
  }
}

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

No branches or pull requests

2 participants