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

task javacppCompileJava fails with lombok #11

Open
irnbrux opened this issue Apr 30, 2021 · 2 comments
Open

task javacppCompileJava fails with lombok #11

irnbrux opened this issue Apr 30, 2021 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@irnbrux
Copy link

irnbrux commented Apr 30, 2021

Hi,

gradle fails to build java code, when the gradle-javacpp plugin is added. It looks liek javacppCompileJava is not working correctly.

Example gradle.build

plugins {
id 'java-library'
id 'org.bytedeco.gradle-javacpp-build' version "1.5.5"
}

dependencies {
compileOnly 'org.projectlombok:lombok:1.18.20'
annotationProcessor 'org.projectlombok:lombok:1.18.20'
testCompileOnly 'org.projectlombok:lombok:1.18.20'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.20'
}

Example java code like:

import lombok.val;

public class Bla {
void example() {
val something = somedatatype;
}
}

Error message during gradle build:
example:
error: incompatible types: org.nd4j.linalg.api.ndarray.INDArray cannot be converted to lombok.val
val fA = A.castTo(DataType.FLOAT);

The problem goes away, when the gradle-javacpp plugin is removed from gradle.build

Thanks
Brian

@saudet
Copy link
Member

saudet commented Apr 30, 2021

That sounds like an issue with custom compile tasks of Gradle, but in any case, we do not need Lombok for JavaCPP, so do not include those files in the javacppCompileJava task and everything will work fine.

@saudet saudet added bug Something isn't working help wanted Extra attention is needed labels Apr 30, 2021
@irnbrux
Copy link
Author

irnbrux commented Apr 30, 2021

@saudet
Indeed, a quick fix is to exclude using

javacppCompileJava {
exclude 'org/whatever/**'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants