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 66422 - Enable COMMAND_RUN_SINGLE for non-tests in NBM projects
Summary: Enable COMMAND_RUN_SINGLE for non-tests in NBM projects
Status: NEW
Alias: None
Product: apisupport
Classification: Unclassified
Component: Harness (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker with 3 votes (vote)
Assignee: pgebauer
URL:
Keywords:
: 44265 71890 120054 135272 165309 179131 193297 197667 (view as bug list)
Depends on: 154358
Blocks:
  Show dependency tree
 
Reported: 2005-10-10 22:00 UTC by Tim Lebedkov
Modified: 2015-09-09 11:22 UTC (History)
5 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 Tim Lebedkov 2005-10-10 22:00:41 UTC
NB plugin tasklist/usertasks
Comment 1 Jesse Glick 2005-10-11 20:14:23 UTC
No immediate plans to implement Run File for NBM projects. Not necessarily clear
what it should do, anyway - what should the classpath be? same as for unit
tests? or something else? Generally unit tests should be used in preference to
this, though there are cases (e.g. contrib/quickfilechooser/build.xml#demo)
where it is desirable to run a main class in order to interactively try some
fragment of GUI which has been decoupled sufficiently from the rest of the module.
Comment 2 Jesse Glick 2006-01-26 17:11:45 UTC
*** Issue 71890 has been marked as a duplicate of this issue. ***
Comment 3 greggwon 2006-07-31 14:43:11 UTC
I write different little tools and other things that I use during the
development process to evaluate certain strategies for implementing details of
my applications.  I really miss not being able to write these as standalone
applications to start inside of my project.  At some point, I might make some
part of these 'tools' into tests, but it really inhibits my productivity to have
to go through the testing mechanisms to do these simple tasks.
Comment 4 Jesse Glick 2007-10-26 16:56:31 UTC
*** Issue 120054 has been marked as a duplicate of this issue. ***
Comment 5 Jesse Glick 2008-05-19 21:29:16 UTC
*** Issue 135272 has been marked as a duplicate of this issue. ***
Comment 6 Jesse Glick 2008-06-20 02:50:11 UTC
Would need a new target in common.xml to run a single src/**/*.java under the assumption it has a main method, probably
using test.unit.run.cp or similar.
Comment 7 Jesse Glick 2011-04-12 14:30:25 UTC
*** Bug 193297 has been marked as a duplicate of this bug. ***
Comment 8 Jesse Glick 2011-04-12 14:30:49 UTC
*** Bug 179131 has been marked as a duplicate of this bug. ***
Comment 9 Jesse Glick 2011-04-12 14:32:56 UTC
Bug #154358 implemented Run File (as main) for classes in test/unit/src, which would be the preferred placement for code not intended to be in the actual module. (So long as the class is not named *Test, it need not use JUnit.)
Comment 10 Jesse Glick 2011-04-12 14:33:22 UTC
*** Bug 165309 has been marked as a duplicate of this bug. ***
Comment 11 Jesse Glick 2011-04-12 14:33:54 UTC
*** Bug 44265 has been marked as a duplicate of this bug. ***
Comment 12 Jesse Glick 2011-04-12 14:34:38 UTC
*** Bug 197667 has been marked as a duplicate of this bug. ***
Comment 13 stosh 2012-05-31 14:20:26 UTC
Hi Jesse,

Thanks for considering this enhancement request.

The lack of this feature makes it awkward to transition from a non-platform application to a NetBeans platform application.  Sure makes it look like the menu items like "Run File" and "Debug File" are broken -- since they are grayed out.

More importantly: I can quickly debug JPanels in a non-platform application.  It takes 1 second for the JPanel to show up.  But it is suddenly awkward in a platform application.  The "Run File" feature is missing, and it isn't clear what can be substituted.  I resort to actually running the whole platform application -- which takes 22 seconds to start up.  This is much slower than the 1 second I'm used to, and suddenly I am regretting the idea of switching to a platform app.

Perhaps it would be a more consistent user experience if the feature were removed from the non-platform support as well as the platform support?  That would make it easier for new people down the line, right?

My desire is to have the feature implemented.  Is it difficult to do?

Kind Regards,
-John
Comment 14 ebakke 2012-05-31 14:54:02 UTC
I second John's comment--the inability to do a quick "Run File" on arbitrary main classes in a platform module makes very useful testing & iteration workflows that are possible with regular application projects impossible with platform application projects.
Comment 15 Jesse Glick 2012-05-31 19:33:24 UTC
RFEs no longer under consideration for NB 7.2; possible for the subsequent release.

There are two possible ways ModuleActions could support COMMAND_RUN/DEBUG/PROFILE_SINGLE on findSources(context) in addition to findTestSources(context, false):

1. Using JavaRunner, as in existing unused bypassAntBuildScript (but modified to use QUICK_RUN/DEBUG).

2. Using something akin to setupRunMain, with matching harness changes as in comment #6.

#1 ("Compile on Save" mode) has the advantage of being relatively simple to implement, and also launching most quickly.

#2 would be a bit more work to implement, and a little slower at runtime, but more robust - works even if the Java editor is confused so long as the Ant build succeeds; and would run with module JARs including computed manifests in the classpath, so that all XML layers would be loaded (otherwise probably only generated-layer.xml's from annotations would be visible). Note that as with unit tests (excepting usage of NbModuleSuite), only modules in this module's transitive dependency graph would be on the classpath, so layers and services from unrelated modules in the app would not be there.