Specify Eclipse CDT Default Launch Config - eclipse

PAIN POINT:
Using Eclipse CDT - the launch configs I need are rather complex (little settings that are non-default values and other misc things) too many little things to remember, and easy to skip then stuff does not work. I want to be able to semi-automate this process in project makefiles.
Background:
I have multiple projects, not stored in the workspace (my users "import the project"). In some cases projects are some what generated (they are external makefile projects.
Requirement: Specifically depending on what build configuration is required the launch config needs to change/tweak, the external Makefile can do that, or I can create one launch file for each config. Or I can pre-populate them when I create the project
[example is normal development, debug/release but with unit-test variations]
The user might tweak the settings of course and want to save them.
Requirement: So that the launch files "travel with the project" - I want to check the into GIT, thus I want the .launch files kept in the same directory as the .project and .cproject files - as described here (thus they can be checked in and things are "self contained)
Store run configuration with project in Eclipse
PROBLEMS and QUESTIONS
1) Given existing launch configurations files (.launch files) in the ".project" directory, how can I browse/select from the list of existing ones that Eclipse does seem to previously know about.
{Example: Create a launch config called "FOO", copy this to "BAR", edit the BAR config file, replacing internal occurrences of FOO with BAR)
The BROWSE button in the "common" tab lets me select a directory to save but does not allow me to select an existing file
2) How can I tell eclipse File (X) is the default launch configuration for this project, or config(X) uses file(A) and config(Y) uses file (B)
3) Is there a way within the ".project" or ".config" or ".cproject" files to specify where to look for launch configurations, where to offer them?
4) Sure would be nice to have a file (or place in the .project, or .cproject) file that says: Launch configs for this project are in this directory - offer the user a list based on the files present in that directory
bottom line:
I'm sort of stuck - I can create launch files "correctly" with all required settings but I seem to have no means to tell Eclipse to use select/use them.
No amount of automation here seems to work, and I end up having to go back to manually creating and humanly forgetting settings in the project files.
Places I've looked:
Sort of the issue but not exactly
https://superuser.com/questions/521537/remove-launch-from-run-debug-drop-down-in-eclipse
Below - ARM describes the IMPORT process, but in my case all ".launch" files are grayed out and not selectable I don't know why and that is a different problem
I'd like to not make this a multi-step process - also see above about removing stale launch configs - you end up with too many launch configs in the history.
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0446h/CJADBBIA.html
There are numerous other places but all seem to be "click here" or "use this menu item" and not addressing the external file issue.

Related

Folding files in the navigation bar in webstorm

Iam using Webstorm for a project that uses coffeescript and Sass. In the navigation bar, I see coffeescript files along with the compiled js and map files. In the same way I see css files with the scss files. I want to be able to fold js and map files inside the corresponding coffee file for ease of navigation. I am not sure how to fix the settings for this. I want the same for scss and css files.
Yes,you can!
After google for hours,I find the answer.
Select such file(s)/folder(s) in Project View panel
"Help | Find Action" (Ctrl + Shift + A), activate check box for better results
Search for "run file watchers" (without quotes, obviously) and choose Run File Watchers entry.
see more:
PHPStorm - Run Filewatcher on existing files?
You cannot do this manually (i.e. any files you want at any time).
It's done automatically by File Watcher plugin. So .. if your *.coffee files are compiled in WebStorm by using File Watcher .. then it should be working/done automatically.
If you have File Watcher already set up -- delete intermediate files (.js/.map) and force run that file watcher.
Such grouping works if those extra files were generated after running File Watcher. IDE checks for new files and compares them with file watcher settings (Output paths to refresh field, I believe) -- based on that it creates such folding.
External file watcher (i.e. grunt-contrib-watch) is executed autonomous of IDE's File Watcher .. therefore such files will not be "grouped".
Related tickets (those few that I'm aware of) that ask about additional settings to be able to create such nesting/grouping manually:
http://youtrack.jetbrains.com/issue/WEB-8658
http://youtrack.jetbrains.com/issue/WEB-7635
http://youtrack.jetbrains.com/issue/IDEA-113347
UPDATE 2017/08/10:
As of 2016.3.x version such grouping/nesting is no longer relies on File Watchers -- it has special hard-coded rules for most common scenarios.
As of 2017.2 such rules are editable and available via Project View panel settings.

Does Eclipse store all workspace files somewhere else?

I'm often surprised that Eclipse is giving error during search "File is out of sync with file system", for the file that I have not even opened. I have a large workspace with hundreds of files under SVN control. I have configured Eclipse to "auto-refresh" on load to minimize such issues.
I can't stop wondering how can this happen at all? Why does it need to "refresh" if it should (at least I expect it to) just load everything from file system?
It looks like it's storing all the files somewhere (not even in memory, having a need to refresh on load), and if it's true - I don't like it.
Eclipse does not store your files anywhere except your workspace directory and does not use the file system directly every time when you need some files.
Eclipse indexes/caches different meta-information for all projects and theirs files in your workspace. The information can be found under .metadata folder of your workspace directory.
Such information is used to provide the tree of the files to the Eclipse and show resources in views such as Project Explorer, Package Explorer etc.
The main reason of such behaviour is performance purposes.
The out of sync problem appears when:
you create files manually (out of the Eclipse) in your workspace
Eclipse plugins or processes create/update/delete/etc. files improperly i.e. do not call related Eclipse API to refresh the resources and update the indexes.

eclipse build automatically modify

I'd like eclipse to only run make in the directory the current file belongs to, not for the entire project. This becomes more important since the project is very big and make on the top level takes around 20 minutes. most of it is entering-leaving directories and checking if build is needed etc. So I have to manually open the directory in cmd and run make. So I'd like eclipse to do this in its build automatically process. Is that possible?
Try to play with Build directory option found in project properties -> C/C++ Build -> Builder Settings tab. The default value there is ${workspace_loc:/your_project}. However Eclipse provides rich set of predefined variables (see under Variables... button). Probably most interesting for you are these ones:
build_files
Returns the set of absolute file system paths whose modification caused the current build. A list of the characters, 'a' (added), 'c' (changed), 'r' (removed), 'f' (files only), 'd' (directories only), can be supplied as an argument to limit the file list to just those types of deltas. Defaults to all deltas.
selected_resource_loc
Returns the absolute file system path of the selected resource.
Other places where you could try to use these variables are Make build target options in Behaviour tab.
If you can add your build step to the External tools configuration, you could create a manual builder from that.
The External tools configurations are set similarly as the Run configurations, but allow executing different kind of steps (e.g. shell, Ant - I am reasonably sure, make-files can also be supported, but I don't use them - if not, then you can add a shell script that runs the make-file).
To set this up you have to go to the project properties (Right click on the project, select Properties), then go to the Builders page, and add a new builder, that is created from an External tool configuration.
I hope I was clear enough for this to work.
Select your project, open Properties -> Builders. Uncheck the builders that you don't want to run automatically anymore. Hit "New..." and select "External Program".
Now you can specify what command shall be run automatically each time the project is built. To have the parent directory of the currently selected file as an argument for your build command, you may use ${selected_resource_loc}\... See the Variables button for more such place holders that can be resolved at runtime.
Afterwards you may want to configure the "refresh" tab, if you also want to see newly created files in your project explorer. And if everything works well after some trial and error, you may also want to look at the "Build Options" tab to have it run in the background.

how to create a general project only containing one folder in netbeans 6.9

how to create a general project only containing one folder in netbeans 6.9? In eclipse i can do it, but in netbeans sometime i just want to organize some files related to some category, so i want to create a single project just only containing folder and files, but now it seems that it's not possible.
if someone has the same problem, and can share your experience, thank u.
When I need to have access to a collection of files located in a folder or group of sub-folders, and I don't need much IDE support, then I add the top-level folder to the "Favorites" tab. From there I can open any file in an editor, and perform other file system commands that NetBeans makes available. If you are using a version control system supported by NetBeans with that collection of files, then those commands should be available to you too. What is not available are things like "Build" and "Debug", etc. (obviously).
If you cannot see the "Favorites" tab (it would be in with "Projects", "Files", "Services", etc.), then open the Window menu and click on Favorites.
As #lepe suggests, if your files all tend to be of a particular type, then you can create a project of that type, and then have access to the files on the "Projects" tab. Just ignore the "extra" stuff that NetBeans is giving you.
Finally, "Freeform" project types exist for certain types of projects, and Java also has an "Automatic" project type (if you install the appropriate plugin from the Update Center). These types of projects more closely resemble NetBeans-generated projects insofar as they are designed to be used with existing Ant build.xml scripts and whatnot (Automatic projects are a bit looser on that), but they still assume that the project is intended for builds, etc.
If you have a "generic" project that uses Ant to "do stuff" kind of like a build, then you might be able to subvert one of the "Freeform" project types, cajoling it into what you need.
In the end, I find just having the folder in "Favorites" works the best for me when I don't need all the extra stuff.
The benefit of Projects as opposed to Favorites is that each project remembers the files you had open when you last switched away from that project.
I use NetBeans just for editing web stuff (HTML, CSS and JavaScript files) within the context of a larger Java project (for which I use Eclipse). I use the PHP version of NetBeans, since it's the most light weight version that handles these web resources. To create a new NetBeans project for my existing Java web app I do: File > New Project > PHP > PHP Application with Existing Sources. On the next wizard screen, in "Sources Folder" browse for the folder that is the parent of all your web stuff (e.g. src/main/webapp). Leave all the other fields with their default values, just to humour NetBeans that we're dealing with a PHP project. Click Finish. No PHP specific stuff gets created. A "nbproject" folder is the only thing that gets created in your chosen folder. (There is the option of locating this outside of the project but I find it convenient to have it located with the project itself, and I just configure my source control system to ignore this folder.)

Eclipse automatically refresh resources and exclude build dir

Eclipse Helios: 40+ project working set, using maven (mvn-eclipse plugin) to generate eclipse project files.
'Resource is out of sync with the file system: ...' Appears after doing, among other things, a text search.
After a bit of googling found Prefs > Workspace > Refresh Automatically which is widely reported to be malfunctional, and has the same symptom for me. The source files are source controlled, so therefore have lock attributes on them, was curious if this may come into play with this.
Second part is regarding my build directory; eclipse knows proj_root/target is the build directory, but I would like to exclude resource sync'ing in that folder.
I basically never want to see that dialog, and don't want to have to take action to remedy it (ie manually refreshing).
I had the same problem with m2eclipse.
Marking target folder as Derived resource worked for me (right-click -> Properties -> Resource -> Derived).