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

The latest version of the library generates corrupted code when applied in web repository #33

Open
yevhenii-nadtochii opened this issue Apr 12, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@yevhenii-nadtochii
Copy link
Contributor

yevhenii-nadtochii commented Apr 12, 2022

Using of the latest version of spine-mc-java in web repository fails the build with a compilation error. The generated code contains validate() method that has an unexpected return type.

The problematic versions are 2.0.0-SNAPSHOT.90 / 2.0.0-SNAPSHOT.91.

web/firebase-web/generated/main/java/io/spine/web/firebase/subscription/FirebaseSubscription.java:880: error: incompatible types: ImmutableList<ConstraintViolation> cannot be converted to Optional<ValidationError>
            java.util.Optional<io.spine.validate.ValidationError> generated_validationError_subscription = this.getSubscription().validate();
                                                                                                                                          ^

Additional remark for those who will reproduce the issue. When bumping the version of mc-java, the version of mc-js is usually also bumped. Bumping of mc-jc requires the code below to be dropped out from config. The protoJs extension has been transformed. Take a look on this PR for details.

In buildSrc/src/main/kotlin/io/spine/internal/gradle/javascript/plugin/McJs.kt:

    project.withGroovyBuilder {
        "protoJs" {
            setProperty("generatedMainDir", genProtoMain)
            setProperty("generatedTestDir", genProtoTest)
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant