[Sculptor3] Generator workflow - Migrating Sculptor2 Xtext1-based workflow steps to Xtend2

363 views
Skip to first unread message

Torsten Juergeleit

unread,
Feb 12, 2013, 5:00:07 PM2/12/13
to fornax-...@googlegroups.com
After adding support for running xtend-based unit tests in the DSL test module of the prototyp https://github.com/tjuerge/sculptor-xtext2 I would like to continue with the generators MWE2 workflow.

Currently the generators MWE2 workflow isn't useful. It contains ony the first step - reading the model instance. The project contains an Eclipse launch configuration "SculptorGenerator.mwe2.launch" which runs the workflow with the model instance located in "src/test/resources/model-test.btdesign".

From the Sculptor2 workflow (defined in "Sculptorworkflow.mwe2") we need the following additional workflow steps:
  1. Validation of the DSL model (in Sculptor2 implemented with Check-based "SculptordslChecks.chk")
  2. Model transformation from DSL model to meta model (in Sculptor2 implemented with Xtend1-based "DslTransformation.ext")
  3. Model validation before transformation (in Sculptor2 implemented with Check-based "constraints.chk")
  4. Model transformation (in Sculptor2 implemented with Xtend1-based "Transformation.ext")
  5. Code generation (in Sculptor2 implemented with Xpand-based "Root.xpt")
For all of these workflow steps we have to provide an Xtend2-based (re-)implementation and a custom MWE2 workflow component (small wrapper needed to call the Xtend code from within a MWE2 workflow). 

Right now I have to learn Xtend2. So I've started to read the excellent documentation and code for the Xtext2-based submission to the Language Workbench Competition.

Is anyone already familar in migrating Xtend1 stuff (Check, Xtend, Xpand) to Xtend2?

Any volunteers in helping to migrate the above mentioned workflow steps? 

/Torsten

Ron Smith

unread,
Feb 14, 2013, 9:13:16 PM2/14/13
to fornax-...@googlegroups.com
I can give a crack at any of the XTend2 tasks.  I suppose we should start with the earlier steps - validation or M2M transformation.  I'll build the project and should be able to start this weekend.

Ron

Torsten Juergeleit

unread,
Feb 15, 2013, 5:40:25 AM2/15/13
to fornax-...@googlegroups.com
Excellent. Maybe you can have a look on migration the Check-based validations (e.g. "SculptordslChecks.chk") to Xtend2.
I didn't find any information on how to re-implement the Check stuff with Xtend2.

/Torsten

Pavel Tavoda

unread,
Feb 15, 2013, 7:58:33 AM2/15/13
to fornax-...@googlegroups.com
I'm working on templates transformation (XPand). I'm cracking through extensions at first. It's not easy but feasible and after we will decide how to transform code I will try try to create some semi automatic transformation from XPand to XTend.

Pavel

John Newman

unread,
Feb 15, 2013, 10:21:44 AM2/15/13
to fornax-...@googlegroups.com
Hey all, just wanted to check in ... I've been having fun at various airports due to work, it's been a very long few weeks..

I will have some good time this weekend to finish up pulling everything together and getting the "master" build ready on the master branch on github.  I started to merge Torsten's work in, about 30% done in 2 hours time, so I'd expect to have that all complete by Sunday.

The sculptor-generator project may not work, I may just leave that one mostly as-is and defer to you 3 to fill in these new pieces for it.  That was the one I was struggling with anyway.  I'll take a look at the other repos we have and make an effort to merge the work in.

Probably next week once the master branch is good, I'll create a blank VM and illicit all of the steps required to get the dev environment setup and rolling.  


-John

On Fri, Feb 15, 2013 at 7:58 AM, Pavel Tavoda <pavel....@gmail.com> wrote:
I'm working on templates transformation (XPand). I'm cracking through extensions at first. It's not easy but feasible and after we will decide how to transform code I will try try to create some semi automatic transformation from XPand to XTend.

Pavel

--
You received this message because you are subscribed to the Google Groups "Fornax-Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fornax-platfo...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Pavel Tavoda

unread,
Feb 15, 2013, 10:56:42 AM2/15/13
to fornax-...@googlegroups.com
First template. I converted 3 topmost 'methods' from Helper.ext and first template from DomainObjectProperties.xpt as sample. Attached are sources. Compare please with original files from generator. Is it OK for you? I will start to write this auto-conversion tool. If you feel we can write it different way please say as soon as possible.
I can't call getClass() in Helper.metaType implementation. In other example is OK. I don't know what's going on than I made ugly hack with JavaHelper.java.

Regards

Pavel
firstTemplate.zip

Torsten Juergeleit

unread,
Feb 17, 2013, 3:36:45 PM2/17/13
to fornax-...@googlegroups.com
The prototyp https://github.com/tjuerge/sculptor-xtext2 provides now a xtend-based validator SculptordslXtendValidator with the implementation of first two checks from Sculptor2 check-based SculptordslChecks.chk . For integration-testing this validator the framework xtext-utils is used.

Despite of fiddling around with Xtend2 to port the aforementioned checks I've no idea on the following topics:
  1. Xtend2 doesn't support the Xtend1 keyword "cached" anymore. So how can we implement the cached stuff from "ModelLoadExtension.ext" without sacrificing performance? Traversing the whole model to collect all elements within  every single validation doesn't scale well.
  2. How is Xtend1s reflection mechanism (e.g. 'x.metaType.getProperty("name")' -> found in "ModelLoadExtension.ext" as well) handled in Xtend2?
Any thoughts?
/Torsten

Torsten Juergeleit

unread,
Feb 17, 2013, 3:47:36 PM2/17/13
to fornax-...@googlegroups.com
I can't call getClass() in Helper.metaType implementation. In other example is OK. I don't know what's going on than I made ugly hack with JavaHelper.java.

Found here:

obj.getClass() 
 
:-) 
 
also  
 
obj.getClass  
 
and  
 
obj.^class 
(the '^' is required to escape identifiers conflicting with keywords)  
 
The reason why you didn't find it in the first place, is that content assist doesn't propose it. 
It's know bug and will be fixed soon. 


/Torsten

Pavel Tavoda

unread,
Feb 17, 2013, 6:27:38 PM2/17/13
to fornax-...@googlegroups.com
Yes, but editor in eclipse is showing me error. In other source code it's OK. Just at this place it's showing various errors depends if I use getClass(), getClass or ^class. I have to investigate further, maybe static declaration for method or something else is wrong.

Pavel Tavoda

unread,
Feb 18, 2013, 3:42:54 AM2/18/13
to fornax-...@googlegroups.com
It's even more funny. This is wrong:
def static Class<?> metaType(NamedElement ne) {
ne.getClass();
}
This is OK:
def static Class<?> metaType(NamedElement ne) {
(ne as Object).getClass();
}

Ron Smith

unread,
Feb 18, 2013, 11:04:45 PM2/18/13
to fornax-...@googlegroups.com
I'll look into the validators and translation of our check validations.

Thoughts on what the following build error might be?  I built the p2 repository mirror per instructions at https://github.com/tjuerge/sculptor-xtext2 on a different machine, then copied the mirror to my laptop.

When trying to build sculptor-parent via mvn install, I'm getting:

[INFO] Resolving dependencies of MavenProject: org.sculptor.eclipse:org.sculptor.dsl.ui:3.0.0-SNAPSHOT @ /usr/local/workingArea/tjuerge-sculptor-xtext2/sculptor-eclipse/org.sculptor.dsl.ui/pom.xml
[INFO] Resolving class path of MavenProject: org.sculptor.eclipse:org.sculptor.dsl.ui:3.0.0-SNAPSHOT @ /usr/local/workingArea/tjuerge-sculptor-xtext2/sculptor-eclipse/org.sculptor.dsl.ui/pom.xml
[INFO] Computing target platform for MavenProject: org.sculptor.eclipse:org.sculptor.dsl.tests:3.0.0-SNAPSHOT @ /usr/local/workingArea/tjuerge-sculptor-xtext2/sculptor-eclipse/org.sculptor.dsl.tests/pom.xml
[INFO] Resolving dependencies of MavenProject: org.sculptor.eclipse:org.sculptor.dsl.tests:3.0.0-SNAPSHOT @ /usr/local/workingArea/tjuerge-sculptor-xtext2/sculptor-eclipse/org.sculptor.dsl.tests/pom.xml
[INFO] Cannot complete the request.  Generating details.
[INFO] Cannot complete the request.  Generating details.
[INFO] {osgi.ws=cocoa, osgi.os=macosx, osgi.arch=x86_64, org.eclipse.update.install.features=true}
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: org.sculptor.dsl.tests 3.0.0.qualifier
[ERROR]   Missing requirement: org.sculptor.dsl.tests 3.0.0.qualifier requires 'bundle org.eclipselabs.xtext.utils.unittesting 0.0.0' but it could not be found
[ERROR]
[ERROR] Internal error: java.lang.RuntimeException: "No solution found because the problem is unsatisfiable.": ["Unable to satisfy dependency from org.eclipse.jdt.core 3.8.1.v_OTDT_r210_201206090452 to org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).", "Unable to satisfy dependency from org.eclipse.jdt.core 3.8.2.v_OTDT_r211_201209011847 to org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).", "Unable to satisfy dependency from org.sculptor.dsl.tests 3.0.0.qualifier to bundle org.eclipselabs.xtext.utils.unittesting 0.0.0.", "No solution found because the problem is unsatisfiable."] -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: "No solution found because the problem is unsatisfiable.": ["Unable to satisfy dependency from org.eclipse.jdt.core 3.8.1.v_OTDT_r210_201206090452 to org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).", "Unable to satisfy dependency from org.eclipse.jdt.core 3.8.2.v_OTDT_r211_201209011847 to org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).", "Unable to satisfy dependency from org.sculptor.dsl.tests 3.0.0.qualifier to bundle org.eclipselabs.xtext.utils.unittesting 0.0.0.", "No solution found because the problem is unsatisfiable."]
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:168)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
...
...


Thoughts?  Do I need to rebuild the p2 mirror on this machine?

My sculptor-eclipse/eclipse-mirror/.p2-mirror/plugins/ has lots of plugins, but not anything that begins with org.eclipselabs

Thanks
Ron

Torsten Juergeleit

unread,
Feb 19, 2013, 4:12:47 AM2/19/13
to fornax-...@googlegroups.com
Ups, I forgot to mention that due to a new Eclipse plugin dependency (the Xtext-Utils framework) and the corresponding new P2 repository the local P2 mirror has to be refreshed. To retrieve the new dependencies into the P2 mirror use "mvn -Pmirror initialize".

Relocating the local P2 mirror folder doesn't require any refresh. But "~/m2/settings.xml" needs an update :-)

/Torsten

Pavel Tavoda

unread,
Feb 19, 2013, 8:35:48 AM2/19/13
to fornax-...@googlegroups.com
When building metamodel from sculptor-parent or directly inside sculptor-metamodel with 'mvn install -Pshade' I get following error. I found that workflow file refer to names with big 'S' as Sculptormetamodel.genmodel however in my checkout I got file sculptormetamodel.genmodel with small caps. However when I change workflow file to refer to files with small 's' error remain.

Could you please also share .classpath and .project files?

Pavel

[INFO] ------------------------------------------------------------------------
[INFO] Building Sculptor :: Metamodel 3.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- tycho-packaging-plugin:0.16.0:build-qualifier (default-build-qualifier) @ sculptor-metamodel ---
[INFO] 
[INFO] --- tycho-packaging-plugin:0.16.0:validate-id (default-validate-id) @ sculptor-metamodel ---
[INFO] 
[INFO] --- tycho-packaging-plugin:0.16.0:validate-version (default-validate-version) @ sculptor-metamodel ---
[INFO] 
[INFO] --- fornax-oaw-m2-plugin:3.4.0:run-workflow (default) @ sculptor-metamodel ---
[INFO] Fornax Model Workflow Maven2 Plugin V3.4.0
[INFO] Executing workflow in forked mode.
[INFO] 0    INFO  StandaloneSetup    - Registering platform uri '/home/tavoda/Work/sculptor/sculptor-xtext2/sculptor-eclipse'
[ERROR] 381  ERROR Mwe2Launcher       - Problems running workflow sculptormetamodel.GenerateMetaModel: java.io.IOException: The path '/sculptor-metamodel/model/sculptormetamodel.genmodel' is unmapped
[INFO] java.lang.RuntimeException: Problems running workflow sculptormetamodel.GenerateMetaModel: java.io.IOException: The path '/sculptor-metamodel/model/sculptormetamodel.genmodel' is unmapped
[ERROR] at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:104)
[ERROR] at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
[ERROR] at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
[ERROR] at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
[ERROR] at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
[INFO] Caused by: org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: java.io.IOException: The path '/sculptor-metamodel/model/sculptormetamodel.genmodel' is unmapped
[ERROR] at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
[ERROR] at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
[ERROR] at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
[ERROR] at org.eclipse.emf.mwe2.ecore.EcoreGenerator.preInvoke(EcoreGenerator.java:74)
[ERROR] at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.preInvoke(AbstractCompositeWorkflowComponent.java:29)
[ERROR] at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:18)
[ERROR] at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
[INFO] ... 4 more
[INFO] Caused by: java.io.IOException: The path '/sculptor-metamodel/model/sculptormetamodel.genmodel' is unmapped
[ERROR] at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl.createInputStream(PlatformResourceURIHandlerImpl.java:492)
[ERROR] at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:354)
[ERROR] at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1256)
[ERROR] at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
[ERROR] at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
[INFO] ... 9 more
[ERROR] ExitStatusException occurred while running workflow: Java returned: 1

John Newman

unread,
Feb 19, 2013, 10:25:20 AM2/19/13
to fornax-...@googlegroups.com
I ran into that the other day,

model/GenerateMetaModel.mwe2
line 20 & 25, change lower s to upper S

model/sculptor[&gui]metamodel.genmodel
line 4, change modelName="lower s" to modelName="upper S"
line 7, change prefix="lower s" to prefix="upper S"

The master branch in the base repository has all of this code in there and building, but it's not quite ready for use.   Almost.   I think I just have to pull out the oaw-m2-plugin to somewhere else and have the version that the build uses already installed into the m2 repository somewhere, otherwise you have to cd into there and install it first.  :(    And I have to document..

I think we can use nexus with the p2 plugins instead of the eclipse-mirror, but we'd have to have a place to host it.  The mirror would still be an option on top of nexus to speed up local builds.  If there's a server we can host nexus on somewhere, I'd be happy to provide a zip file with it installed in jboss7 with all of the repositories already configured in there.

Is there any strong opposition to moving the project to jdk6?  Given that 5 was EOL back in 2009, I figured everyone would be on 6 by now. But it looks like Torsten was pretty clear to use 1.5 only, so if there's any strong opposition to moving to 1.6, please let me know and I can move everything back to 1.5.


-John



--

Torsten Juergeleit

unread,
Feb 19, 2013, 11:30:31 AM2/19/13
to fornax-...@googlegroups.com
Ups again, this seems to be a Mac OSX filesystem thing: HFS+ is a case preserving, case insensitive filesystem.
Windows NTFS doesn't care either. So this issue hits the Linux guys only :-P

John is right: The genmodel files have to be updated.

/Torsten

John Newman

unread,
Feb 19, 2013, 11:40:47 AM2/19/13
to fornax-...@googlegroups.com
Yep...  this also sort of raises the issue I've been seeing with "windows line endings" in many of the files.  I'd like to just do a big: 

find . -type f -exec dos2unix {} \+

which would get them out of there for the time being, but I'm concerned that the \r's would just return once someone on windows saves a file or creates a new one.  I'm not sure if there's a way for the devs using windows to set their tools to stick with unix line endings or not.. it depends on the tool, eclipse should be smart enough to stick with \n only I would think.  

Anyway .. that's a very minor issue for later on .. there's other code style issues, formatting, spaces vs tabs, etc, I'll have to vet with you guys first and we can probably check the eclipse formatter settings in with the project.  :)

Cheers,
John


--

Torsten Juergeleit

unread,
Feb 19, 2013, 11:59:12 AM2/19/13
to fornax-...@googlegroups.com

I think we can use nexus with the p2 plugins instead of the eclipse-mirror, but we'd have to have a place to host it.  The mirror would still be an option on top of nexus to speed up local builds.  If there's a server we can host nexus on somewhere, I'd be happy to provide a zip file with it installed in jboss7 with all of the repositories already configured in there.

I fiddled around Nexus OSS with the p2 plugins. But I wasn't satisfied with this solution:
Nexus p2 support is slow and demands a lot of heap memory. During synchronisation of a target p2 repository the corresponding Nexus repository isn't responding. If a target p2 repository is responding slow (and many of the Eclipse mirror repositories are slow) then Nexus is slow as well. And the Nexus logs are not providing any information why Nexus isn't responding. One has to enable debug logging of the httpd-client library to get an indication of which target p2 respository is accessed and how long it takes to retrieve the requested information.

So I ended up with a local p2 mirror which is static (no automatic plugin updates) but has a predictable response time.


Is there any strong opposition to moving the project to jdk6?  Given that 5 was EOL back in 2009, I figured everyone would be on 6 by now. But it looks like Torsten was pretty clear to use 1.5 only, so if there's any strong opposition to moving to 1.6, please let me know and I can move everything back to 1.5.

I've no problem moving to Java 6 or Java 7. Btw. Java 6s End of Public Updates is end of this month.
It depends on the users Sculptor is intended for. They need to be able to run the required Java version.
I'm not sure if the enterprise guys are always running the latest 'n greatest Java gear.

/Torsten

Pavel Tavoda

unread,
Feb 19, 2013, 12:19:03 PM2/19/13
to fornax-...@googlegroups.com
I'm preparing now this XPand and Ext transformation. I'm ready with helper.ext and properties.ext. I converted all files to use TABs instead of SPACEs. Everybody can set his own preferred indentation. Can we use this as standard?

Pavel

Pavel Tavoda

unread,
Feb 19, 2013, 12:31:57 PM2/19/13
to fornax-...@googlegroups.com
On Tuesday, February 19, 2013 5:59:12 PM UTC+1, Torsten Juergeleit wrote:

I think we can use nexus with the p2 plugins instead of the eclipse-mirror, but we'd have to have a place to host it.  The mirror would still be an option on top of nexus to speed up local builds.  If there's a server we can host nexus on somewhere, I'd be happy to provide a zip file with it installed in jboss7 with all of the repositories already configured in there.

I fiddled around Nexus OSS with the p2 plugins. But I wasn't satisfied with this solution:
Nexus p2 support is slow and demands a lot of heap memory. During synchronisation of a target p2 repository the corresponding Nexus repository isn't responding. If a target p2 repository is responding slow (and many of the Eclipse mirror repositories are slow) then Nexus is slow as well. And the Nexus logs are not providing any information why Nexus isn't responding. One has to enable debug logging of the httpd-client library to get an indication of which target p2 respository is accessed and how long it takes to retrieve the requested information.

So I ended up with a local p2 mirror which is static (no automatic plugin updates) but has a predictable response time.

I'm fine with local mirror till it's not requirement for sculptor-generator and sculptor-framework. For building Eclipse plugin it's fine. BTW we are using inhouse Artifactory which is pretty fast. Also runtime dependency from metamodel on ecore isn't big deal. Or am I missing something?



Is there any strong opposition to moving the project to jdk6?  Given that 5 was EOL back in 2009, I figured everyone would be on 6 by now. But it looks like Torsten was pretty clear to use 1.5 only, so if there's any strong opposition to moving to 1.6, please let me know and I can move everything back to 1.5.

I've no problem moving to Java 6 or Java 7. Btw. Java 6s End of Public Updates is end of this month.
It depends on the users Sculptor is intended for. They need to be able to run the required Java version.
I'm not sure if the enterprise guys are always running the latest 'n greatest Java gear.

Yes we should switch to Java 6. Java 7 is still new and not used very often. If somebody want 1.5 we have older Sculptor versions.

Pavel

Torsten Juergeleit

unread,
Feb 19, 2013, 7:28:47 PM2/19/13
to fornax-...@googlegroups.com
The prototyp https://github.com/tjuerge/sculptor-xtext2 provides now a MWE2 workflow component which validates the DSL model. This workflow component is added to the generators workflow.

So running the "shaded" generator (mvn -Pshade install) with an invalid model fails with the corresponding validation errors: 

java -jar target/sculptor-generator-3.0.0-SNAPSHOT.jar src/test/resources/model-test.btdesign 
ERROR:Duplicate name.  There is already an existing Domain Object named 'Test1'. (src/test/resources/model-test.btdesign line : 5)
ERROR:Duplicate name.  There is already an existing Domain Object named 'Test1'. (src/test/resources/model-test.btdesign line : 8)

/Torsten 

Rade, Joerg / Kuehne + Nagel / Ham GI-AS

unread,
Feb 19, 2013, 3:23:48 AM2/19/13
to fornax-...@googlegroups.com
Hi,
 
what does MANIFEST.MF contain?
 
What does bnd (http://bndtools.org/) show?
 
Jörg

Von: fornax-...@googlegroups.com [mailto:fornax-...@googlegroups.com] Im Auftrag von Ron Smith
Gesendet: Dienstag, 19. Februar 2013 05:05
An: fornax-...@googlegroups.com
Betreff: Re: [Sculptor3] Generator workflow - Migrating Sculptor2 Xtext1-based workflow steps to Xtend2

--
You received this message because you are subscribed to the Google Groups "Fornax-Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fornax-platfo...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


Kühne + Nagel (AG & Co.) KG, Geschäftsleitung: Hans-Georg Brinkmann (Vors.), Dirk Blesius, Reiner Heiken, Holger Ketz (Stellv.), Jan-Hendrik Köstergarten (Stellv.), Bruno Mang, Christian Marnetté, Jens Wollesen, Sitz: Bremen, Registergericht: Bremen, HRA 21928, USt-IdNr.: DE 812773878, Persönlich haftende Gesellschaft: Kühne & Nagel A.G., Sitz: Contern/Luxemburg Geschäftsführender Verwaltungsrat: Karl Gernandt

Pavel Tavoda

unread,
Feb 20, 2013, 8:06:49 AM2/20/13
to fornax-...@googlegroups.com
1) 'cached' will be problem. We can annotate methods with @Cache annotation and then develop around advice for caching and try to apply it via Guice.
2) you can do everything what Java allow only with shorter syntax. If it's feasible with refrection than you can mirror same behavior it in XTend2.

Pavel

Ron Smith

unread,
Feb 20, 2013, 9:09:33 PM2/20/13
to fornax-...@googlegroups.com
Along those lines, another possibility is to use the active annotations feature, slated for March release (http://blog.efftinge.de/2012/10/introducing-active-annotations.html).

Ron Smith

unread,
Feb 20, 2013, 10:46:42 PM2/20/13
to fornax-...@googlegroups.com
I updated from the latest in github, and tried 'mvn initialize -Pmirror' in sculptor-parent, but am getting the following error.  Do I need to trigger an update differently?



[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: org.sculptor.dsl.tests 3.0.0.qualifier
[ERROR]   Missing requirement: org.sculptor.dsl.tests 3.0.0.qualifier requires 'bundle org.eclipselabs.xtext.utils.unittesting 0.0.0' but it could not be found
[ERROR]
[ERROR] Internal error: java.lang.RuntimeException: "No solution found because the problem is unsatisfiable.": ["Unable to satisfy dependency from org.eclipse.jdt.core 3.8.1.v_OTDT_r210_201206090452 to org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).", "Unable to satisfy dependency from org.eclipse.jdt.core 3.8.2.v_OTDT_r211_201209011847 to org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).", "Unable to satisfy dependency from org.sculptor.dsl.tests 3.0.0.qualifier to bundle org.eclipselabs.xtext.utils.unittesting 0.0.0.", "No solution found because the problem is unsatisfiable."] -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: "No solution found because the problem is unsatisfiable.": ["Unable to satisfy dependency from org.eclipse.jdt.core 3.8.1.v_OTDT_r210_201206090452 to org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).", "Unable to satisfy dependency from org.eclipse.jdt.core 3.8.2.v_OTDT_r211_201209011847 to org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).", "Unable to satisfy dependency from org.sculptor.dsl.tests 3.0.0.qualifier to bundle org.eclipselabs.xtext.utils.unittesting 0.0.0.", "No solution found because the problem is unsatisfiable."]

Thanks
Ron

Pavel Tavoda

unread,
Feb 21, 2013, 3:55:38 AM2/21/13
to fornax-...@googlegroups.com
Yes, definitely way to go (at least try). I will make @Cached annotation right now and use it for extension methods.
Than we can use it for dynamic annotations or Guice + advice.

Great feature, thank for pointing out

Pavel

Torsten Juergeleit

unread,
Feb 21, 2013, 8:26:33 AM2/21/13
to fornax-...@googlegroups.com
The corresponding bugzilla ticket and recommandations regarding active annotations can be found here.

/Torsten

Torsten Juergeleit

unread,
Feb 21, 2013, 8:45:04 AM2/21/13
to fornax-...@googlegroups.com
I updated from the latest in github, and tried 'mvn initialize -Pmirror' in sculptor-parent, but am getting the following error. Do I need to trigger an update differently?

No, using the corresponding profile and minimum Maven lifecycle phase should to the trick.

You have to make sure that the local p2 mirror referenced in "~/.m2/settings.xml" contains the feature/plugins of "org.eclipselabs.xtext.utils.unittesting" (Xtext-Utils Framework). The mirroring of certain public p2 repositories (including the p2 repository of xtext-utils) is defined in the POM of the module "eclipse-mirror" in the profile "mirror".

After running "mvn initialize -Pmirror" (any Maven lifecycle phase later or equal to "initialize" will do) you should end up with the feature and plugins of Xtext-Utils in your local p2 mirror.

Then valdiate that "~/.m2/settings.xml" references the aforementioned local p2 mirror.


As a last resort try running a "full build" from "sculptor-parent" via:

mvn clean
mvn install -Pmirror,shade

/Torsten

Pavel Tavoda

unread,
Feb 21, 2013, 11:30:28 AM2/21/13
to fornax-...@googlegroups.com
I run into same issue. First investigation is showing some strange content in artifacts.jar and content.jar. Packages are mentioned there but not available on filesystem. When I run 'mvn insta...' it simply say that package is already available. I will investigate further but I'm not brave enough to run 'mvn clean' 3.3 GB is too much to loose ;-).

Pavel

Torsten Juergeleit

unread,
Feb 21, 2013, 12:12:32 PM2/21/13
to fornax-...@googlegroups.com
I will investigate further but I'm not brave enough to run 'mvn clean' 3.3 GB is too much to loose ;-).

The local p2 repository in "eclipse-repository" is not located in "target/" and therefore not deleted on "mvn clean". To get rid of the directory "eclipse-repository/.p2-mirror/" (and its 3+GB) you have to delete it manually.

My understanding of Tychos p2-extras-plugin (and its goal "mirror") is that it copies all the stuff (installable units with their artifacts) from remote p2 repositories into a single local one. I don't know what happens if the remote stuff is invalid or the repository synchronization is interrupted.

/Torsten

Pavel Tavoda

unread,
Feb 21, 2013, 12:23:44 PM2/21/13
to fornax-...@googlegroups.com
After 'mvn clean install' mirror is OK. Problem remain. It's some dependency.

Torsten Juergeleit

unread,
Feb 21, 2013, 12:32:42 PM2/21/13
to fornax-...@googlegroups.com
Running "clean" and "install" together via "mvn clean install" will not work because "clean" and "install" are called for every Maven module one-by-one. This will "clean" the generated code in the UI and test modules which have been previously generated by "install" in the corresponding DSL module.

So "mvn clean" and "mvn install" should be started separately.

/Torsten

John Newman

unread,
Feb 21, 2013, 1:41:51 PM2/21/13
to fornax-...@googlegroups.com
I ran into that the other day, and the way you hooked into the clean plugin in the parent project is not correct, the hook needs moved to the dsl project to also clean the ui and test projects since that one dumps generated into those modules.


that's the correct setup for the clean plugin.  mvn clean install works on that aggegator. (i'm going to remove the build helper stuff as the pde nature drives that through build.properties instea .. i didn't have that at one point originally)




--

Torsten Juergeleit

unread,
Feb 21, 2013, 3:20:37 PM2/21/13
to fornax-...@googlegroups.com
You're right. The spray guys using it in their project the same way.

/Torsten

Ron Smith

unread,
Feb 21, 2013, 8:57:53 PM2/21/13
to fornax-...@googlegroups.com
Still having build issues..

Getting my working copy to update with the missing dependencies wasn't working, so I went for restarting from scratch.

I used fresh checkout from https://github.com/tjuerge/sculptor-xtext2.git, commented out the mirror setting in settings.xml, and ran 'mvn initialize -Pmirror' from sculptor-parent.
I'm still getting the same error, this time when trying to initialize.

In the error, is it suspicious that the unittesting bundle version is 0.0.0?

 
"Unable to satisfy dependency from org.sculptor.dsl.tests 3.0.0.qualifier to bundle org.eclipselabs.xtext.utils.unittesting 0.0.0.", "No solution found because the problem is unsatisfiable."]


I'm dead in the water right now.  Is there another setup I can use to move forward with converting Sculptor code to XTend2?

Ron
 

Pavel Tavoda

unread,
Feb 22, 2013, 2:29:10 AM2/22/13
to fornax-...@googlegroups.com
I commented out this unittesting from dependencies (sculptor-eclipse/org.sculptor.dsl.tests/META-INF/MANIFEST.MF). Whole this org.sculptor.dst.tests is test package, you can remove it from sculptor-parent totally.

Pavel

Torsten Juergeleit

unread,
Feb 22, 2013, 4:53:41 AM2/22/13
to fornax-...@googlegroups.com
As Pavel suggested, remove the test module from the module list in the sculptor eclipse aggregator POM.

I'll have to investigate this issue.

/Torsten

Ron Smith

unread,
Feb 22, 2013, 9:42:26 AM2/22/13
to fornax-...@googlegroups.com
That did the trick, thanks.

John Newman

unread,
Feb 22, 2013, 10:44:15 AM2/22/13
to fornax-...@googlegroups.com
Has anyone considered Eclipse Acceleo for the generator module?

It was one item I had a thumb tack in go look at once I got the deps for the project sorted out.  So far it looks pretty straight forward:  have the metamodel URI registered in eclipse, have a .btdesign file, have a series of .mpt templates and .java code to support the structure of them, run it, code is output.  It looks like it could be something to consider.  We'd just have to translate the xpand templates to mpt (there may even be a script for this), and workout a mojo for it.  (which is sounds like we're going to have a similar effort anyway)

Just wondering if anyone's heard of this as it was something i stumbled into fairly recently, and if so, what your thoughts would be to using it instead of xpand in sculptor-generator?





--

John Newman

unread,
Feb 22, 2013, 10:45:42 AM2/22/13
to fornax-...@googlegroups.com
That all builds and tests well in the base.git, there must be some difference.  When I get home I'll investigate.

--

Pavel Tavoda

unread,
Feb 22, 2013, 10:58:55 AM2/22/13
to fornax-...@googlegroups.com
I guess it will be very difficult, because of defaulting and customization you can make in DSL language. That's because we keep M2M transformation as additional steps with many checks. Then from this model we produce many artifacts. Generation is very complex process which will be very difficult to do in Acceleo. I guess it's for simpler models and transformations. But it's just my feeling and what I know about Acceleo.

Pavel

Torsten Juergeleit

unread,
Feb 22, 2013, 4:56:18 PM2/22/13
to fornax-...@googlegroups.com
Oh, this issue was a bad one :-(

I missed that p2 repositories have to be added twice: One for Mavens repository tag and the other for the Tycho mirroring configuration. The first one was missing :-(

Don't forget to add the repository id of the missing p2 repository to the mirrorof list in your settings.xml:

      <mirrorOf>p2.eclipse,p2.eclipse.xtext,p2.xtext-utils</mirrorOf>

Fix committed

/Torsten

Ron Smith

unread,
Feb 23, 2013, 12:20:05 AM2/23/13
to fornax-...@googlegroups.com
I'm trying out the base.git repo (https://github.com/sculptor/base) as I ran into the problem with the sculptormetamodel.genmodel case sensitivity issue, and wasn't having luck fixing it.  This is on a Mac.

John,
What are the steps for building from scratch from base.git?  I'm working off the latest of the master branch.
I copied the p2 mirror build from Torsten's repo over to sculptor-eclipse/sculptor-eclipse-mirror/.p2-mirror.
Ran 'mvn -Pmirror initialize' successfully in sculptor-eclipse-mirror to update p2 mirror.

But when I try 'mvn clean install' in the root, or in sculptor-eclipse, I get the following error (output with -X maven option):

[DEBUG] Verifying availability of /Users/ron/.m2/repository/org/eclipse/xtend/xtend-maven-plugin/2.3.1/xtend-maven-plugin-2.3.1.pom from [public.fornax-platform.org (http://fornax-platform.org/nexus/c
ontent/groups/public/, releases), central (http://repo1.maven.org/maven2, releases)]
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://fornax-platform.org/nexus/content/groups/public/
Downloading: http://fornax-platform.org/nexus/content/groups/public/org/eclipse/xtend/xtend-maven-plugin/2.3.1/xtend-maven-plugin-2.3.1.pom
^M[DEBUG] Reading resolution tracking file /Users/ron/.m2/repository/org/eclipse/xtend/xtend-maven-plugin/2.3.1/xtend-maven-plugin-2.3.1.pom.lastUpdated
[DEBUG] Writing resolution tracking file /Users/ron/.m2/repository/org/eclipse/xtend/xtend-maven-plugin/2.3.1/xtend-maven-plugin-2.3.1.pom.lastUpdated
[DEBUG] Skipped remote update check for org.eclipse.xtend:xtend-maven-plugin:pom:2.3.1, locally cached artifact up-to-date.
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://repo1.maven.org/maven2
Downloading: http://repo1.maven.org/maven2/org/eclipse/xtend/xtend-maven-plugin/2.3.1/xtend-maven-plugin-2.3.1.pom
^M[DEBUG] Reading resolution tracking file /Users/ron/.m2/repository/org/eclipse/xtend/xtend-maven-plugin/2.3.1/xtend-maven-plugin-2.3.1.pom.lastUpdated
[DEBUG] Writing resolution tracking file /Users/ron/.m2/repository/org/eclipse/xtend/xtend-maven-plugin/2.3.1/xtend-maven-plugin-2.3.1.pom.lastUpdated
[WARNING] The POM for org.eclipse.xtend:xtend-maven-plugin:jar:2.3.1 is missing, no dependency information available
[ERROR] Internal error: java.lang.RuntimeException: org.apache.maven.MavenExecutionException: Could not setup plugin ClassRealm: Plugin org.eclipse.xtend:xtend-maven-plugin:2.3.1 or one of its depende
ncies could not be resolved: Failed to read artifact descriptor for org.eclipse.xtend:xtend-maven-plugin:jar:2.3.1: Could not find artifact org.eclipse.xtend:xtend-maven-plugin:pom:2.3.1 in public.for
nax-platform.org (http://fornax-platform.org/nexus/content/groups/public/) -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: org.apache.maven.MavenExecutionException: Could not setup plugin ClassRealm
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:168)
...
...

Here's what my mirror setting looks like (updated after Torsten's message on the missing entry):
<mirror>
    <!--This sends request to p2 repositories to local mirror -->
    <id>mirror</id>
    <mirrorOf>p2.eclipse,p2.eclipse.xtext,p2.xtext-utils</mirrorOf>
    <url>file:///usr/local/workingArea/sculptor-base-xtext2/sculptor-eclipse/sculptor-eclipse-mirror/.p2-mirror</url>
    <layout>p2</layout>
    <mirrorOfLayouts>p2</mirrorOfLayouts>
</mirror>

I do have xtend-maven-plugin-2.3.1.pom in my local Maven repo, and the POM and corresponding jar file looks good.

Thoughts on what else to try?

Thanks
Ron

John Newman

unread,
Feb 23, 2013, 2:47:19 AM2/23/13
to fornax-...@googlegroups.com
At this point it's tied to a (..my) nexus repository.  There's deliberately no repositories configured in any of the poms, so the local mirror probably won't get anywhere.   If you dig through the parent pom you'll see I do have it in there for now under distribution mgmt (I shouldn't have checked that in ... but it happened..)

I probably should also check-in the ~/.m2/settings.xml file into there, which sets up the public m2 repo proxy collection to mirror "*!p2", and the public p2 proxy collection to mirror "p2".   It pretty much looks like http://www.sonatype.com/books/nexus-book/reference/maven-sect-single-group.html just with the extra routing for p2.

Once the build runs to completion the first time, the subset of eclipse artifacts actually used are cached in the nexus-data, and likewise in your local repo, so for the most part build speed isn't an issue.  It does take a bit to initally resolve the dependencies which I believe can be improved. I have also had to enable some scheduled tasks in nexus to "rebuild p2 repository" and "rebuild p2 metadata" as was described somewhere, as without those in place I believe there is a BUG within nexus which causes the build to pause forever.  Once that was added it's been pretty sweet.

So, I could
A) Try to find a place on the internet to host it .. I will look for somewhere
B) Do something sneaky and use a machine at work (eh .. I really shouldn't and probably couldn't ...  :-D 
C) Put it on my laptop downstairs which is always on and use no-ip.org  (I'd be ok with this for a very short term .. no hacking please)
D) Share the kvm image of the entire machine
E) Share a zip file containing some set of the jboss / nexus app + built p2 plugins / nexus config   .. 
F) Explain how I built everything from github and share the repository listings, you set it up as you need.

If you want to test it out, let me know what would work best between A and F and I'll see what I can do.  Or any other suggestions...

-John

Torsten Juergeleit

unread,
Feb 23, 2013, 5:58:02 AM2/23/13
to fornax-...@googlegroups.com
I'm running a local Nexus instance for proxying Maven artifacts as well. But IMHO using a local proxy should be an option not an requirement. Every developer should decide using a proxy or using the target repositories. Maybe these guys are not only developing for Sculptor but doing some other OSS stuff as well :-)

Yes, we should document how to configure the local proxy and the Maven settings.xml to use the proxy for retrieving sculptors dependencies.

Just my 2 cents
/Torsten
Reply all
Reply to author
Forward
0 new messages