XtextGradlePlugin configuration problem [message #1755067] |
Mon, 27 February 2017 13:30  |
Eclipse User |
|
|
|
Unfortunately, I posted my question on the EMF forum:
https://www.eclipse.org/forums/index.php/t/1084665/
I managed to replicate the Xtext validation error by building on a linux box.
Comparing the differences with my local environment (macos), I see that there are some differences:
- on macosx, all the generated sources are in the build folder per the gradle settings:
sourceSets {
main {
java.srcDirs = ['src', 'build/xcore/main/']
resources.srcDirs = ['model']
xtendOutputDir = 'build/xcore/main/'
resources {
exclude '**/*.xcore'
}
}
test {
java.srcDirs = []
resources.srcDirs = []
}
}
on linux, some generated sources are in the "default" locations (src-gen, xtend-gen).
Looking at the doc (http://xtext.github.io/xtext-gradle-plugin/xtext-builder.html), I've been wondering whether I need something along the lines of the example:
sourceSets {
main {
//you can add additional folders that are not Java source folders here
srcDir 'src/main/heroes'
output {
//adjust output directories per sourceSet and outlet
//the syntax for this will improve in future releases
//default here would be 'build/herolang/heroes/main'
dir(xtext.languages.herolang.HEROES, 'build/someSpecialDir')
}
}
}
I tried this but it doesn't work anymore with gradle 3.4 because output is read-only.
So, how do we configure non-default output directories for generated files for Xcore, Xtext and Xtend?
- Nicolas.
|
|
|
|
|
|
|
|
|
Re: XtextGradlePlugin configuration problem [message #1755096 is a reply to message #1755086] |
Tue, 28 February 2017 01:38  |
Eclipse User |
|
|
|
I tried both of your suggestions; one after the other.
1) bump the version of the xtext-idea-gradle-plugin from 1.0.2 => 1.0.17; not enough.
2) disable caching the Eclipse target platform that is assembled & mavenized by a copy of the Eclipse Buildship scripts; that was enough!
The sbt error you got was due to the fact that I forgot to set "language: scala" in the .travis.yml -- this is necessary for using both gradle & sbt in the same job.
The xtext 2.9 versions you saw where due to the dependencies from the xtext-gradle-plugin, version 1.0.17.--
All my Xcore/Xtext/Xtend code uses xtext 2.11.
So far, all the non-UI related components generate & build properly; thank you again for your constructive comments!
I left the generation of the UI-related plugins/code off -- Ed Merks suspect that there is a difference in the XcoreGenerator & GenModel
that is responsible for problems running the Xcore generator outside of eclipse when the GenModel part of it needs to write a file (e.g. plugin.xml, plugin.properties, ...).
(see: https://www.eclipse.org/forums/index.php?t=msg&th=1084555&goto=1754620&#msg_1754620).
Following his advice, I managed to avoid this problem by splitting my DSL into several parts; each small enough so that there is no need for the GenModel generator to save an *.ecore file
which would be needed if the EPackage initialization logic were to exceed the 64k limit for jvm functions.
Now that I have a working build (see: https://travis-ci.org/JPL-IMCE/jpl.imce.oml.specification.parent/builds/206073721), I'll revisit these topics later.
- Nicolas.
|
|
|
Powered by
FUDForum. Page generated in 0.13951 seconds