Open wzurborg opened 4 years ago
Does it work for you?
I sent you a mail directly. I am not sure, I will re-open it when I have debugged the problem.
Reopened since the problem persists. I have tried many variations for configuring the xtend-maven-plugin, but nothing has helped so far.
can you please provide a minimal reproducible example?
Difficult, but I will try.
Please see https://github.com/wzurborg/xtend-example for a minimal example. I can reproduce the problem with this project, i.e. test sources are generated into src/main/xtend-gen with the Maven build and into src/test/xtend-gen with the Eclipse build.
i have no idea if eclipse-plugin
supports this usecase at all.
usually test code is a separate plugin
with <packaging>eclipse-test-plugin</packaging>
If this is not supported then a warning should be added to https://www.eclipse.org/Xtext/documentation/350_continuous_integration.html#tycho-build .
I will separate the test code in any case to avoid unwanted test dependencies in the product.
I have now separated the tests into an own plug-in with <packaging>eclipse-test-plugin</packaging>
but also with a Maven style folder structure, i.e. src/test/java
and src/test/xtend-gen
.
The fact is that still the testOutputDirectory setting is ignored and the Xtend sources are generated into src/main/xtend-gen
, which is the configuration for outputDirectory.
Only when I set outputDirectory to src/test/xtend-gen
are the sources generated into there.
So for me this clearly indicates that the configuration of testOutputDirectory is ignored and instead the configuration of outputDirectory is applied during Maven build in all cases.
The strange thing is that the configuration of testOutputDirectory is applied (only) during the Eclipse build.
in a normal non plugin usecase this works perfectly fine
for a plugin build setup check
for the rest someone needs to debug this. and i fear there is nobody who has the time to do it
it could e.g. be that the source are considered as src and not test-src
p.s.: did you double check you dont have any setting in the .settings/org.eclipse.xtend.core.prefs
@wzurborg could you push your latest config to a branch
.settings/org.eclipse.xtend.core.Xtend.prefs:
//outlet.DEFAULT_OUTPUT.sourceFolder.src/main/java.directory=src/main/xtend-gen
//outlet.DEFAULT_OUTPUT.sourceFolder.src/test/java.directory=src/test/xtend-gen
BuilderConfiguration.is_project_specific=true
eclipse.preferences.version=1
outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true
outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false
outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true
could you push your latest config to a branch
I would have to do the separation in my minimal example, which I have not done yet.
For me the workaround of setting outputDirectory in the test project is sufficient but I will try to debug further.
I am working on a Xtext/Xcore/Xtend/Maven/Tycho project. My problem is that the Xtend test classes are generated into the wrong directory during the Maven build. When the Xtend compiler is triggered by the workspace builder, the test sources are generated into the correct directory. This leads to duplicate test sources.
My Maven setup:
When run in Maven, the test sources are wrongly generated into src/main/xtend-gen; when run by the Eclipse builder, they are correctly generated into src/test/xtend-gen.