Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support alternate JavaCompilers (such as ECJ) in JavaSourcesSubject #80

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

doanduyhai
Copy link

New syntax to inject custom compiler:

    assertAbout(javaSource())
        .that(JavaFileObjects.forResource(Resources.getResource("HelloWorld.java")))
        .withCompiler(new EclipseCompiler())
        .withCompilerOptions("-nowarn", "-1.6")
        .compilesWithoutError();

@googlebot
Copy link
Collaborator

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@doanduyhai
Copy link
Author

I signed it!

@googlebot
Copy link
Collaborator

CLAs look good, thanks!

@@ -56,7 +57,8 @@ public Statement apply(final Statement base, Description description) {
return new Statement() {
@Override public void evaluate() throws Throwable {
final AtomicReference<Throwable> thrown = new AtomicReference<Throwable>();
Result result = Compilation.compile(ImmutableList.of(new AbstractProcessor() {
Result result = Compilation.compile(ToolProvider.getSystemJavaCompiler(),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be even better if you somehow merged #71 into that one wrt passing a JavaCompiler to the CompilationRule rather than always using ToolProvider.getSystemJavaCompiler(). Sure one can easily be rebased on the other anyway…

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, as soon as @tbroyer fixes the file manager thing

@tbroyer
Copy link

tbroyer commented Nov 22, 2015

👍

Lacking tests running with the Eclipse compiler though to make sure everything works OK.

@gk5885
Copy link
Contributor

gk5885 commented Nov 25, 2015

Actually, I'd be happy to see this and #71 get merged into one p/r.

@doanduyhai
Copy link
Author

Hello here, no new ?

#71 is still not merged yet so I'm stuck with my PR ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes P3 type=enhancement Make an existing feature better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants