Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XtextGradlePlugin configuration problem
XtextGradlePlugin configuration problem [message #1755067] Mon, 27 February 2017 18:30 Go to next message
Nicolas Rouquette is currently offline Nicolas RouquetteFriend
Messages: 36
Registered: December 2014
Member
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 #1755070 is a reply to message #1755067] Mon, 27 February 2017 18:53 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 11206
Registered: July 2009
Senior Member
questions on the plugin are best asked as github issue on the plugin itself.
(stefan, the author, does not read here)

unfortunelty your code is blown up way to much to do a reasonable analysis.

=> an example that does build the language only and not all the other stuff would be really helpful.

what strikes me is that you use a stoneage old version of the xtext/idea* gradle plugin. i dont know if this plays a role.
in the log i see that xtext 2.9 stuff is downloaded etc


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Re: XtextGradlePlugin configuration problem [message #1755072 is a reply to message #1755070] Mon, 27 February 2017 19:07 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 11206
Registered: July 2009
Senior Member
p.s. are you sure travis does not cache anything regarding the target platform.
=> it would be interesting to see the classpath the gradle plugin is started with


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Re: XtextGradlePlugin configuration problem [message #1755073 is a reply to message #1755072] Mon, 27 February 2017 19:09 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 11206
Registered: July 2009
Senior Member
(in my log i see ### Downloading non-mavenized platform , in yours not)

Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Re: XtextGradlePlugin configuration problem [message #1755075 is a reply to message #1755073] Mon, 27 February 2017 19:37 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 11206
Registered: July 2009
Senior Member
you might do something like this to print the compile classpath

task lala {
    doLast {
        configurations.compile.each { println it }
    }
}


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Re: XtextGradlePlugin configuration problem [message #1755078 is a reply to message #1755075] Mon, 27 February 2017 20:16 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 11206
Registered: July 2009
Senior Member
https://travis-ci.org/cdietrich/jpl.imce.oml.specification.parent looks promising.
error is at sbt.
change is here https://github.com/cdietrich/jpl.imce.oml.specification.parent/commit/a02a6c1e5bb84472d75bbbb9f1f2433a33d2e721


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Re: XtextGradlePlugin configuration problem [message #1755086 is a reply to message #1755078] Tue, 28 February 2017 00:41 Go to previous messageGo to next message
Nicolas Rouquette is currently offline Nicolas RouquetteFriend
Messages: 36
Registered: December 2014
Member
Thanks Christian for taking the time to look into my problem!

I copied my setup from the itemis-blog example: https://github.com/itemis/itemis-blog/tree/xcore_gradle (branch xcore_gradle).

As far as the version of the plugins; I didn't realize that both the xtext-gradle & xtext-idea plugins have the same version.
I am interested in exploring support for intellij idea so I kept the original configuration as is.

I'll try switching xtext-idea-gradle-plugin to 1.0.17 like you and show the classpath; i'd be nice if that worked on linux & macosx.

It took me a while to figure out that my problems seem to be related to the xtext-gradle-plugin.
There were several other confounding factors took me way more time than I thought going on.

I had turned on caching in travis thinking that it would save me time when the target platform doesn't change.
I'll try to delete the cache.

- Nicolas.
Re: XtextGradlePlugin configuration problem [message #1755096 is a reply to message #1755086] Tue, 28 February 2017 06:38 Go to previous message
Nicolas Rouquette is currently offline Nicolas RouquetteFriend
Messages: 36
Registered: December 2014
Member
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.
Previous Topic:How to integrating OCL types in Xtext grammar
Next Topic:Two DSL, single project, Activator&injector issues
Goto Forum:
  


Current Time: Tue Sep 26 03:56:14 GMT 2017

Powered by FUDForum. Page generated in 0.06326 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software