Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » can't generate file in another project
can't generate file in another project [message #22733] Tue, 14 July 2009 11:35 Go to next message
St is currently offline StFriend
Messages: 77
Registered: July 2009
Member
Hi,

I'm trying to generate files in another eclipse project.

I have two projects, one named "meta-modeling-tools"(1), the other named
"sfDoctrine-1.1.2"(2).

In the first there is an egl program, in the second, there is an ecore
model.

I have coded an egl program that create a basic directory structure for
all epackages and eclasses inside the ecore model to create "places" where
to put "epsilon" programs (wizards, etc) and such.

At this point I can't make my egl program generating files in another
project, from project 1 to project 2.

Here is the egl program :

-----------------------------
[%

TemplateFactory.setOutputRoot('/sfDoctrine-1.1.2/');

for( p in EPackage.allInstances() )
{
p.createEpsilonToolsDirectoryStructure();
}

operation EPackage createEpsilonToolsDirectoryStructure() : null
{
var t : Template; t =
TemplateFactory.load('./createEpsilonTools/createEpsilonBasi cDirectory.egl');
t.populate('p', self);
t.process();
t.store(self.getFile());
}

operation EPackage getDirectory() : String
{
var ret: String;
if(self.eSuperPackage.isDefined()){
ret = self.eSuperPackage.getDirectory() + '/';
}
ret = ret + self.name + '/';
return ret;
}

operation EPackage getFile() : String
{
return self.getDirectory() + '.' + self.name;
}
%]
----------------------------
the loaded template contains simply a [%=p.name%]

the launch file :

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration
type=" org.epsilon.egl.eclipse.dt.launching.EglLaunchConfigurationD elegate ">
<booleanAttribute key="appendToFile" value="false"/>
<intAttribute key="generateTo" value="1"/>
<listAttribute key="models">
<listEntry value="#&#10;#Sun Jul 12 09:48:20 CEST
2009&#10;isMetamodelFileBased=false&#10;name=model&a mp;#10;readOnLoad=true&#10;storeOnDisposal=true&#10; aliases=model&#10;metamodelUri=http\://www.eclipse.org/emf/2002/Ecore&#10 ;type=EMF&#10;modelFile=/sfDoctrine-1.1.2/model/sfDoctri ne.ecore&#10;expand=true&#10;metamodelFile=&#10; "/>
</listAttribute>
<stringAttribute key="outputFilePath" value=""/>
<stringAttribute key="source"
value=" /meta-modeling-tools/src/tools/EPackage/createEpsilonTools.e gl "/>
</launchConfiguration>


Then I tried to copy/paste the launcher in the project 2 but still not
working.
I have tried with "setOuputRoot('./src-gen/tools') but generate things in
the project 1 (where the egl file resides).

So how can I do to generate files from one project to another ?
Is this possible ? If not, why ?

Thanks :-)
Re: can't generate file in another project [message #22780 is a reply to message #22733] Tue, 14 July 2009 11:48 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040609070405080007070606
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hi Stephane,

I think relative paths should do the trick e.g.

TemplateFactory.setOutputRoot('../sfDoctrine-1.1.2/');

I've attached a minimal example.

Cheers,
Dimitris

