HOWTO Use Ant to discover the Ceylon home folder

22 views
Skip to first unread message

Tako Schotanus

unread,
Nov 16, 2015, 7:50:17 AM11/16/15
to ceylon-dev
Hi,

just a heads up that we now a have new way for ant tasks to find out where CEYLON_HOME is located: by using the `ceylon` command itself.

The following code shows how to do this:

    <exec executable="ceylon" outputproperty="ceylon.home" failifexecutionfails="false">
        <arg value="--show-home" />
    </exec>
    <property environment="env"/>
    <property name="env.CEYLON_HOME" value="${ceylon.home}"/>

This will use the new `--show-home` option for the `ceylon` command (which might be useful in shell scripts as well) to retrieve the currently active distribution's home folder.

Or if $CEYLON_HOME is set in the environment its value will be used instead

In the rest of the build file you'll be able to use ${env.CEYLON_HOME} to refer to Ceylon's  home directory.

HTH,
-Tako

PS: there are probably better more fool-proof way to do this, but this code is short and concise and works in most cases.

Stephane Epardaud

unread,
Nov 16, 2015, 8:04:17 AM11/16/15
to ceylon-dev
Sounds good! Document it somewhere ;)

--
You received this message because you are subscribed to the Google Groups "ceylon-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-dev+...@googlegroups.com.
To post to this group, send email to ceylo...@googlegroups.com.
Visit this group at http://groups.google.com/group/ceylon-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-dev/CAOJRyvoTFcoLswTw3T_%3DQuME0apT0Ju%3Dz9A7XmZDHz__Yztjdg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Stéphane Épardaud
Reply all
Reply to author
Forward
0 new messages