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.
I have a freeform-ant project which is being used to profile a language other than java. If I click "Profile Project" or "Profile Main Project", it first brings up the java platform selector dialog and then the "Select Profiling Task" dialog. Both of these are specific to the Netbeans java profiler. I have in my project.xml, the following: <ide-actions> <action name="profile"> <script>${ant.script}</script> <target>profile</target> </action> </ide-actions> It would be nice if definining a "profile" action in the project.xml would cause it to call the configured target in my build.xml. This would be consistent with how Run/Debug project work for freeform ant projects.
This looks like some misunderstanding - whereas Run and Debug are general built- in IDE actions, Profile (Main) Project action is an integral part of NetBeans Profiler and is available only after NetBeans Profiler installation in 5.5. If I understand the RFE correctly you want to invoke other profiler using the Profile action of NetBeans Profiler. This looks to me the same as if you installed YourKit or JProfiler into the IDE and wanted to use other profiler by their actions added to the IDE. That doesn't make much sense to me. What you are probably asking for is some kind of general profiling framework/support in NetBeans IDE. This should be an abstract layer of the IDE and shouldn't be related to NetBeans Profiler in any way (we should be building upon that layer as well). Please update this RFE accordingly and reassign it to some more general component. Otherwise it will be closed as INVALID in context of NetBeans Profiler.
BTW you can add an Ant target shortcut for your profile target, which can be made to appear in the toolbar (etc.); as of 6.0 the shortcut will be visible only when your project is open.
As suggested above, I do have a "Profile Project" ant shortcut configured for the freeform project. This works well when the user does not have the netbeans profiler installed. The problem is that when they install the netbeans profiler, they see basically 2 profile project actions in the context menu and a Profile Main Project action. This is is a cause of confusion for users. What I'd like is a way to map the "profile" project action in the ide-actions section similar to how the Run/Debug actions work. Now as you mention a general purpose profiler framework would be *great* and I'd be happy to open a separate RFE for that. However, for the 6.0 timeframe, would it make sense to have the Profile Project/Profile Main Project actions honor the ide-actions? My understanding is that in netbeans 6.0 the profiler will be included by default just like the debugger.
I understand why the users are confused but even if Profile Project and Attach Profiler actions would be changed the way you are suggesting, there would be still a lot of other visible actions of NetBeans Profiler that won't work at all. As I've already written, these actions are actions of the NetBeans Profiler, not general-purpose profiling actions of the IDE - there's nothing like "honoring ide-actions" in this context. You're right that the Profiler will be included in NetBeans IDE 6.0 by default but this doesn't mean that it should supply the general profiling layer. I'm closing this RFE as INVALID in context of NetBeans Profiler. But all of NetBeans Profiler developers agree that there should be some kind of general profiling framework in the IDE (incl. appropriate actions in toolbar) and our profiler & other profilers should be built on top of it.
Sorry - I didn't elaborate much on the phrase "honoring ide actions". Here is what I meant. In org.netbeans.modules.profiler.actions.AntActions: private static void doProfileProject(final Project project, final FileObject profiledClassFile, boolean isTest) { // 1. if there is profiling in progress, ask the user and possibly cancel if (ProfilingSupport.checkProfilingInProgress()) { return; } final ProjectTypeProfiler ptp = ProjectUtilities.getProjectTypeProfiler (project); if (ptp == null) { // Branch A: not supported project with profile action in the action provider // as of now, the profile-tests will neve be used ProjectUtilities.invokeAction(project, isTest ? "profile- tests" : "profile"); //NOI18N } else { // Branch B: project profiling directly supported via ProjectTypeProfiler } According to this logic, if a project defines a "profile" action in its action provider, then "profile main project" calls that. But because there is a ProjectTypeProfiler registered for freeform ant projects, it uses that rather than the "profile" action defined in ide-actions. What I was saying was that I thought it made sense that if a freeform ant project does define a "profile" action, it should use that instead. The thought being that if someone has intentionally added a "profile" action to the ide-actions, they have made the decision that they want to define the "profile" action in the context of the project. I get your point about the confusion for other profiler actions. I guess I'd put the "Start Profiler" action at higher priority though - for the sake of new users the "start profiler" action is going to be the thing they hit first and is in the most prominent position (that of the toolbar). But I don't want to beat a dead horse any furthur... I'm happy to hear that you are planning to add a profiler framework. Let me know if you would like any input on the profiler framework - I built a profiler for our product within netbeans and "borrowed" some of your source code for the ui components, so I would be very interested in having a way to share as much common code as possible.