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

Schemas with the same prefix create invalid directory references #8

Closed
austince opened this issue Sep 5, 2019 · 0 comments · Fixed by #9
Closed

Schemas with the same prefix create invalid directory references #8

austince opened this issue Sep 5, 2019 · 0 comments · Fixed by #9

Comments

@austince
Copy link
Contributor

austince commented Sep 5, 2019

Given a file tree like:

└── src
    ├── main
    │   └── resources
    │       ├── avro
    │       │   ├── Record1.avsc
    │       │   └── Record2.avsc

And BUILD file like:

filegroup(
    name = "avro-records-srcs",
    srcs = glob([
        "src/main/resources/avro/**/*.avsc",
    ]),
)

avro_java_library(
    name = "schemas",
    srcs = [":avro-records-srcs"],
    strings = True,
)

The avro_gen rule will fail with a FileNotFoundException: src/main/resources/avro/Record

I believe this comes from the _commonprefix function not respecting the directory, but rather just the common string path.

austince added a commit to austince/rules_avro that referenced this issue Sep 5, 2019
chenrui333 pushed a commit that referenced this issue Dec 7, 2019
* fix: properly get common source directory

Closes #8

* remove comment, slightly better flow
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

Successfully merging a pull request may close this issue.

1 participant