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 157324 - In C++ make it easy to build and run a single file.
Summary: In C++ make it easy to build and run a single file.
Status: STARTED
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P2 blocker with 4 votes (vote)
Assignee: Alexander Simon
URL:
Keywords:
: 190030 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-01-22 17:25 UTC by darbie
Modified: 2013-01-11 14:26 UTC (History)
1 user (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 darbie 2009-01-22 17:25:35 UTC
I am doing C++ development with my own external Makefile.  When netbeans uses that Makefile to build it will build a 
bunch of libraries, one main executable, and many regression test executables.  

I want to be able to right click on a single file and tell it to build just that file.  Right now I can only build the 
entire project.  How about allowing a configuration where I can say do run this: "make $(BASE_FILENAME).o" where 
$(BASE_FILENAME) is some predefined variable that netbeans will pass in the currently selected file.  This way I could 
right click on the file and select build on just it.  Netbeans would simply call my Makefile with "make FileName.o".

I also want to be able to right click on a file that has a main in it and tell Netbeans to run that.  I have many 
executables (regression tests).  I want to select a breakpoint and then right click on a file that has a main in it and 
tell netbeans to debug that file.
Comment 1 Peter Pis 2009-01-23 07:22:12 UTC
Reassigning to cnd for further evaluation.
Comment 2 Vladimir Kvashin 2009-08-11 17:11:29 UTC
There are at least two more users who requested this.
Comment 3 pcdinh 2010-01-19 02:53:49 UTC
It is great if it is possible to compile and run a single file in a C/C++ project. It will help if a project contains more than one executable file
Comment 4 Leonid Lenyashin 2010-09-01 14:31:20 UTC
*** Bug 190030 has been marked as a duplicate of this bug. ***
Comment 5 Leonid Lenyashin 2010-09-01 14:32:21 UTC
Also look at #190030 for some ideas of how it should be done.
Comment 6 Leonid Lenyashin 2011-02-11 20:24:10 UTC
would be a good addition for Studio too
Comment 7 Vladimir Kvashin 2011-09-05 07:22:37 UTC
I've got one more request for this on a a NetBeans forum today.
Comment 8 Alexander Simon 2012-05-24 14:09:12 UTC
Implemented Compile and Run actions for project less files:
http://hg.netbeans.org/cnd-main/rev/1b8f3293fdb5
http://hg.netbeans.org/cnd-main/rev/a772ef0a0f29
Comment 9 Quality Engineering 2012-05-25 05:44:40 UTC
Integrated into 'main-golden', will be available in build *201205250002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/1b8f3293fdb5
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixing Bug #157324 In C++ make it easy to build and run a single file.
Comment 10 Quality Engineering 2012-06-09 04:34:29 UTC
Integrated into 'main-golden', will be available in build *201206090001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/81c446ea4f0e
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixing Bug #157324 In C++ make it easy to build and run a single file
- disable run&debug action
Comment 11 Leonid Lenyashin 2013-01-11 11:50:08 UTC
Some how it is started and something is implemented, but this is not "resolved" yet.

Ok, may be it is good, as there is a need to have a customizable action for a single file compile command.
It may be implemented as a project/file property (with usual inheritance rules) that is defaulted to "Automatic" (means what has been implemented by Alexander), and also suggest "make %.o" option, and may be some other popular options, as well as custom command that supports certain macros for source and object files.
Comment 12 Leonid Lenyashin 2013-01-11 14:26:56 UTC
Just got an idea how to make the feature even more usable. So as we are told how to build the whole thing (make, scons, cmake, build.sh) at the first invocation of single file build we can suggest something meaningful and ask user for confirmation. Then we memorize what user selected and use it in subsequent runs.