| Summary: | [Xtend] support standalone compilation of Xtend files | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Sven Efftinge <sven.efftinge> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | alex.blewitt, ama, christian.dietrich.opensource, christophkulla, clay, iloncar.ml, jerome.benois, jos.warmer, kowalczyk.krzysztof, mail, refsdal.ivar, schauer, sebastian.zarnekow, stevemash |
| Version: | 2.0.0 | Flags: | sebastian.zarnekow:
juno+
|
| Target Milestone: | M4 | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
Sven Efftinge
I would rate this as High priority, because the lack of this functionality make it impossible to use Xtend2 in a continuous integration environment, and hence very hard to use effectively in a professional software development environment. I would rate this as High priority too It should work in a headless build already. It is unlikely that we are able to solve this without using JDT. The problem we'll have to solve is, that some Xtend class might depend on a Java class and that Java class again might reference the Xtend class. This chicken-and-egg problem prevents us from first compiling the Java resources and then the Xtend classes (or vice versa). We need to somehow create a symbol table for everything up front and use that symbol table in to compile Xtend and then Java. JDT provides us with all we need. We'll look into this soon but it would be extremely helpful if someone could dig into running a build using a headless eclipse in the meantime to check whether it would be a viable option. We are working on a solution which doesn't require a headless eclipse build or something similar. It's going to work in any vanilla Java process that includes standard maven or ant builds. Sven when you say "standard maven build" does this mean enhancing xtext generation to support the standard maven source folder layout: src/main/java compiles to target/classes src/test/java compiles to target/test-classes I think I would still want my .xtend files in src/main/java and src/test/java but perhaps the generated java files go in src/main/xtend-gen and src/test/xtend-gen. This would end up with src/main/java generating xtend java source to src/main/xtend-gen which compiles to target/classes and src/test/java generating xtend java source to src/test/xtend-gen which compiles to target/test-classes Then I can still put xtend and java code side by side in both production code and test code and still produce the standard maven jar and test-jar artifacts. Exactly that's the idea. :-) first shot pushed to master -> see http://git.eclipse.org/c/tmf/org.eclipse.xtext.git/commit/?id=cc5cff9c40e5defb5bd5dccd56e92b075ecd2ff2 todo: 1. fix incorrect dependency version in generated xtext 2.1.1 maven artefact e.g. see http://maven.eclipse.org/nexus/content/repositories/xtext-proxy/org/eclipse/xtext/org.eclipse.xtext.xtend2/2.1.1.v201111141332/org.eclipse.xtext.xtend2-2.1.1.v201111141332.pom [WARNING] The POM for org.eclipse.xtext:org.eclipse.xtext.common.types:jar:2.0.0 is missing, no dependency information available [WARNING] The POM for org.eclipse.xtext:org.eclipse.xtext.xbase:jar:2.0.0 is missing, no dependency information available ..... 2. deploy and CI missing artefacts into maven repo @eclipse - org.eclipse.xtend2.lib - org.eclipse.xtext.xtend2.standalone - org.eclipse.xtext.xtend2.maven @Michael: Thanks for the great job! I think we can close the ticket now. what about the missing m2e integration i.e. 'M2E plugin execution not covered ...' explained here http://wiki.eclipse.org/M2E_plugin_execution_not_covered (In reply to comment #8) > @Michael: Thanks for the great job! I think we can close the ticket now. (In reply to comment #9) > what about the missing m2e integration i.e. 'M2E plugin execution not covered > ...' > explained here http://wiki.eclipse.org/M2E_plugin_execution_not_covered > > (In reply to comment #8) > > @Michael: Thanks for the great job! I think we can close the ticket now. A Null-implementation would be sufficient since our builder takes care of the actual work. I still stumble over org.eclipse.xtext.xtend2.validation.ClasspathBasedChecks.checkFileNamingConventions(XtendFile) when using the Main in xtend2.standalone. this leads to the error The declared package 'test' does not match the expected package if the xtend files dont reside i a folder that is called bin btw this does not happen if i call the stuff from ant Just found out that the xtend folder should not be a source folder - at least at the place where you call the Main class, otherwise the .xtend file will be found in the bin folder too which leads to the error - sorry for the noise this has been fixed for 2.2 Any one know how to use it with ant build? with the xtext project we have src and src-gen source folder, but Xtend2BatchCompiler seems only accept on source folder, I build it with the following target but fail with many errors:
<target name="xtend-gen" description="Generate xtend file to java files">
<path id="classpath">
<fileset dir=".">
<include name="src/**/*.java"/>
<include name="src-gen/**/*.java"/>
</fileset>
<path refid="lib.path.id"></path>
</path>
<pathconvert property="classpaths" refid="classpath" pathsep="${path.separator}"/>
<java classname="org.eclipse.xtext.xtend2.compiler.batch.Main" classpathref="lib.path.id" >
<arg line="-d xtend-gen"/>
<arg line="-cp"/>
<arg line="${classpaths}"/>
<arg value="src"/>
</java>
</target>
So you generate Xtend code into src-gen? I filed a bugzilla for supporting multiple source folders : Bug 367914 No, I want to generate the xtend file to java file into folder xtend-gen at the same level with src-gen, it is the same as in eclipse IDE, I mean for a xtext project. You only need to configure the source folder containing Xtend sources. Yes, my xtend files are all only in the sub folders of "src" folder, I added both src and src-gen, and all the necessary jars to the class path, still have errors, do you think I make the wrong configuration? Requested via bug 522520. -M. Requested via bug 522520. -M. |