In ndk-r10 release, do we need to run ndk-build if already add-native-support? - eclipse

I am learning NDK environment, there is lot of tutorial/example to teach on building a simple design which using NDK/JNI.
Some say we need to run ndk-build to generate the .so file, some say no need, just link the project with "add native support". Is anyone know what is the method we should use for ndk-r10 release?
Thanks

r10 does not change the rules of the game. You still need to run ndk-build to have the**.so** files created (and copied to correct directory).
If in eclipse (to be more precise, in ADT) you added native support to your project, then eclipse will launch ndk-build as the first steel of building the project, so you do not need to launch ndk-build manually.
You can see and modify parameters to ndk-build when you open project properties in eclipse. You can see output of ndk-build in Console view in eclipse. Errors and Warnings will also be seen in Problems view.
Some people have reported that they could not add native support with latest download of the ADT bundle. Manual update often resolves this issue, search more about this on SO.

Related

Using CDT without Eclipse

I want to use CDT parser in a project. The project would be a command-line, stand-alone project, i.e., not an Eclipse plugin.
All solutions that I've seen requires using a IWorkspace. But, I want to use the CDT parser on single files outside eclipse. Is there any way to do that?
It depends what you mean by "without Eclipse".
CDT's code is built on top of the Eclipse Platform, so you're going to need to be running an application that includes the Eclipse Platform. However, there's no reason that application can't be a command-line application. These are called "headless" applications in the Eclipse community, and you can find many tutorials for making one (here's one).
Requiring an IWorkspace shouldn't be a problem. You can e.g. create a workspace and a project in a temporary folder, and copy the code to be analyzed there.
If, for some reason, you really want to use just CDT's parser in an application that doesn't include the Eclipse Platform, you can probably copy the parser code from CDT, and replace any dependencies it has on the Eclipse Platform with your own implementations. However, this is likely to be a more labour-intensive approach, and I wouldn't recommend it.

Referencing a GWT project from another GWT one - Problems

I am already using an open source GWT project (iServe) and I would like to integrate into it another open source GWT project (PetalsBPM), by which I mean being able to call it and reference its methods.
I have imported iServe in Eclipse (it has multiple modules) as separate Maven projects referencing its other and can run it successfully through Runas -> Web application in development mode.
If I do that and run the other project through the console as mvn gwt:run, I call initiate PetalsMBP through iServe. However, that means that the two programs have to run as is, without communication with each other.
I have also imported the second project into eclipse as a java project successfully (converting into a Maven one causes problems - various lifecycle configurations ones), but whenever I try to add to to iServe through Properties -> Java Build Path -> Projects, although it does not cause any errors immediately, I cannot launch iServe anymore. It produces the following error:
"Exception occurred executing command line.
Cannot run program "C:\Program Files\Java\jre7\bin\javaw.exe" (in directory "C:...iserve-sal-gwt-1.0.0-SNAPSHOT"): CreateProcess error=206, The filename or extension is too long"
Are my problems related to the fact that PetalsBPM is not a Maven project in Eclipse (I doubt it)?
Am I doing something wrong, i.e., this is not the way to reference a project from another one? should I add a reference to the first project's (iServe) gwt.xml file?
Is there a way to do what I want without having to wrap the second project as a jar and calling it from iServe? I would prefer not to, since producing a jar every time I make a slight change is not exactly efficient!
P.S: The second project is a regular GWT project with an entrypoint, not just a module. Should I remove this?
UPDATE: Trying to figure out the source of this error, I attempted to simplify the problem, so I performed the following moves:
I created two new simple GWT projects and tried to reference one
from the other. Worked fine
I referenced the project I actually want
to use (PetalsBPM) from the simple one I just created. Also works
fine.
I referenced the new simple project from the original one I
want to use (iServe). Also works fine.
Tried doing what I actually
want to do, copying the settings from 2&3. Produces the same error
"CreateProcess error=206, The filename or extension is too long" if
I reference PetalsBPM (does not when I remove it from the referenced
projects)
So, I tried switching workspaces. I created a new workspace in C:\, and moved the actual projects there. Still it did not work. :(
Any more ideas?
I met the same type of error "Create Process, error=206, path too long etc." a hundred times.
Then, I found a solution/explanation in google-groups, it solved my problem.
I post the content and link as it might help others.
This website (StackOverflow) really helped me a thousand times.
Thanks to you all !
solution/explanation :
(Response from Stephen Johnson)
(...) if you're using eclipse plugin go to Project | Properties, choose
Google \ App Engine \ ORM and only include directories that you have
classes that you want enhanced. By default it does the entire project
so that includes a lot of needless files. (...)
Link :
original post # google-groups
Read the exception message again. Somewhere along the way Maven is generating a path that is too long for (some) Windows API to handle, try moving your workspace to a directory straight below C:\.
I just tried "skolima" reply and it worked for me. In Eclipse I clicked File->Switch Workspace.
Three things to note:
After I created the workspace in "C:\workspace" I had to update my Project->Properties > Java Build Path > Libraries > Add External JARs...
I'm using Windows 7.
I'm using "Eclipse Java EE IDE for Web Developers"
I hope this others.

How to add a library into Processing from Eclipse platform?

I installed the Processing plugin for Eclipse. it works fine. But then i copied the folder gifAnimation into C:\Program Files\eclipse\plugins\processing.plugin.core_0.2.5.1\Resources\libraries. All the other libraries are there.
but "import gifAmination.*;" does not work.
and gives the following error.
Library import "gifAnimation" could not be found. Check the library folder in your sketchbook.
It's been awhile since I used Processing in Eclipse, but I think you need to add libraries explicitly to the build path. There is a tutorial here which will walk you through the whole process of getting Eclipse working with Processing, including adding extra libraries. The main thing you need to do is browse to your added libraries, and use Eclipse's 'Add to Build Path" menu option.

GWT Post build command in Eclipse

I am starting getting used to Eclipse, but I have much more experience with Visual Studio. In Visual Studio it is possible to run auto commands after the build has finished.
Now I am creating a GWT project and several other projects at once in one solution (or workspace) in Eclipse. Some files which are compiled with the GWT project needs to be copied to another location when they have been compiled. I am currently doing this manually and would like to do it automatically. I am not doing it often, since the project works fine in debug mode (...?gwt.codesvr=localhost:9997).
But where is the location for executing a post build command for a GWT project in eclipse? Is it possible?
Just open project properties, choose 'Builders' item and click on 'New...' button.
Good question! I'm using Eclipse since about 2003, and I remember that I also wanted a functionality like that back then. However, I got so used to using ant for any serious build, that I completely forgot about it.
There is some useful ant integration in Eclipse (e.g. the ant view), and if you create your GWT project with webAppCreator you already get a few good ant targets you can build upon.
It would still be nice sometimes to have something more GUI-like to do simple multi-step builds with Eclipse. I haven't found anything like that yet, but it's absolutely possible that it exists, especially as a plugin.

Programatically installing an Eclipse plugin from within Eclipse?

I want to create an automated installer for an Eclipse plugin (i.e. not through the "Update Manager"). My scenario is simple: the user closes Eclipse, drops a downloaded JAR into the dropins folder, starts Eclipse and the rest of the process is automated.
In older Eclipse versions, before the era of P2, Eclipse had (still has) a class called InstallCommand which could be used to install pluings into the currently running platform.
While this still works in Eclipse 3.4 & 3.5, it is not behaving properly: most noticeably, plugins installed that way cannot be automatically uninstalled (it is dimmed).
The JavaDoc claims the InstallCommand is deprecated and should be replaced by a P2 alternative. However, I couldn't find the right tool for the job. There is the P2 director, but it is built for running as a separate application from the command line. It is possible to invoke it from within Eclipse but it is really not cut out for that. For example, progress monitoring and error reporting are not working well.
Does anybody know of a good alternative for that?
Thanks,
Zviki
Dropins seems very close to what you want, especially if they are just downloading jars without the associated metadata (ie the metadata will need to be auto-generated).
You could consider defining a second dropins area to manage yourself. Take a look at ProfileSynchronizer in org.eclipse.equinox.p2.reconciler.dropins, in particular the method createProfileChangeRequest. I expect the uninstall behaviour you don't like is a result of the IInstallableUnit.PROP_PROFILE_LOCKED_IU property being added.
The dropins are reconciled at startup, see the p2.reconciler.dropins Activator.watchDropins(), you can likely do the same from your own bundle to watch another folder.
I suggest to deploy your plugin as an executable JAR. The installer in the JAR should ask for the Eclipse install directory and unpack the plugin in the right place (plus some more checks as needed).
Optionally include a little "watchdog" plugin which doesn't depend on much and just checks that your main plugin loads correctly and displays a useful error message which the user can email to you for support.
According to information in bug 311590 1 which is referenced in the deprecation comment of InstallCommand an alternative is possibly to use P2 operations 2, 3.