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

mixed scala + java projects leads to wrong compiler flags #645

Open
dsilvasc opened this issue Apr 30, 2018 · 3 comments
Open

mixed scala + java projects leads to wrong compiler flags #645

dsilvasc opened this issue Apr 30, 2018 · 3 comments

Comments

@dsilvasc
Copy link

Say you have a gradle project with both scala and java sources (both scala and java plugins applied), and with extra compiler flags for your java code:

        testCompile.options.compilerArgs << "-Xlint:unchecked"

okbuck generates a BUCK file with incorrect scala compiler flags:

scala_test(
    name = 'test_main',
    srcs = glob([
        'src/test/scala/**/*.java',
        'src/test/scala/**/*.scala',
    ]),
    source = '8',
    target = '8',
    extra_arguments = [
        '-Xlint:unchecked',
    ],

which then causes buckw to fail:

$ ./buckw test
scalac error: 'unchecked' is not a valid choice for '-Xlint'
  scalac -help  gives more information

Build failed: Command failed with exit code 1.
stderr: scalac error: 'unchecked' is not a valid choice for '-Xlint'
  scalac -help  gives more information
@kageiit
Copy link
Contributor

kageiit commented May 24, 2018

This needs to be fixed upstream in buck as well:

https://github.com/facebook/buck/blob/master/src/com/facebook/buck/jvm/scala/ScalaLibraryDescription.java#L178

Currently it overrides the java args and passes them into javac

@kageiit
Copy link
Contributor

kageiit commented May 24, 2018

This needs to be fixed upstream in buck before we can apply a fix in okbuck. Kotlin and groovy rules use their own extra compiler arguments that the scala rules do not. @dsilvasc Can you please create an issue on buck?

@dsilvasc
Copy link
Author

@kageiit Thanks for following up. I filed facebook/buck#1898

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants