This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 225627 - Get access to hg path for use within an Ant target
Summary: Get access to hg path for use within an Ant target
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 7.4
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-01 09:52 UTC by yjoan
Modified: 2016-07-07 08:39 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yjoan 2013-02-01 09:52:30 UTC
The issue is that I run NB 7.3 on MacOS 10.8 and my Ant target does an exec of "hg"; if NB is started by clicking on the MacOS dock then Mercurial isn't found when the Ant target is called.
Reason is that NB's process is created with a default PATH one cannot reach hg with (/usr/bin:/bin:/usr/sbin:/sbin).
I cannot do an exec of "/full/path/to/hg" because there's no standard path among the set of users.

Is there a smart answer to this ?
I read other users bumped it years ago (https://blogs.oracle.com/kto/entry/netbeans_mac_os_x_and) ...

For the time being I've worked around it by creating a /etc/launchd.conf to set a Mercurial proof PATH as explained here: http://apple.stackexchange.com/questions/63662/how-to-change-path-environment-variable-to-os-x-10-8-mountain-lion-that-will-be

In NB's Options panel, Miscellaneous > Versioning tab I can set the value of "Mercurial Executable Path". NB has probably an internal variable to host that value: does-it make sense to think NB could create a property from that value so that when writing my Ant target I could do an exec of "${hg.path}/hg" in place of "hg" ?
Comment 1 Ondrej Vrabec 2013-02-01 10:05:06 UTC
1) NB has no such accessible variable, someone would need to get it from mercurial support private properties: NbPreferences.root().node("org/netbeans/modules/mercurial").get("hgExecBinary") - without any guarantee of stability (may change in future)
2) i don't know how running ant tasks from the IDE works but i assume it's run in a separate process so ${hg.path} would have to be set by its caller. Not sure who that is: projects/ant ??
Comment 2 Martin Balin 2016-07-07 08:39:00 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss