salesforce / salesforce/bazel-jdt-java-toolchain

Create a ECJ version of BlazeJavaCompilerPlugin

Open
#5 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
12
Forks
8
PR merge metrics
No merged PRs in 30d

Description

The Bazel javac compiler supports plugins via BlazeJavaCompilePlugin. We need to create a version of this, which allows integration with ECJ.

Specifically the following two methods are offered by BlazeJavaCompilePlugin:

/**
 * Performs analysis actions after the attribute phase of the javac compiler. The attribute phase
 * performs symbol resolution on the parse tree.
 *
 * @param env The attributed parse tree (after symbol resolution)
 */
public void postAttribute(Env<AttrContext> env) {}

/**
 * Performs analysis actions after the flow phase of the javac compiler. The flow phase performs
 * dataflow checks, such as finding unreachable statements.
 *
 * @param env The attributed parse tree (after symbol resolution)
 */
public void postFlow(Env<AttrContext> env) {}

This work also includes patching ECJ to allow contributing such plug-ins programmatically.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked BlazeJavaCompilerPlugin.java and compare its postAttribute and postFlow hooks with ECJ's compiler extension points. Then identify where ECJ must be patched to accept plugins programmatically. Done means ECJ exposes equivalent hooks and the plugin can be integrated through the Bazel toolchain.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.