question about ant task for Umple (fwd)

34 views
Skip to first unread message

Timothy Lethbridge

unread,
Apr 6, 2016, 1:22:57 PM4/6/16
to Umple Development Discussions, Gunter Mussbacher
Hi Umple Developers,

Can anyone help Gunter regarding his query below.

I notice that we don't have a problem when using the normal java ant task
with the java jar.

Tim

Timothy C. Lethbridge, PhD, P.Eng., I.S.P., CSDP
Professor of Software Engineering and Computer Science
/ Professeur Titulaire de génie logiciel et d'informatique
and Vice-Dean (governance) / et vice-doyen (gouvernance)
Faculté de genie / Faculty of Engineering
University of Ottawa / Université d'Ottawa
Tel: 613-562-5800x6685 Fax: 613-562-5664 Mobile: 613-252-1850
http://www.eecs.uottawa.ca/~tcl

---------- Forwarded message ----------
Date: Wed, 6 Apr 2016 13:05:22 -0400 (EDT)
From: Gunter Mussbacher <gunter.m...@mcgill.ca>
To: t...@site.uottawa.ca
Subject: question about ant task for Umple

tim,

i am wondering is there a way to run umple as an ant task, so that the
code generation could be triggered if an umple source file is changed. i
have tried to just run the umple.jar file using the java ant task, but ran
into problems because i could not find the right main class to run.

thanks for your help,
gunter.

Andrew Forward

unread,
Apr 6, 2016, 1:42:01 PM4/6/16
to Umple Development Discussions, Gunter Mussbacher

Hi Gunter,

Can you elaborate on "changed"?  Sounds simple, but the nitty gritty but the exact scenario you are trying to achieve depends on this answer.  Here are a few notions of changed.

1) Changed, like just now

This falls under the "Continuous Testing" type of change, where you hooked in to the file system and listening for changes and then reacting based on those chages.  For this, I would look at a things like Grunt, or Gulp; which tie into the file system (usually using something like inotify) and then perform certain actions based on changes.  

This is typically done on web projects to watch preprocessing languages compile down to raw formats (e.g. SASS -> CSS or JS variants -> JS raw).  This would be outside ant, and just hooked up so that when a *.ump file changes, it runs the appropriate ANT task to run the code generation

2) Changed based on Git

This falls under the "Limit Actions For Performance Reasons".  Instead of watching the file system for events, this would tap into ANT directly and use git (or other SCM) "status" calls to figure out what has changed and then if a certain something has changed to take action.

This *could* be done in Ant, but I would opt for going with #1 to get tied directly to file change events, or ask a few more whys to get to the bottom of what pain you are trying to alleviate.

=====

Let me know if this aligns with the question you are asking; or if I misunderstood what you were looking for.

andrew f





--
aforward

Gunter Mussbacher

unread,
Apr 6, 2016, 2:26:41 PM4/6/16
to Andrew Forward, Umple Development Discussions
hello andrew,

this is something much simpler. i would like an ant task that gets
triggered by e.g. TravisCI because of a change to an umple file in git.
what i need is an ant task that executes the umple jar to generate code
and i don't seem to be able to get this working.

i've tried something like:

<java jar="umple.jar" fork="true" failonerror="true">
<arg value="..."/>
<classpath>
<pathelement location="path to umple jar"/>
</classpath>
</java>

but it fails because it does not like the manifest of the jar file.

i've tried something like:

<java classname="cruise.umple.UmpleConsoleMain">
<arg value="..."/>
<classpath>
<pathelement location="path to umple jar"/>
</classpath>
</java>

but it fails because the class cannot be found (also tried this with
UmpleRunMain).

any ideas?

ciao,
gunter.
> <t...@eecs.uottawa.ca<mailto:t...@eecs.uottawa.ca>> wrote:
> Hi Umple Developers,
>
>
> Can anyone help Gunter regarding his query below.
>
>
> I notice that we don't have a problem when using the normal java ant task
> with the java jar.
>
> Tim
>
>
> Timothy C. Lethbridge, PhD, P.Eng., I.S.P., CSDP
> Professor of Software Engineering and Computer Science
> / Professeur Titulaire de génie logiciel et d'informatique
> and Vice-Dean (governance) / et vice-doyen (gouvernance) Faculté de genie /
> Faculty of Engineering
> University of Ottawa / Université d'Ottawa
> Tel: 613-562-5800x6685<tel:613-562-5800x6685> Fax:
> 613-562-5664<tel:613-562-5664> Mobile: 613-252-1850<tel:613-252-1850>
> http://www.eecs.uottawa.ca/~tcl
>
>
> ---------- Forwarded message ----------
> Date: Wed, 6 Apr 2016 13:05:22 -0400 (EDT)
> From: Gunter Mussbacher
> <gunter.m...@mcgill.ca<mailto:gunter.m...@mcgill.ca>>
> To: t...@site.uottawa.ca<mailto:t...@site.uottawa.ca>
> Subject: question about ant task for Umple
>
>
> tim,
>
> i am wondering is there a way to run umple as an ant task, so that the
> code generation could be triggered if an umple source file is changed. i
> have tried to just run the umple.jar file using the java ant task, but
> ran into problems because i could not find the right main class to run.
>
> thanks for your help, gunter.
>
>
>
>
> --
> aforward
>


Vahdat Abdelzad

unread,
Apr 6, 2016, 2:27:42 PM4/6/16
to Umple Development Discussions, Gunter Mussbacher
Hi Gunter,

If you are looking for the main class which allows running the compiler based on Umple files, you should use "UmpleConsoleMain" which is in the package cruise.umple.
It will react like the normal command line compiler and so you will be able to feed it with your own umple files and parameters.
I hope this is what you are looking for.

Regards,
Vahdat

--
You received this message because you are subscribed to the Google Groups "Umple-Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to umple-dev+...@googlegroups.com.
To post to this group, send email to umpl...@googlegroups.com.
Visit this group at https://groups.google.com/group/umple-dev.
For more options, visit https://groups.google.com/d/optout.
--
Vahdat Abdelzad.
Ph.D. Candidate in Software Engineering, University of Ottawa,
School of Electrical Engineering and Computer Science, Room 4027,
800 King Edward Avenue, Ottawa, ON, Canada, K1N 6N5,

Andrew Forward

unread,
Apr 6, 2016, 2:39:08 PM4/6/16
to Umple Development Discussions, Gunter Mussbacher

Kevin Brightwell is the umple task you created still available to run directly instead of using ant's java task?
aforward

Kevin Brightwell

unread,
Apr 6, 2016, 2:50:11 PM4/6/16
to umpl...@googlegroups.com
Sorry, I'm just catching up with this thread.

That Ant task is still in the repository. Check the UmpleAntTasks wiki page.

Let us know if it doesn't work!

Kevin


Kevin Brightwell. BESc., BSc.
​MESc. Candidate 2017
Western University​
c. 226.448.8493

Gunter Mussbacher

unread,
Apr 6, 2016, 5:20:14 PM4/6/16
to umpl...@googlegroups.com
hello kevin,

> That Ant task is still in the repository. Check the
> UmpleAntTasks<https://github.com/umple/umple/wiki/UmpleAntTasks> wiki
> page.

thanks for the pointer. i'll try that and let you know.

ciao,
gunter.


Gunter Mussbacher

unread,
Apr 6, 2016, 5:39:06 PM4/6/16
to umpl...@googlegroups.com
kevin,

> That Ant task is still in the repository. Check the
> UmpleAntTasks<https://github.com/umple/umple/wiki/UmpleAntTasks> wiki
> page.
>
> Let us know if it doesn't work!

i don't think this is working. i've tried

<taskdef name="umplec" classname="cruise.umple.util.UmplecAntTask"
classpath="C:/gM/Umple/umple.jar" />

with both the jar for umple command-line base compiler and jar for the
umple eclipse plugin and it did not work. ant gives me this error message:
"taskdef class cruise.umple.util.UmplecAntTask cannot be found using the
classloader AntClassLoader[C:\gM\Umple\umple.jar]". i checked the jars and
the class does not seem to be in the util folder.

ciao,
gunter.


Gunter Mussbacher

unread,
Apr 6, 2016, 5:55:50 PM4/6/16
to Vahdat Abdelzad, Umple Development Discussions
hello vahdat,

> If you are looking for the main class which allows running the compiler
> based on Umple files, you should use "UmpleConsoleMain" which is in the
> package cruise.umple. It will react like the normal command line compiler
> and so you will be able to feed it with your own umple files and
> parameters. I hope this is what you are looking for.

i got it to work using UmpleConsoleMain. the problem was that i was doing
this in the eclipse environment and used the jar for the umple eclipse
plugin instead of the jar for the umple command line compiler.

thanks,
gunter.


