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 90190 - Cannot create new files in external dir
Summary: Cannot create new files in external dir
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 5.x
Hardware: All Linux
: P2 blocker (vote)
Assignee: Thomas Preisler
URL:
Keywords: USABILITY
: 116890 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-11-28 14:19 UTC by aldobrucale
Modified: 2007-11-01 13:58 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description aldobrucale 2006-11-28 14:19:52 UTC
I am using cnd to work on a project which has its own old makefile. A very nice
(and unique, afaik) feature of cnd is that it doesn't require the project
directory (the one containing the nbproject folder) to be a subdir of the legacy
code directory. This is very convenient because it allows to preserve the
existing structure on the versioning system, allowing programmers to adopt
netbeans as a development tool unobtrusively, i.e. without imposing new project
files to other developers working on the same project.

Unfortunately, the "new file" dialog only allows to create new files under the
project directory structure; furthermore, trying to use the absolute path
results in the complete replication of the directory structure under the project
dir, and the dialog rejects relative paths. So one has to manually create the
new file from outside netbeans, then import it in the project via "Add existing
item". Maybe an "Add existing directory" command, allowing the user to refer to
the original sources location might be a solution (but I don't know how it fits
in the  overall project structure...)
Comment 1 aldobrucale 2007-04-16 14:06:40 UTC
I've just noticed that the wizards for creating new files do contain a
"Location" combo box, allowing the user to create files in the external source
folders. Unfortunately, the items in the combo box are not correctly
initialized: for example, my "src" folder appears in the list only after using
the "Add existing item..." entry in the explorer popup menu.
Comment 2 soldatov 2007-04-16 16:11:29 UTC
I agree. I think should be more simple way to add files to such projects.
Therefore I upgrade bug to P2.
Comment 3 aldobrucale 2007-05-07 15:10:36 UTC
I've noticed that the "Location" combo box in the new file wizard doesn't appear
for some of my projects. When I open these projects, the source folders also
appear in the "Files" tab of the explorer. I don't know why this behaviour is
different for different projects.
Comment 4 Thomas Preisler 2007-05-24 18:31:53 UTC
The Folder browse button in the wizard should allow browsing outside project
root. The New File dialog is part of NB's project system so I will re-categorize
to projects component.
Comment 5 Jesse Glick 2007-05-24 19:52:58 UTC
The standard NF wizards intentionally restrict file creation to SourceGroup's
claimed by the project's Sources impl. This will not be changed. Either the CND
project needs to supply a more accurate SourceGroup list, or you need to provide
alternate template wizards which ask for arbitrary file locations.
Comment 6 Thomas Preisler 2007-05-24 19:55:16 UTC
OK, I will take it back.
Comment 7 Thomas Preisler 2007-09-27 03:14:28 UTC
*** Issue 116890 has been marked as a duplicate of this issue. ***
Comment 8 i386 2007-09-27 08:52:26 UTC
I am desperately waiting for a solution to this problem, since one of the consequences of this will make NB6 cvs/svn
features totally ignore the original (thus external) project directory, as only the NB-created folder is committable.
Comment 9 Vladimir Voskresensky 2007-09-27 11:39:00 UTC
The workaround could be:
suppose you have sources as
...Project/
       src

Then on last page of wizard (Project Name and Location)
type:
- <Project name> as "src"
- <Project Location> as ...Project/

In this case under your "src" folder the new folder "nbproject" will be created, but that allows you to be your sources
"inside" your project root
Comment 10 Thomas Preisler 2007-10-03 22:35:27 UTC
Fixed. Now makefile projects have two source roots: the folder where the main makefile from the imported project is (it's new) and the created project itself. 
When you create a new file from one of the folders in the project view, you will now get a choice of where to create the new file. One of the choices is in the 
source tree of the imported makefile project. I think this is what you ask for. The Files view will show both source roots.

VC of the imported project can be managed from the Files view. The Project view may not correctly reflect the state of the VC system.

I will consider this issue fixed.

You should be able to control the source roots. The imported project may have a different root than the build directory and it may have more than one root. It 
should be customizable. I have filed an enhancement request for this: 117708
Comment 11 Alexander Ioffe 2007-11-01 13:58:01 UTC
Verified in build 31102007