Code Monkey home page Code Monkey logo

Comments (18)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Generation of the 'empty' files (like mod4jDiagramTypeProvider ) in the src-gen 
folder is done on purpose. These need to be be generated in the src-gen folder. 
Only when a user wants to change a file, he should move it to the src folder. 
Advantages of this scheme are:
- regeneration as much as possible. Sometimes the 'empty'  files change because 
of changes in the generator, , or sometimes they might need to contain some 
code.
-  better overview for the user.,  He will only see files in the src folder 
that he has actually changed.  Given the huge amount of files that may be 
generated it is not workable to generate them all in the src folder.  It will 
be impossible for the user to find his manual changes.

Original comment by [email protected] on 12 Sep 2011 at 3:21

from spray.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
I'll handle this one.

Original comment by [email protected] on 12 Sep 2011 at 3:22

  • Changed state: Accepted

from spray.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Maybe we should consider the pattern used in Sculptor: 
http://fornax.itemis.de/confluence/display/fornax/3.+Advanced+Tutorial+(CSC)#3.A
dvancedTutorial(CSC)-GapClass

i.e. introduce a keyword gap - only for elements in the DSL containing "gap" a 
gap class is generated: so if the user want to adapt a default behaviour he 
just annotate the element in the DSL with "gap"

Original comment by [email protected] on 12 Sep 2011 at 3:26

from spray.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
We could go the Fornax way,  but I see no big advantage.  I have good 
experiences with the way it is done now.  I propose to leave it as is, I think 
there are more pressing issues to deal with.

Original comment by [email protected] on 12 Sep 2011 at 3:55

from spray.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
So, if I want to change mod4jDiagramTypeProvider.java file, I have to move it 
from src-gen to src directory and then make changes? But if it's so, after 
code-regeneration mod4jDiagramTypeProvider.java appears in src-gen again and 
I'll get 'The type mod4jDiagramTypeProvider is already defined'. So, now it's 
bug - am I right?

Original comment by [email protected] on 24 Sep 2011 at 8:15

from spray.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
No, it works slightly more intelligent. If the file is moved to src the 
generator will recognize that it has been moved and will not generate the file 
again.  

Original comment by [email protected] on 25 Sep 2011 at 7:59

from spray.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
[deleted comment]

from spray.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Yes, you're right! I found this place in 
org.eclipselabs.spray.generator.graphiti.templates.SprayGenerator.xtend
But. I cannot understand why, but if I create new spray(0.2.0)-project (using 
wizard, with default settings) - source code generates perfectly in "src-gen"!

Then I create org.eclipselabs.spray.examples.mydiagram.diagram package in "src" 
and copy here some file (e.g. MyDiagramDiagramTypeProvider) from "src-gen" 
(from the same package) to "src" and try to clean and rebuild workspace, then I 
got two MyDiagramDiagramTypeProvider.java files (in "src" and "src-gen") and 
"The type MyDiagramDiagramTypeProvider is already defined"-error for those that 
lays in "src".

Jos, maybe You know (or someone else) quick way to fix this error or maybe I do 
something wrong?

Original comment by [email protected] on 28 Sep 2011 at 6:37

from spray.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
*In FileGenerator.xtend, not in SprayGenerator.xtend

Original comment by [email protected] on 28 Sep 2011 at 6:44

from spray.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
If I ran eclipse with enabled -consoleLog then I got this log:
PROPERTIES 
[platform:/resource/org.eclipselabs.spray.examples.MyDiagram/model/MyDiagram.pro
perties]
EclipseResourceFileSystemAccess: WARNING: dos not work yet
generating 
org/eclipselabs/spray/examples/mydiagram/diagram/MyDiagramDiagramTypeProvider.ja
va
....

PS: I use Windows XP

Original comment by [email protected] on 28 Sep 2011 at 9:45

from spray.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Make sure that the file you are copying is meant to be used for manual 
extensions /overriding.  The base class never is and will always be generated.  
You can see this in the generated comment at the start of the file. Can you 
check this?

Original comment by [email protected] on 3 Oct 2011 at 2:13

from spray.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Yes. I saw all this comments about extension point, so it was my first step for 
working with spray - copy this file (without suffix Base) to "src".

I went through project's source codes and found that in my case for some reason 
for source code generation used not JavaIoFileSystemAccess', but 
EclipseResourceFileSystemAccess' object. So that's why we see warning: 
*EclipseResourceFileSystemAccess: WARNING: dos not work yet*
(you can see it in SprayGraphityGenerator.xtend::doGenerate)
And I think because of this generator looks for file not in workspace 
directory, but in eclipse start directory (e.g. C:\Program Files\eclipse\).

So in my case for generation uses JavaGenFile's object with uninitialized Gen 
and Man output pathes (the same doGenerate method), at least we should add:

if(  javaFsa != null ){
  java = new JavaGenFile(javaFsa)
  java.setGenOutputPath(genOutputPath)
  java.setManOutputPath(manOutputPath)
} else  {
  java = new JavaGenFile(eclipseFsa)
  // add two following lines
  java.setGenOutputPath(genOutputPath)
  java.setManOutputPath(manOutputPath)
}

After adding this lines generator again will looks for file in eclipse's start 
directory. But if we set eclipse start directory to workspace directory it 
works pretty well. Ofcourse it isn't right solution, but as quick fix can be 
used.

Maybe you know what should I do to make generator use JavaIoFileSystemAccess' 
object instead of EclipseResourceFileSystemAccess'?

Original comment by [email protected] on 3 Oct 2011 at 2:51

from spray.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Right,  when I committed the first code,  this was only working while running 
the generator from the Main program, not inside Eclipse.  I'll take a look how 
to fix this for buildinh inside Eclipse

Original comment by [email protected] on 5 Oct 2011 at 7:31

from spray.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Can you, at least, add those two lines of initializing gen and man pathes as I 
mention above to repository -  it helps me to omit adding this modifications by 
myself and rebuilding spray any time I sync with your's repository.
Can you do this for me?

Original comment by [email protected] on 8 Oct 2011 at 7:51

from spray.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
with commit 8a4ab0272644c2655cda8678df90141126706e50 the output paths are added 
as requested in #c14

Original comment by [email protected] on 18 Oct 2011 at 8:43

from spray.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
As discussed yesterday it is very likely that in the future there will be a 
configuration file in the project that registers all classes for that a gap 
class should be generated. To ease that configuration there will be UI 
enhancements that support creating new gap classes from existing generated 
classes.

Original comment by [email protected] on 18 Oct 2011 at 8:45

from spray.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
I'll handle this one.  The path should only be used when not inside Eclipse.  
Within Eclipse we should use the project to find the location for the different 
folders.

Original comment by [email protected] on 18 Oct 2011 at 1:04

from spray.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 19, 2024
Changed code generation in Eclipse to use the project location instead of the 
projectPath from the properties file.  Now the generator works standalone and 
as an eclipse builder.
Also repaired the fact that extension point files that were moved to 'src'  
were still generated. 

Original comment by [email protected] on 18 Oct 2011 at 3:19

  • Changed state: Fixed

from spray.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.