How to setup the project & workspace for building Androlate; an Eclipse Plugin - eclipse

Does anyone know how to properly setup an Eclipse project in order to build the Androlate plugin; which can be found at http://code.google.com/p/androlate/issues/list?
I need this in order to replace the older Google translation code - which no longer works - with the newer Bing Translation code (see Issue #2 of this plugin for more information).
I've never built an Eclipse plugin before and all my attempts so far for this plugin have failed. However, I'm able to build the plugin examples given by Eclipse and I've also be able to build the complex Motodev plugin (http://www.motorola.com/sites/motodev/library/motodev_core_plugins.html); therefore my environment (Eclipse Juno) should be correct.
First, the source for this plugin is lacking its .project File; so I had to trick Eclipse in order to import this project into the workspace by overwriting a new plugin project over the source files. (BTW, does anyone knows why is it so difficult to simply add an existing project to the current workspace in Eclipse? Why did they have to make such a simple task so difficult?).
Second, when I try to launch this plugin under Debug Mode as an Eclipse application, I first got multiple error messages: Can't find bundle for base name feature, locale en_US.
Finally, when I try the plugin itself, I got the error Logging bundle must not be null at the line 60 of the AndrolateWizard.java file; indicating that the call to Platform.getBundle(Activator.PLUGIN_ID) at the previous line (line 59) return a null bundle.

This is because the Plugin Id specified in the activator does not match the plugin id specified in your MANIFEST.MF [Check and correct it to com.cicadalane.androlate]

Old post, but here is an androlate gradle plugin if it helps anyone https://github.com/ayvazj/gradle-androlate-plugin

Related

Eclipse Plugin Development - how to set project baseline?

Wanted to take a look at developing an Eclipse plugin. Installed the Plugin Development Environment and created a new plugin project from the "Hello World" plugin template.
Initially I got an error that there was no API Baseline defined. So, I went in to Preferences | Plug-in Development | API Baselines and defined one (based on the installation directory for my Eclipse, which is version 2020-06 so I called it "2020-06"). This is defined and is the default.
Now, the error has changed to
There is a possible API baseline mismatch since none of the workspace
projects is in the baseline.
I've googled and I can find many answers telling me how to turn the error off (or downgrade it to a warning). But I can't find anything that says how I actually fix it. How do I define the baseline for the project? (I've close all other projects in my workspace and this is anyway my only plugin project)
It's currently an untouched "Hello World" plugin template so I assume it doesn't use APIs later that 2020-06 but if it is an actual problem, how do O find out what calls are causing it? The message reads like a config missing on the project - if the code included an API call that breaks the baseline I'd expect a more specific error.

Deployable JAR file from JB Plugin Repo does not contain my files, but the plugin runs correctly locally

Background
I am working on a simple plugin, and have already deployed to the Plugin Repository once before (successfully).
Since my last successful deployment, I found that I had a lot of issues with the IDE. After completely upgrading, and modifying my plugin's directory structure, I have been able to get the plugin to Run again.
Issue
tl;dr - I have an updated plugin in the JetBrain's Plugin Repository that does not work as intended, and I cannot update it correctly!
When I run the plugin, a second instance of the IDE comes up with my plugin working correctly. I edit my code and run the plugin again - the plugin runs smoothly and the updates are applied!!
With all of this, I decided to deploy my updated plugin to the Repository again. Once that was done, I decided to download the plugin and try it out myself; just to make sure things worked.
The issue is that nothing can be found in the plugin file!! Just the updated plugin.xml file and Manifest.mf file. The total size of the archive file is around 500bytes. I know a correct archive would have more files in it, and in my case, the file size should be around 6kb (based on my first successful archive file).
So how can my local IDE instance find the files correctly, but the deployment feature cannot? How does the deployment feature actually work? I get the feeling I have the structure wrong, eventhough the new IDE instance works perfectly
Plugin
GitHub
JetBrain's Plugin Repository
When you install the plugin, the version is shown as v1.1; however, that is not true, in reality. One of the easiest features to determine the actual version of the plugin is the Folded Text foreground color.
v1.0 - RED
v1.1 - YELLOW
Deployment
Preparing Plugin Module for Deployment + resulting plugin.jar file
Contents of plugin.jar
It seems possible that because of the restructuring an old ChroMATERIAL.xml file was left somewhere in the build output. Somehow this could end up in the plugin jar. An invocation of Build > Rebuild Project should fix this problem.
There could also be problems in the project or module configuration, but the project files are not included in the GitHub repository, so that cannot be checked.

Eclipse RCP- org.eclipse.ui.plugin missing

I've written an Eclipse RCP application that runs fine in Eclipse, however, packaging it to be a standalone application has been tricky. I've worked my way though a few class path errors, but now I'm getting a new one.
After running the export wizard and launching my application, it throws a ClassDefError and ClassNotFoundException, specifically it's looking for org.eclipse.ui.plugin.AbstractUIPlugin. I did not find this in my copy of the eclipse SDK, and I downloaded the SDK again to be sure, and still couldn't find it. I found a jar online that supposedly contained the fiel along with some other eclipse packages, however, I then got this:
NoSuchMethodError: org.eclipse.ui.plugin.AbstractUIPlugin: method ()V not found
I figure the problem is more I did something wrong rather than this class is actually missing, but I've gone though all the configurations and I'm sure all the required packages and dependencies are included. Any ideas?
Download and install the new version of adt plugin 21.0.0.
Does your application works when you run from Eclipse? If so then try to open your plugin.xml, go to Runtime and on the bottom right part of the window you should see Classpath. Try adding the required plugins there.

Eclipse RCP: How to troubleshoot plugin dependencies & classpath problems?

I am working on an RCP project based on eclipse. It has been working fine but recently I thought I'd upgrade it to use a new eclipse version (3.2 -> 3.5).
After a bit of trouble, it was running on the new platform. Then I did something. Don't know what. The end result is that I'm now getting a classpath error when one of my plugins (A) tries to access a class in one of the dependent plugins (B) (also one of mine).
As far as I can see, Plugin A has Plugin B in its' dependency list and the compiler shows no errors. To test, I created a new Plugin C with one class and accessed the class from Plugin A. That works fine.
Does anyone have any hints for troubleshooting such issues? A checklist of settings to check? I've been struggling with this for hours and getting nowhere! Particularly frustrating as it was working until I changed something!
Thanks
Update
I should also say that the project is quite old and uses the plugin.xml and not the manifest. Could this be a problem? Is there a way to upgrade?
Some ideas:
Clean-and-build every project (maybe after a restart of Eclipse)
Check, whether the required packages are also exported
Check the Error log, maybe there is some unloadable plug-in, etc.
Check the Run configuration, whether every required plug-in is present there
If the problem does not happen in a Runtime workbench, but in an Exported RCP app, then check whether you compile the project with the same settings during export than in Eclipse
I hope, something helps about these.
You can try the following in your run configuration:
In the Main tab check Clear (workspace) under Workspace Data
In the Configuration tab check clear the configuration area before launching under Configuration Area
This helps me every time I encounter some strange ClassNotFound errors.
If I understand you correctly you have no compiler errors but when you run you get class not found exceptions? You could try PDE Tools > Update Classpath from the project's context menu to see if you declared any dependencies outside of the MANIFEST.MF file, which would result in compiling code that fails at runtime.
I developed for RCP quite a long ago, but if I'm not wrong, since 3.4 or 3.5 you have to declare in the plugin configration which packages/classes are exported for dependent plugins and which are not.
This is unlike the old convention of using 'internal' in the package to mark non-exported packages.
Since you have plugin.xml from very old version of eclipse, it might be the problem, as exported resources from one plugin to another were not enforced in Eclipse RCP 3.2.
One more complement, hope it helps.
Open plugin.xml, check "build" tab, see how "binary build" are configured. It affects which files will compiled and exported.
See binary build here : http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2Fguide%2Ftools%2Feditors%2Fmanifest_editor%2Fbuild.htm

Modifying Existing Eclipse Plugin and Correctly Installing it

I downloaded the source code for the EMF based UML2 Plugin and changed a class in the org.eclipse.uml2.uml.edit project to remove special characters when returning string representations. Now when I export the projects and place the jar files either in the dropins directory or replace my current uml2 plugin jar files in plugins directory, The UML files are no longer recognized, in short my modified plugin does not install correctly (no error is thrown and I can see the files being picked up under Plugins->Target Platform) .
However, When I run the plugin as an eclipse application (from the workspace) I can see the changes I made being reflected in the new instance of eclipse.
What can I do to ensure that the plugin installs correctly?
Is there a documented procedure of how to build the uml2 plugin (or any comparable plugin) after modification?
Select the project and open the context menu. There is an entry PDE near the bottom of the menu. In there, you can find an entry to build the plugin for deployment. This gives you the features and plugins directory with the fixed files. Copy both into your Eclipse install.
Unless the UML2 plugins require some kind of magic build script, exporting the one plugin you changed and overwriting the original in your Eclipse installation should be the easiest solution. One potential problem which comes to mind is conflicting plugin version numbers: make sure you don't have two identical versions of your modified plugin in your Eclipse installation.
When debugging plugins which apparently don't work properly at runtime, I always look at Help > About Eclipse Platform > Configuration Details. This lists all the plugins found by Equinox during startup, along with their status (see the Javadoc of the org.osgi.framework.Bundle interface for explanation).
I faced the exact same problem as you describe here . I dont have any answer to your problem but i am sharing what worked for me .
I created a local update site of the plugin on my system. Create update site for your plug-in article explains very very nicely the steps needed to accomplish this .