Skip to content

Opinionated Rules for building Eclipse p2 repositories with Bazel

License

Notifications You must be signed in to change notification settings

eclipseguru/eclipse-bazel-p2

Repository files navigation

Eclipse p2 Support for Bazel

Opinionated Rules for building Eclipse p2 repositories with Bazel

Status

This project is currently on hold. There just isn't enough demand for moving forward with Bazel.

There is also a question on the value gain from the required effort. Maven Tycho works well enough for building Eclipse plug-ins. Eclipse Plug-Ins can never be developed as pure Bazel projects because they need the specialized support from Eclipse PDE.

First Things First

Java 11+ Only These rules cannot be used with previous Java versions.

Eclipse p2 is for installing Eclipse Plug-ins and Features from a Software Site into Eclipse. Thus, our primary goal is to allow building Eclipse Plug-ins and Features deployed as a Software Site.

Eclipse PDE Encouraged These rules will not change/replace how you develop Eclipse Plug-in and Features inside Eclipse. Thus, you will continue to create Plug-in and Feature projects inside Eclipse and commit .classpath and .project files into SCM. You will continue to self-host, i.e. run Eclipse application from within Eclipse. You will continue to use .target definition files.

Limited Bazel Fanciness With the above stated, it does not make sense to support everything that is possible in Bazel. Therefore this project defines an opinionated approach that puts Eclipse's manifest-first development approach first.

  1. You cannot write BUILD files freely for Eclipse Plug-ins and Features. Instead, you have to rely on the files generated by this project.
  2. Generated BUILD and .bzl files should be committed into source control. This will allow building and publishing Eclipse Plug-ins in a Bazel CI workflow.

Getting Started

  • [Install Bazel](doc/Installing Bazel.md) if you haven't done yet
  • Create .bazelrc-local with path to JDK 11

Contribution Guide

This project uses both: Maven and Bazel. Maven is used for best IDE experience. Bazel is used for command line build and delivery.

Few things to keep in mind:

  • The Bazel build files are source of truth for producing deliverables, i.e. don't bother adding Maven plug-ins to pom.xml files.
  • Maven drives Eclipse M2E for development of this tool. Nothing more.
  • Don't get too fancy with Bazel, though. It has to map to Maven for IDE classpath computation.
  • We'll eventually switch from M2E to the Bazel plug-in once it's more usable.
  • Lot's of Bazel stuff in this repo is heavily inspired from Google's starup-os repo.

Adding Dependencies

  • Add them to <dependencyManagement> in the root pom.xml for version management and to the pom.xmlwhere needed
  • Use tools/deps/add_maven_deps.sh to add it to dependencies.yaml

Updating Dependencies

External Resources

About

Opinionated Rules for building Eclipse p2 repositories with Bazel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published