dukeboard / kevoree-modeling-framework

Kevoree Modeling Framework
http://kevoree.org/kmf
GNU Lesser General Public License v3.0
37 stars 7 forks source link

Code generation fails with uppercase letters in project path #63

Closed gbecan closed 10 years ago

gbecan commented 10 years ago

When the path of a project contains uppercase letters (e.g. Foo/Bar), the kotlin classes are generated in a lowercase folder (foo/bar). Thus, nothing is compiled by the Kotlin compiler despite the "build success" indicated by Maven.

gnain commented 10 years ago

What do you mean by "the path of a project" ? KMF generates packages in lowercases, always. Could you give a bit more details on your project organization ? A minimal folder with pom and src to exemplify would be a must ! :-)

gbecan commented 10 years ago

I created a project with a minimal example : https://github.com/gbecan/kmf-uppercase-bug In this repository, there are 2 intellij projects that are generating classes from a simple ecore model.

One is named kmf.uppercase.bug.ok and correctly generates the Java classes from the ecore.

The other is named kmf.uppercase.bug.NotOk and fails to generate the Java classes. What happens is that Kotlin classes are generated in kmf.uppercase.bug.notok/taget instead of kmf.uppercase.bug.NotOk/target folder.

gnain commented 10 years ago

Perfect ! Thanks. I understand the problem. However, KMF uses the ${project.build.directory} property of Maven to know where to generate the files. It works on my mac with no problem. What system are you using ?

gbecan commented 10 years ago

Ok that's probably coming from the OS. I'm using Linux (Fedora)

maxleiko commented 10 years ago

If it comes from the OS, it must certainly not be a problem of the Linux one..

Just sayin'

gbecan commented 10 years ago

I agree :D! I looked into the code of KMF, in particular in the org.kevoree.modeling.kotlin.generator module and there are several occurrences of toLowerCase method. It may be the source of the problem. In particular, there is one weird call in https://github.com/dukeboard/kevoree-modeling-framework/blob/master/org.kevoree.modeling.kotlin.generator/src/main/java/org/kevoree/modeling/kotlin/generator/GenerationContext.java#L187