Stephane wrote:
> Hi,
>
> I'm trying to generate files in another eclipse project.
>
> I have two projects, one named "meta-modeling-tools"(1), the other named
> "sfDoctrine-1.1.2"(2).
>
> In the first there is an egl program, in the second, there is an ecore
> model.
>
> I have coded an egl program that create a basic directory structure for
> all epackages and eclasses inside the ecore model to create "places"
> where to put "epsilon" programs (wizards, etc) and such.
>
> At this point I can't make my egl program generating files in another
> project, from project 1 to project 2.
>
> Here is the egl program :
>
> -----------------------------
> [%
>
> TemplateFactory.setOutputRoot('/sfDoctrine-1.1.2/');
>
> for( p in EPackage.allInstances() )
> {
> p.createEpsilonToolsDirectoryStructure();
> }
>
> operation EPackage createEpsilonToolsDirectoryStructure() : null
> {
> var t : Template; t =
> TemplateFactory.load('./createEpsilonTools/createEpsilonBasi cDirectory.egl');
>
> t.populate('p', self);
> t.process();
> t.store(self.getFile());
> }
> operation EPackage getDirectory() : String
> {
> var ret: String;
> if(self.eSuperPackage.isDefined()){
> ret = self.eSuperPackage.getDirectory() + '/'; }
> ret = ret + self.name + '/';
> return ret;
> }
>
> operation EPackage getFile() : String
> {
> return self.getDirectory() + '.' + self.name;
> }
> %]
> ----------------------------
> the loaded template contains simply a [%=p.name%]
>
> the launch file :
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <launchConfiguration
> type=" org.epsilon.egl.eclipse.dt.launching.EglLaunchConfigurationD elegate ">
> <booleanAttribute key="appendToFile" value="false"/>
> <intAttribute key="generateTo" value="1"/>
> <listAttribute key="models">
> <listEntry value="#&#10;#Sun Jul 12 09:48:20 CEST
> 2009&#10;isMetamodelFileBased=false&#10;name=model&a mp;#10;readOnLoad=true&#10;storeOnDisposal=true&#10; aliases=model&#10;metamodelUri=http\://www.eclipse.org/emf/2002/Ecore&#10 ;type=EMF&#10;modelFile=/sfDoctrine-1.1.2/model/sfDoctri ne.ecore&#10;expand=true&#10;metamodelFile=&#10; "/>
>
> </listAttribute>
> <stringAttribute key="outputFilePath" value=""/>
> <stringAttribute key="source"
> value=" /meta-modeling-tools/src/tools/EPackage/createEpsilonTools.e gl "/>
> </launchConfiguration>
>
>
> Then I tried to copy/paste the launcher in the project 2 but still not
> working.
> I have tried with "setOuputRoot('./src-gen/tools') but generate things
> in the project 1 (where the egl file resides).
>
> So how can I do to generate files from one project to another ?
> Is this possible ? If not, why ?
>
> Thanks :-)
>


--------------040609070405080007070606
Content-Type: application/x-zip-compressed;
name="crossproject.zip"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="crossproject.zip"

UEsDBAoAAAAAALhl7joAAAAAAAAAAAAAAAADAAAAcDIvUEsDBBQAAAAIAOJk 7jrr7bDOfAAA
AM4AAAALAAAAcDIvLnByb2plY3Szsa/IzVEoSy0qzszPs1Uy1DNQUkjNS85P ycxLt1UKDXHT
tVCyt+Plsikoys9KTS5xSS1OLsosKAGqBopy2uQl5qbaFRjZ6IMZIJHk/Nzc 1LwSOxt9GAsk
CtVeDOboo/CSSjNzUoILUpMhcqjcvMSS0qJUqDYEB24EqnsAUEsDBAoAAAAA ALhl7joAAAAA
AAAAAAAAAAAKAAAAcDIvZm9vLnR4dFBLAwQKAA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AAoAAAAAALhl7joAAAAAAAAAAAAAAAAKAAAAAAAAAAAA IAAAAMYAAABw
Mi9mb28udHh0UEsBAhQACgAAAAAAYGXuOgAAAAAAAAAAAAAAAAMAAAAAAAAA AAAQAAAA7gAA
AHAxL1BLAQIUABQAAAAIAN1k7jpllXOPfAAAAM4AAAALAAAAAAAAAAEAIAAA AA8BAABwMS8u
cHJvamVjdFBLAQIUAAoAAAAAAO1k7joAAAAAAAAAAAAAAAAPAAAAAAAAAAAA IAAAALQBAABw
MS9kZWxlZ2F0ZS5lZ2xQSwECFAAUAAAACACzZe465tyck4cAAADDAAAACwAA AAAAAAABACAA
AADhAQAAcDEvbWFpbi5lZ2xQSwECFAAUAAAACABgZe46Qp64sOIAAACbAQAA DgAAAAAAAAAB
ACAAAACRAgAAcDEvbWFpbi5sYXVuY2hQSwUGAAAAAAgACAC+AQAAnwMAAAAA
--------------040609070405080007070606--
Re: can't generate file in another project [message #22824 is a reply to message #22780] Tue, 14 July 2009 11:53 Go to previous message
St is currently offline StFriend
Messages: 77
Registered: July 2009
Member
Thanks !
Re: can't generate file in another project [message #570755 is a reply to message #22733] Tue, 14 July 2009 11:48 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040609070405080007070606
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hi Stephane,

I think relative paths should do the trick e.g.

TemplateFactory.setOutputRoot('../sfDoctrine-1.1.2/');

I've attached a minimal example.

Cheers,
Dimitris

Stephane wrote:
> Hi,
>
> I'm trying to generate files in another eclipse project.
>
> I have two projects, one named "meta-modeling-tools"(1), the other named
> "sfDoctrine-1.1.2"(2).
>
> In the first there is an egl program, in the second, there is an ecore
> model.
>
> I have coded an egl program that create a basic directory structure for
> all epackages and eclasses inside the ecore model to create "places"
> where to put "epsilon" programs (wizards, etc) and such.
>
> At this point I can't make my egl program generating files in another
> project, from project 1 to project 2.
>
> Here is the egl program :
>
> -----------------------------
> [%
>
> TemplateFactory.setOutputRoot('/sfDoctrine-1.1.2/');
>
> for( p in EPackage.allInstances() )
> {
> p.createEpsilonToolsDirectoryStructure();
> }
>
> operation EPackage createEpsilonToolsDirectoryStructure() : null
> {
> var t : Template; t =
> TemplateFactory.load('./createEpsilonTools/createEpsilonBasi cDirectory.egl');
>
> t.populate('p', self);
> t.process();
> t.store(self.getFile());
> }
> operation EPackage getDirectory() : String
> {
> var ret: String;
> if(self.eSuperPackage.isDefined()){
> ret = self.eSuperPackage.getDirectory() + '/'; }
> ret = ret + self.name + '/';
> return ret;
> }
>
> operation EPackage getFile() : String
> {
> return self.getDirectory() + '.' + self.name;
> }
> %]
> ----------------------------
> the loaded template contains simply a [%=p.name%]
>
> the launch file :
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <launchConfiguration
> type=" org.epsilon.egl.eclipse.dt.launching.EglLaunchConfigurationD elegate ">
> <booleanAttribute key="appendToFile" value="false"/>
> <intAttribute key="generateTo" value="1"/>
> <listAttribute key="models">
> <listEntry value="#&#10;#Sun Jul 12 09:48:20 CEST
> 2009&#10;isMetamodelFileBased=false&#10;name=model&a mp;#10;readOnLoad=true&#10;storeOnDisposal=true&#10; aliases=model&#10;metamodelUri=http\://www.eclipse.org/emf/2002/Ecore&#10 ;type=EMF&#10;modelFile=/sfDoctrine-1.1.2/model/sfDoctri ne.ecore&#10;expand=true&#10;metamodelFile=&#10; "/>
>
> </listAttribute>
> <stringAttribute key="outputFilePath" value=""/>
> <stringAttribute key="source"
> value=" /meta-modeling-tools/src/tools/EPackage/createEpsilonTools.e gl "/>
> </launchConfiguration>
>
>
> Then I tried to copy/paste the launcher in the project 2 but still not
> working.
> I have tried with "setOuputRoot('./src-gen/tools') but generate things
> in the project 1 (where the egl file resides).
>
> So how can I do to generate files from one project to another ?
> Is this possible ? If not, why ?
>
> Thanks :-)
>


--------------040609070405080007070606
Content-Type: application/x-zip-compressed;
name="crossproject.zip"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="crossproject.zip"

