umple/umple.gradle

Intermittent Umple compilation error breaking Gradle quick build

AdamBJ opened this issue · 6 comments

When running the Gradle version of the "quick build" I'm encountering a periodic Umple compilation error that's breaking the build. Sometimes an extra '}' is being added to DocumenterMain.java, which is one of the files we generate during the build process. Doing a quick build with Ant seems to temporarily fix the problem, but the problem always resurfaces after a couple Gradle builds.

It may be due to the way the umple jar is invoked when we're asking it to generate our source for us. In Gradle we do it programatically:

UmpleConsoleMain consoleMain = new UmpleConsoleMain(consoleConfig)
consoleMain.runConsole()

I've heard from @vahdat-ab that invoking the jar via the command line may prevent this issue. Perhaps this is how the Ant build avoids/fixes the problem, but I'm not sure.

@vahdat-ab This issue seems to be getting worse. Now when I generate the source for cruise.umple I'm getting a bunch of junk added to the generated Java files. For example, for EcoreClass.java:

public EcoreClass(String aName, int aIntent, String aNL, String aTEXT_0, String aTEXT_1, String aTEXT_2, String aTEXT_3, String aTEXT_4, String aTEXT_5, String aTEXT_6, String aTEXT_7, String aTEXT_8, String aTEXT_9, String aTEXT_0, String aTEXT_1)
  {
    super(aName, aIntent, aNL, aTEXT_0, aTEXT_1, aTEXT_2, aTEXT_3, aTEXT_4, aTEXT_5, aTEXT_6, aTEXT_7, aTEXT_8, aTEXT_9);

Here's what it should be:

public EcoreClass(String aName, int aIntent)
  {
    super(aName, aIntent)

I have no idea what is causing this issue, but it's now consistently blocking the Gradle build from completing, and seems to be permanently breaking my main Umple repo. Even ant -f build.umple.xml first-build doesn't fix it. When I compile cruise.umple's Master.ump file in isolation it works correctly, so it must be something to do with how to Gradle build invokes the Umple jar?

Based on my experience, there is no issue when you call Umple.jar to generate code. This happens when you all the class programmatically. The issue I got was happening when a class has a 'main method which triggers the generator to generates proper executable methods with thread. I have never had an issue when there was no main method. Is it possible for you to try to build the system with an old version of Umple to see if this is a recent issue or has been with us for a long time? I would suggest using a version around 1 year ago.

It's still an issue using the March 16, 2016 release

Do you have the method main in those files?

EcoreClass doesn't have a main :S

so that is not the issue I got