Vahdat Abdelzad

unread,
Apr 6, 2016, 5:58:52 PM4/6/16
to gunter.m...@mcgill.ca, Umple Development Discussions
Hi,

Great.
Umple plugin for the Eclipse is a xtext-based plugin so it doesn't come with umple compiler.

Regards,
Vahdat. 

Timothy Lethbridge

unread,
Apr 6, 2016, 5:59:56 PM4/6/16
to Umple Development Discussions, gunter.m...@mcgill.ca
Hi,

Vahdat is mostly right, although the Umple plugin actually doesn't use
Xtext (only a very, very old one does).

Tim
> --
> You received this message because you are subscribed to the Google Groups "Umple-Dev"
> group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> umple-dev+...@googlegroups.com.
> To post to this group, send email to umpl...@googlegroups.com.
> Visit this group at https://groups.google.com/group/umple-dev.
> For more options, visit https://groups.google.com/d/optout.
>
>


Vahdat Abdelzad

unread,
Apr 6, 2016, 6:02:35 PM4/6/16
to Umple Development Discussions, gunter.m...@mcgill.ca
Yes, in the plugin we just used the highlighting feature (not more than that).

Kevin Brightwell

unread,
Apr 6, 2016, 6:52:18 PM4/6/16
to umpl...@googlegroups.com

Gunter,

Where did you get the JAR from? I can't check now, but the task should still work as the class is still present (https://github.com/umple/umple/blob/master/cruise.umple/src/util/Ant.ump). There should be tests also running for Ant too.

I think the issue might be less to do with Umple and more surrounding Ant and its classpath search.

Kevin

--
You received this message because you are subscribed to the Google Groups "Umple-Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to umple-dev+...@googlegroups.com.
To post to this group, send an email to umpl...@googlegroups.com.

Gunter Mussbacher

unread,
Apr 6, 2016, 7:27:51 PM4/6/16
to umpl...@googlegroups.com
> Where did you get the JAR from? I can't check now, but the task should
> still work as the class is still present
> (https://github.com/umple/umple/blob/master/cruise.umple/src/util/Ant.ump
> ). There should be tests also running for Ant too.

I got the jar files from here:
https://github.com/umple/Umple/releases/tag/v.1.22.0.5146

Maybe, the instructions on the wiki page are out-of-date...
https://github.com/umple/umple/wiki/UmpleAntTasks

Kevin Brightwell

unread,
Apr 6, 2016, 8:08:44 PM4/6/16
to umpl...@googlegroups.com
You're definitely correct, it really isn't in the JAR you specified.

The tasks are present in more recent released, particularly 1.23.1+.

I highly suggest you update since the version you're using is over a year old!

Kevin

--
You received this message because you are subscribed to the Google Groups "Umple-Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to umple-dev+...@googlegroups.com.
To post to this group, send an email to umpl...@googlegroups.com.



--

Gunter Mussbacher

unread,
Apr 6, 2016, 8:31:50 PM4/6/16
to umpl...@googlegroups.com
Kevin,

> You're definitely correct, it really isn't in the JAR you specified.
> The tasks are present in more recent released, particularly 1.23.1+.
>
> I highly suggest you update since the version you're using is over a year
> old!

Yes, I would like to update to a more recent version, but the Umple
eclipse plugin does not seem to exist for the newer versions. Since I am
using both, I'd rather be in synch and use a version for which the command
line and the eclipse plugin exist.

Will there be a new eclipse plugin version at some point?

Ciao,
Gunter.

Timothy Lethbridge

unread,
Apr 6, 2016, 9:15:19 PM4/6/16
to umpl...@googlegroups.com
I have been waiting for someone with knowledge of the Eclipse plugin and
the build process to create a new version. Building was disabled back in
the early fall due to the move to Github and the build refactoring.

Miguel tried to build one last week, but it was missing the compiler! It
just had the highlighting.

This is issue 609
https://github.com/umple/umple/issues/609
I have esclated this to very high priority.

I would like to do another release in a few weeks to incorporate the
refactoring the parser and other improvements. We need to work together to
get the Eclipse plugin to work again by then.
> --
> You received this message because you are subscribed to the Google Groups "Umple-Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to umple-dev+...@googlegroups.com.
> To post to this group, send an email to umpl...@googlegroups.com.
> Visit this group at https://groups.google.com/group/umple-dev.
> For more options, visit https://groups.google.com/d/optout.
>


Reply all
Reply to author
Forward
0 new messages