Using customBuildCallbacks.xml in an Eclipse RCP headless build - eclipse

I am trying to add some custom build steps to my headless build process for an Eclipse RCP application.
I understand that the recommended way is to provide a customBuildCallbacks.xml file on the plug-in directory, and adding a link to it in the build.properties file.
# This property sets the location of the customb Build callback
customBuildCallbacks = customBuildCallbacks.xml
However, during the build process, this step is ignored.
Is there some set-up step I might be missing?

Actually, I found out that this is the only thing required.... if we are using eclipse 3.3. This will not work using Eclipse 3.1

Related

Alfresco configurations

Is there a way to automatically refresh the changes I made in my java classes once I ran my alfresco repository in eclipse ?
Because it is very time consuming to stop my tomcat, make changes in my classes and re run it then test the changes I made.
Is there a way to configure it ?
Yes there is way, If you are using SDK 3.0 you need to configura hotswap agent.
Below link will help you in that.
https://docs.alfresco.com/community/tasks/sdk-hot-reload-hotswap.html
You can configure hotswap agent in eclipse also.same add same configuration in eclipse (Run Configuration->Maven Build->New Build)
add goals as clean install alfresco:run
In jre tab add this configuration In VM arguments field ==> -javaagent:[path]hotswap-agent.jar
Run it.
In case of SDK 2.0 you need to use spring-loaded jar instead of hotswap agent.Configuration steps are almost same except the goals.

Runtime error of NoClassDefFoundError when a eclipse plugin depends on other eclipse plugin

I have an eclipse plugin project com.prosseek.asttest, and I spin off a new plugin project com.prosseek.impactAnalyzer that has one class CallHierarchyGenerator.java. Now asttest project depends on impactAnalyzer project. I had no choice but to make impactAnalyzer project eclipse plugin as it uses JDT library.
After setting up the build path in com.prosseek.asttest, it builds without a problem.
However, when I execute the plugin, I got an error missing CallHierarchyGenerator.java class.
What might be wrong?
If you are running this as an OSGI or Eclipse Application, you need to explicity export packages as available to other plugins as by default they are not. Open your manifest editor in plugin 1. Click on the runtime tab and add the packages as "Exported" then the class loader in blugin 2 will be able to find it.
Also looks like you might be doing the class path configuration wrong. in plugin 2 make sure you add plugin 1 as a dependency in the dependencies tab of the manifest editor. Looks like you are doing a dependency configuration as if it were a regular java application
Based on Duncan's answer, I could fix this issue.
Export packages in impactAnalyzer
Actually I didn't add it manually, but it's already exported, as (I guess) I did it with Quick Assist automatically.
Required Plug-ins
I had to Add com.prosseek.impactAnalyzer in the dependecies.
Run configuration update
I had one more step to do, I had to open run configuration to add required plug-ins.
Export the plugin
When exporting the asttest plugin, I also had to export impactAnalyzer also.

How to build RCP application based on Product Configuration and Target Platform Definition?

I'm about the setup an automatic (command-line) build for my Eclipse RCP Application.
I have found out the following ways to do it:
Buckminster
Using Maven with the pde-maven-plugin
Headless PDE Build
The problem with all these options is that they require me to create essentially a new representation of the information already contained in my target platform definition. For example in Buckminster, this would be the .rmap file.
In my thinking all the information to build the product should be already there when I have the following:
Plugin project with product configuration file (foo.product)
Target platform definition file (foo.target)
Therefore I would expect there to be a command like the following:
build-rcp-product foo.product foo.target win32
Is there anything like that which I may have missed?
With Buckminster you don't need to replicate the information in your target definition file. You can simply import the target file using the importtargetdefinition command. If all your dependencies defined in the target definition file, then in the rmap you define only from where to materialize your plugins (svn, git, maven, file system etc).
With PDE build, there is a filed request (Bug 266311) and it seems it is still not possible to utilize the target file directly but there are some workarounds suggested in there (which I didn't try, I am using Buckminster).
I use the PDE build and it's pretty simple. It essentially gets what it needs from the MANIFEST.MF file and the build.properties file.
The command to run it is more complicated, as you have to start Eclipse and point it to a few things, but it's very well integrated with the IDE. It does everything by making Ant scripts.
you can try tycho
here's a good start:
Tycho tutorial
Reference card
with tycho, all you need is a POM and you usually will not change this information, which is generated via maven

Disable refresh of target on build

I'm using tycho to build my rcp application. Sadly, today I have to release the first internal milestone, but one of the projects I'm using is down (The great LWJGL - http://www.lwjgl.org/) and consequently my build fails because I cannot resolve an entry of my target platform.
Does there is a way to disable such update?
Note that I already have build my app, hence I already have downloaded all the LWJGL's jars and p2 stuff. Now I simply want to use the version of LWJGL I already have to build my RCP application...
There is a corresponding Eclipse p2 bug that needs update site checking for the target platform - that's why maven offline mode does not work as expected. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=337022
For later, I suggest building a mirror of critical outside sites. In that case you could at least redirect the build to that. E.g. b3 aggregator can be used for this: http://www.eclipse.org/modeling/emft/b3/
try maven offline mode (mvn -o)

Building Eclipse plugins and features on the command line

I have a bunch of Eclipse plugins and features, which I would like to build as part of a nightly (headless) build. I've managed to do this using a complicated setup involving manually specifying paths to Eclipse plugin jars, copying customTargets.xml, etc.
Is there really no simpler solution? Isn't there a way to just point out my Update Site's site.xml and say "build"; i.e. the equivalent of clicking "Build All" in the Update Site project?
Given that all the answers to this question are all 3-5 years old, I figure an update would be useful to others.
For those who want to add the building of Eclipse plugins to the CI process, I recommend they check out the Eclipse Tycho project. This is essentially a Maven plugin that allows you you to wrap eclipse projects within Maven project. With this we use Atlassian Bamboo to build our Eclipse plugin. This also allows us to use the Maven jarsigner plugin to sign our plugin files.
I've just been fighting with this problem myself. Are you using the productBuild script? Maybe putting your features into a product would help you out.
I am doing a headless build on a product configuration. The only script that I customized was to add some ant tasks to customTargets.xml to get my sources from SVN and to do a little cleanup on JNLP manifests after the build as I am using WebStart.
Then you only need to invoke antRunner on the out of the box productBuild.xml in the scripts/productBuild directory (in the pde-build plugin).
Check out Ant4Eclipse. I've used it to parse Eclipse's .classpath/.project files to determine project dependencies and classpaths. In combination with Groovy Ant Task, I have automatically built multiple projects in Ant using the Eclipse project files for build information.
A buildPlugin task exists, but I have not personally used it.
We are currently using PDE to automatically build features and our complete product. It works quite well. Make sure you use the right script for product build or feature build.
Eclipse Help on using PDE
EDIT: We've now migrated to Buckminster, which has an excellent command line interface.
You might look into buckminster and maven. There is a learning curve for sure, but they seem to do their jobs well.
We are using headlesseclipse, which can be found on Google Code:
http://code.google.com/p/headlesseclipse/
It works quite well, and can easily automate command-line building of plugins and features. However, I have not yet found a way to automate building of the update site via the command line.