Can Eclipse (Oxygen) automatically find all Header files in a project? - eclipse

I have imported a very large project for an STM32F4 that I have found online. I was going through including all the .h files in folders when I realised the program structure had them everywhere and outside of neat Inc/Include folder.
The method I normally use is go to Project Properties>C/C++ Build>Settings>Tool Setting Tab> then include the folders in the Includes boxes provided, the "-I" box.
This is very tedious; is there a better way?

Related

Version 8.2 difficulties

I upgraded to version 8.2 and my projects list disappeared. When I pointed to the folder where my java files are located, Netbeans cannot find a project file. However, in the folder reside my 2 java files and a form file.
Admittedly, I do lack a bit of Netbeans experience, and for the life of me, I cannot figure out how to import these files into a project - and be able to work with the form. Can anyone give me a pointer on how to resurrect my project?
Edited at recommendation:
When I selected "Open Project" and entered the path to where my files are located "/Users/robertbray/Documents/Robert/NetBeans/numberaddition/" In the "Project Folder" pane, nothing appears, as if the project does not exist. So, playing around this evening, I used the "Open File" method and entered the path "/Users/robertbray/Documents/Robert/NetBeans/numberaddition", now I am able to see my source files (NumberAdditionUI.java, NumberAdditionUI.form, and GraphPanel2.java) and I can open them, including the form (design). However, I cannot determine how to convert this to a project file so I can build and run the code - these options are greyed out.
Since I had the original source files, I created a new project, then moved (and renamed) the original java class/form files into the "/src" directory. Of course I had to do some changes in the java files with the new name. As s test, I modified the form and rebuilt the project. Working as expected. Many thanks to #skomisa!

Eclipse showing lots of unrelated files in project explorer

I'm new to Eclipse, having done a lot of development in Visual Studio and XCode.
When I create a C++ project in my source tree the project explorer shows all the files in that folder and sub-folders. However there are lots of unrelated files that I don't want to see.
In Visual Studio and XCode I have to manually link source code to the project. This allows me to control the clutter of the project. Non-project files are "hidden" by default, because they aren't added to the project. In Eclipse everything is added by default. It seems that you can't decouple the file system's storage from the view you see in the project explorer.
Also I have a bunch of source in my tree that I don't want to compile as part of this project. Because it's for a different platform. I can't see how to remove these files from the compile list without also removing them from the file system.
Reading the docs hasn't helped much. What am I missing here?
There are 2 parts to this solution. First file name filters can be defined as described in this post:
Eclipse: how to hide custom files in Project Explorer
2nd the remaining files that I don't want compiled can be excluded by right clicking on them and Properties -> C++ build -> Exclude resource from build.
So it's more a negative space thing. In traditional systems, you have to explicitly add code to the project. In Eclipse you have to explicitly REMOVE code from the project. I prefer the old way because sometimes you want to include code from disparate regions on the disk and that just makes the all inclusive model of eclipse break. But I guess I'll cross that bridge when I get to it. sigh

How to have different file links to an Eclipse project (not importing it)?

I noticed when I import a file, the file is copied to the work space, but can I just create a file link in a Eclipse project? So when I modify the files in Eclipse, the files in the linked location is modified. In this way, I can version control the files using SVN. And I don't need to copy the modified files back to its dedicated directory when deployment.
The following is a more detailed description of my problem:
I have a cgi application located and runs in apache. The app runs with diff configuration files for different 'projects' which is more like showing different dataset with its corresponding configuration file. My task is to write the configurations files which will require some perl callback functions, css files and images. All these files have their own dedicated directories located in different places in the company server which i have not much control with.. So far, I just use command line to modify files and keeping old copies for version control. If I can do something like my above description, I will be able to have a central place to work on and do SVN. Or do you have a better idea how I should set up my work environment?
Thanks heaps in advance.
Yes you can,
File -> New File -> Advanced (at the bottom) -> Link to file in the file system
Manu
I have figured out a way to conveniently to version control files from different places and can deploy them to the correct directories after modified. It's ....... using..... the ANT build file... I just have all files imported to a single project and use an ANT build to distribute them back to their corresponding destination.
Use svn:external http://svnbook.red-bean.com/en/1.0/ch07s03.html
One drawback though, you have to update your other projects once you commit a shared files.

Resources check

hey I am frequently uploading my XCode iPhone projects to an svn repository to be build on another machine.
My problem is that when I add resources to my project sometimes I forget to add the resource as relative to the project.
I know one answer is to be more careful (not easy when your tired!) but if there was a way to run a script to check my resource paths are relative when I build and warn me if they are not it would be a great time saver for me.
How would I go about doing this?
Thanks
Chris
You can select all the files in your project and set the Path Type for all of them in one go. While this isn't a script this does save a lot of time over doing the files individually
I think the best approach to script this would be to look in the .xcodeproj file - the file paths are listed in there. If your project is called MyProject you need to open (either by using Show Package Contents in Finder or just the usual cd in Terminal) the MyProject.xcodeproj directory.
In here you'll find a file called project.pbxproj - open this in a editor that won't mess up your formatting and have a peek around the file. If you search for one of your files in the project you should be able to see how Xcode stores references to the project files.
Look for a section named /* Begin PBXFileReference section */. In here all your files are listed, along with where they are relative to the project, e.g.:
... path = Classes/MyClass.h; sourceTree = SOURCE_ROOT
If you can parse this file you should be able to acheive what you want - but remember to back up the file, otherwise you might corrupt your project.
How would it be if you instead write a script that asks the SCM if anything in the project is not committed? For example, think of this scenario
Project Root
Codex
Project.xcodeproj
…
Design
anImage.png
where anImage.png being outside of Codex, where the Xcode project sits (its path starts with a ../). A strong .pbxproj parser would have to support all the variants in which Xcode references files to know exactly if there are stray files.
OTOH, the SCM knows where everything is all the time (you mentioned up-ping to a SVN server), so why not ask it instead.
We have a Ruby script that prints a warning in Xcode’s Build Log if anything in the project is not committed.

FDT / Eclipse : path variable

I am trying to create a script that would list all the linked libraries in an FDT project and their corresponding svn repositories.
My problem : I was not able to find the file on my system where Eclipse (or FDT, I'm not even sure) writes all of the path variables.
I have tried capturing changes on my system and have had no luck.
If anyone knows where to find this file (Mac OS X) or knows a technique I could use to find it, it would be very appreciated.
Thanks.
In FDT, you can find the list linked libraries in the .as3_classpath file if those libraries are in your project folder (or below). They reflect the content you add in the 'Library' tab of 'FDT Build Path' in your project's properties. There's also an entry in the .project file that reflect the linked libraries you add with the 'Source' tab. Those libraries can be located anywhere on your hard drive, and that's why you define 'path variables' for them.
Personally, I create a 'lib' folder in my project where I copy the libraries I need and add them with the 'Library' tab. I find it much easier to share the project (since everything is relative to the project) and you don't need to worry about having two projects modifying the same library file.
For the location of those 'Path' variables, as far as I know, could only be located in your eclipse installation folder or in your eclipse 'settings' folder, usually in your 'user' directory.