UEsDBAoAAAAAALhl7joAAAAAAAAAAAAAAAADAAAAcDIvUEsDBBQAAAAIAOJk 7jrr7bDOfAAA
AM4AAAALAAAAcDIvLnByb2plY3Szsa/IzVEoSy0qzszPs1Uy1DNQUkjNS85P ycxLt1UKDXHT
tVCyt+Plsikoys9KTS5xSS1OLsosKAGqBopy2uQl5qbaFRjZ6IMZIJHk/Nzc 1LwSOxt9GAsk
CtVeDOboo/CSSjNzUoILUpMhcqjcvMSS0qJUqDYEB24EqnsAUEsDBAoAAAAA ALhl7joAAAAA
AAAAAAAAAAAKAAAAcDIvZm9vLnR4dFBLAwQKAAAAAABgZe46AAAAAAAAAAAA AAAAAwAAAHAx
L1BLAwQUAAAACADdZO46ZZVzj3wAAADOAAAACwAAAHAxLy5wcm9qZWN0s7Gv yM1RKEstKs7M
z7NVMtQzUFJIzUvOT8nMS7dVCg1x07VQsrfj5bIpKMrPSk0ucUktTi7KLCgB qgaKctrkJeam
2hUY2uiDGSCR5Pzc3NS8EjsbfRgLJArVXgzm6KPwkkozc1KCC1KTIXKo3LzE ktKiVKg2BAdu
BKp7AFBLAwQKAAAAAADtZO46AAAAAAAAAAAAAAAADwAAAHAxL2RlbGVnYXRl LmVnbFBLAwQU
AAAACACzZe465tyck4cAAADDAAAACwAAAHAxL21haW4uZWdsXY2xCsIwFEX3 QP/hLSURbAqO
iqurIm7i8LDPOqS8kNyK/r1RrILb4XI491hX5saJOgnSM4SWdJAhhoKryky4 4TM0PXwWbEfE
EXtVOOt9GxetnRWzaWjHOVPkxINAUiYo4SqET6Myv481/ZeDcufsZHjpwzv7 HXKxxNmLqscd
dk5Io7yM+vQEUEsDBBQAAAAIAGBl7jpCnriw4gAAAJsBAAAOAAAAcDEvbWFp bi5sYXVuY2h9
kLFOAzEMhnck3iHKTsptDD0qVOjEwHBsXdw7N43w2VHiVPTtyXFSkQ7Ean/f /1tebz5HMmdM
OQi3tnH31iD3MgT2rX3vdncP1mQFHoCEsbUsdvN4e7MmKNyftsLH4EsCrbrR S6yEJO8w5lB5
h54c9hRiRjeom6Ua7V48vf5OeEZCD4p2ajiIEAI/qaZwKIrmAy+thRiRh052 gdCaM1CplUeg
jHY1WYF1YXhkrPHYyZVvZpZCXsKjDEh5Xue6Yb8ApGgsOrW/gZ6uif8YWUrq f27dx2Y/Qvj+
zWyt/vhlnX8BUEsBAhQACgAAAAAAuGXuOgAAAAAAAAAAAAAAAAMAAAAAAAAA AAAQAAAAAAAA
AHAyL1BLAQIUABQAAAAIAOJk7jrr7bDOfAAAAM4AAAALAAAAAAAAAAEAIAAA ACEAAABwMi8u
cHJvamVjdFBLAQIUAAoAAAAAALhl7joAAAAAAAAAAAAAAAAKAAAAAAAAAAAA IAAAAMYAAABw
Mi9mb28udHh0UEsBAhQACgAAAAAAYGXuOgAAAAAAAAAAAAAAAAMAAAAAAAAA AAAQAAAA7gAA
AHAxL1BLAQIUABQAAAAIAN1k7jpllXOPfAAAAM4AAAALAAAAAAAAAAEAIAAA AA8BAABwMS8u
cHJvamVjdFBLAQIUAAoAAAAAAO1k7joAAAAAAAAAAAAAAAAPAAAAAAAAAAAA IAAAALQBAABw
MS9kZWxlZ2F0ZS5lZ2xQSwECFAAUAAAACACzZe465tyck4cAAADDAAAACwAA AAAAAAABACAA
AADhAQAAcDEvbWFpbi5lZ2xQSwECFAAUAAAACABgZe46Qp64sOIAAACbAQAA DgAAAAAAAAAB
ACAAAACRAgAAcDEvbWFpbi5sYXVuY2hQSwUGAAAAAAgACAC+AQAAnwMAAAAA
--------------040609070405080007070606--
Re: can't generate file in another project [message #570787 is a reply to message #22780] Tue, 14 July 2009 11:53 Go to previous message
St is currently offline StFriend
Messages: 77
Registered: July 2009
Member
Thanks !
Previous Topic:can't generate file in another project
Next Topic:how to give an Ecore DataType to an attribute
Goto Forum:
  


Current Time: Mon Dec 22 17:07:08 GMT 2014

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

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