javaeclipseeclipse-plugineclipse-cdtupdate-site

How do I produce an installable form of an Eclipse plugin from "sources"?


An update site for a plugin I want to use, OpenCL development tool, is dead. However, it seems some form of the sources is available:

hu.ngms.opencl.aggregator      19.4 kB  2015-04-08      
hu.ngms.opencl.common         131.4 kB  2015-04-08      
hu.ngms.opencl.editor         829.4 kB  2015-04-08      
hu.ngms.opencl.feature        148.6 kB  2015-04-08      
hu.ngms.opencl.product        188.6 kB  2015-04-08      
hu.ngms.opencl.projectwizard  741.7 kB  2015-04-08

I'm not an Eclipse developer, but I was hoping I could recreate the plugin in some form I could use to install it in my installation of Eclipse (which may be Eclipse CDT 18.09 and may be later than that; if the Eclipse version is an issue, I'd like to know that too.) Specifically, a zipped update site with this installation procedure would be nice.

How can I do this?


Solution

  • Having the sources, you can create an update site using the Maven plug-in Eclipse Tycho, which I have done for you here:

    1. Fork the original Git repositories (or to be more precise and because the sources were split across multiple repositories, I only forked hu.ngms.opencl.product, moved everything into a subfolder and just copied the content of the non-empty repostiories into my repository; for simplicity's sake, but with losing the history of the other repositories)
    2. In the root directory add a parent pom.xml file and enable Tycho
    3. Add .mvn/extensions.xml to enable POM-less Tycho and delete the no longer required pom.xml files in the subfolders
    4. In the pom.xml file, add the target platform as p2 repository (this is sufficient, but a separate target definition file would be better here since it would allow a more specific definition of the target platform)
    5. For the update site, add a category.xml file into a subfolder
    6. In the pom.xml file, add the subfolders as modules:
      • Both plug-ins, hu.ngms.opencl.editor and hu.ngms.opencl.projectwizard
      • Feature: hu.ngms.opencl.feature
      • Update site (update-site)
    7. Run Maven clean verify
      • At the first attempt everything except the update site was successfully built. The removal of the unnecessary (since everything here is platform independent) listing of all supported platforms solved the problem. Alternatively, an older Eclipse target platform with 32 bit support could have been used instead.
    8. Add my generic GitHub action which is triggered on push to automatically run Maven and publish the update site as a Git branch (without history to prevent the Git repository from growing).

    For more details see Eclipse Tycho for building plug-ins, OSGi bundles and Eclipse applications - Tutorial.