Skip to content

gazelle plugin creates java_library with name='PACKAGENAME', but tries to use an nonexisting java_library named :PACKAGENAME-test-lib #304

@cristifalcas

Description

@cristifalcas

This is happening only in test folders.

Like the title says, gazelle creates a library with the package name, but tries to use what seems to be a library that would be created when using java_test_suite.
We do not use java_test_suite, so in our case gazelle doesn't do the right thing:

java_binary(
    name = "TextFormatCommand",
    testonly = True,
    main_class = "some.class.path.text.TextFormatCommand",
    visibility = ["//visibility:public"],
    runtime_deps = [":text-test-lib"],
)

java_library(
    name = "text",
    testonly = True,
    srcs = ["TextFormatCommand.java"],
    deps = [
        "@jvm_deps//:com_google_guava_guava",
        "@jvm_deps//:info_picocli_picocli",
        "@jvm_deps//:junit_junit",
    ],
)

Any way we can configure this behaviour?
Or a known fix for this issue?

Other then that, gazelle for java works pretty well!

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions