Can NetBeans auto-build java free-form (Ant) projects? - netbeans

After every save I need to right-click on the project in the project browser and click on build.
Is there a way to configure NetBeans to auto-build the project when I save a file?

See Compile on Save FAQ: http://wiki.netbeans.org/FaqCompileOnSave
I don't use CoS myself, I highly recommend Jenkins for your auto-build needs (and so much more): http://jenkins-ci.org/

The compile on save option is not available for free-form projects as of NetBeans version 8.0. And I don't think it will be made available in future too. The very idea of free-form is that that IDE does not know anything about your project and completely relies on the ant-scripts and the mappings you provide.
If you don't want to build an entire project every time you make changes to a file, create a target in ant to compile a single file and map it to the IDE command compile.single. You could add a context menu for that if required, although the existing keyboard shortcut F9 should suffice.
You can read more on the advance free-form configuration here - Advanced Free-Form Project Configuration

Related

"Bare" Eclipse Installation for Generic Projects

Members of my team will be working on a number of plain-text files. Rather than using a normal text editor, I would like them to utilize eclipse, so we can take advantage of the plug-ins that will make life easier... such as the svn plugin.
Therefore, I would like to provide them with an installation of Eclipse where they will set up generic projects, rather than Java projects.
However, the basic Eclipse download from the website includes all the java functionality. This means that their GUI is littered with java-related functions that are not required, and I don't really want them using.
I have attempted to remove the JDT plugins / features from the installation, but at this point the generic project functions disappear too!
How can one go about removing java functionality whilst retaining generic project functionality?
The 'Eclipse Platform' contains the minimal Eclipse without the JDT or PDE Tools.
Go to http://download.eclipse.org/eclipse/downloads/ and choose either Eclipse Kepler 4.3.2 or the release candidate of Eclipse Luna 4.4.RC3 (RC4 later today). Choose the appropriate download from the 'Platform Runtime Binary' section.
Update:
You need to open the Resource perspective to create projects and edit files - use Window > Open Perspective > Other... > Resource. The resource perspective should already be open if you start with a new workspace.

Eclipse - How to open and set breakpoints in code attached to the target platform plugins?

I am a newbie to Eclipse. I have some plug-ins installed in my eclipse workbench along with their source plugins (thus i have attached code with these plugins).
How can I open(and view) the source code of these installed plugins and set break-points so that I could debug these plug-ins?
My motive behind this task is to get a deeper understanding of the source code of some of these plug-ins.
Though the post How to set a breakpoint in Eclipse in a third party library? explains some methods, it doesn't tell how to open and view the attached source code.
Thanks in advance.
If you only need breakpoints, use Ctrl-Shift-T (Open Type), enter the name of the class and set the breakpoints.
But if you really want to learn about the plugin in question, there is more: Open PDE perspective, there is a view "Plugins". Select the plugin you are interested in, choose Import->As Source from the context menu of the plugin. This imports the plugin into your workspace, so you can really investigate all artifacts inside, not only the source. By default, your launch configuration will use the plugins from the workspace as first choice, so you can even modify that imported plugin now and see the effects when running your workspace.

Eclipse Indigo "Save Actions" are not being applied

I'm new to Eclipse and downloaded the following version:
Eclipse Java EE IDE for Web Developers.
Version: Indigo Release
Build id: 20110615-0604
[edit] Eclipse Platform Version 3.7
I have edited Java > Editor > Save Actions to do the following: Remove trailing white spaces on all lines, Correct indentation
When I save the .java file, those actions are not applied... is this a bug?
Found this that might be related: https://bugs.eclipse.org/bugs/show_bug.cgi?id=350475
Assuming that this relates to JavaScript files, then the related Eclipse bug could be helpful.
The problem (as I've just experienced) is that you can edit the JavaScript -> Save Actions preferences via the context menu when editing a JavaScript file, but the actions will not be run.
The solution is to right click on the project containing the .js file, and select Configure -> Convert to JavaScript project.
The bad news is that this will then will also enable Eclipse's not-so-great JavaScript validation, therefore telling you that libraries such as moment.min.js are broken.
Well for those of you who have found this topic... I did find 2 solutions, no thanks to Eclipse, other than the fact that it is open source and people can write plugins.
Eclipse Platform Version 3.7
AnyEdit - plugin that does it for you when you Save file (I believe this is what eclipse SHOULD be doing)
Go to: Window > Preferences. Then under General > Keys. Make sure drop down for Scheme: is Default and enter 'remove trailing' in the filter. You should then see "Remove Trailing Whitespace" under the command column. Bind it to your own key command.
The only drawback to #2 is that you have to actually press the key binding while editing the file, kindof like a cleanup action.
Too bad Eclipse hasn't taken the approach that ALL file types should be configurable in this way... sometimes I miss TextPad.
Old question, but at least for newer Eclipse versions there's a better solution: Go to the project properties, then to Project Facets. If it tells you that your project isn't in faceted form yet, then convert it. Afterwards (or if it already was faceted), just enable the JavaScript checkbox.
I had the same issue with Eclipse 4.4 (Luna) and this fixed it for me, the save actions are now executed on save.
Adding to jlh's answer, I also had to configure the JavaScript include path of the project to enable save actions. Before that even a manual "Clean Up ..." from the source menu wouldn't work.

Eclipse adding your own build command

I am new to eclipse and wanted to do the following:
Use my custom build commands with eclipse. Until now I only saw make all. I use a shell script for building my project; how can I use that in an Eclipse environment?
When I create a new project with the existing source code, it doesn't add the files, without building the code and if code fails to build (because I generally don't have make all).
How do I resolve this issue?
You can add a custom builder in the "Builders" category of the project properties.
project->properties->builders->new
there you can also deactivate the default eclipse builders..
hope that helped
In addition to what smeg4brains said and assuming that you are using the CDT plugin you can go to:
project -> properties -> C/C++ Build
Uncheck Use default build command on the Builder Settings tab and replace make with e.g. scons.
On the Behaviour tab you can then specify the target to call for the Build and Clean phase.
To resolve your second issue open the Project menu and uncheck Build automatically.
This will prevent Eclipse from building the project when it thinks it is necessary.
If you want to add other your own commands then the easiest way is to write Ant file for your project so by clicking once you can execute all your commands.To see how to write Ant file click here
I was able to do something similar to have protoc run on my .proto files. I did it by adding a "Make Target" to the project.
A lot of stuff in Eclipse you can get around using Ant, which are XML scripts, and there is also a ANT project builder which uses those. If you don't like to mess with frankly quite touchy GUI options, just write a build.xml and use ANT build as the project builder.

How do I configure Eclipse to work on Qt-based applications in a subversion tree?

Most of the work being done at my company is Qt-based C++, and it's all checked into a Subversion repository. Until now, all work on the codebase has been done purely with nano, or perhaps Kate. Being new here, I would like to take advantage of setting up Eclipse -properly- to edit my local copy of the tree. I have the CDT "version" of Eclipse, and the Qt integration, and the Subclipse module. At this point, though, I don't know what to do. Do I "import" the projects into an Eclipse-controlled workspace? Do I edit them in place? Nothing I've tried to do gets Eclipse to recognize that the "project" is a Qt application, so that I can get the integration working.
I would create a new QT project in eclipse, then switch perspectives to subclipse and simply do a SVN checkout into the new eclipse project. You should be good to go.
OK, I've been playing around with this idea, and it has some merit. I can switch to the "SVN Project Exploring" perspective (which I hadn't noticed before), and do a checkout from the head of the sub-project I want. I get a nice SVN-linked copy of the tree in my Eclipse workspace for editing. Eclipse even "understands" the classes, and can do completion on methods and such. However, I still can't get Eclipse to understand that the project is a "QT Gui" project, such that I could view the properties, and control the linking of the various Qt libraries and the like. By extension, it also doesn't understand how to build my project, like it would be able to do if I had created an empty Qt Gui project from scratch. How do I get this part working?
I have exactly the same situation at work (with CVS instead of subversion and the rest of the team using KDevelop but that's no big deal). Just start a new Qt Gui project using the Qt - Eclipse integration features and then remove all the auto generated files. Now using the "Team" features of eclipse and choose to share your project, enter the path to the repository and you 're good to go.
Checkout the project. It will ask you some options like if you want to start with a blank project, or want to use the tree to make a new project. Choose the latter and you should be ok :). It seems to work for me with Ganymed and subversive(not sure about subclipse and i don't remember.) :)
The only way I could get this to work was to check out the project with eclipse and then copy over the .project and .cdtproject files from another Qt-project. Then do a refresh on the project. This is a horrible hack but it gets you started.
You might need to define another builder for 'make'.
Second nikolavp - Checkout, and mark the option to use the new project wizard, then select Qt project. I've done this (with ganymede) and it successfully finds everything and builds correctly.
My solution:
go to the svn-view and add the repository location for your project
check out the project some temporary location with svn or any client you like
choose 'File->Import...' and say 'Qt->Qt project'
browse to the location of the *.pro file, select and hit the OK-Button
you are in the game with an appropriate Qt-project and Subversion Access for that project
I would say the same as the last one,
but instead of the two first steps I would set up the Qt-Eclipse integration:
Qt-Eclipse integration before looking for the *.pro file.