Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

For Java rules, files from multiple Labels of data attribute are flattened in war file #112

Open
jiaqi opened this issue Feb 26, 2020 · 0 comments

Comments

@jiaqi
Copy link
Contributor

jiaqi commented Feb 26, 2020

In https://github.com/bazelbuild/rules_appengine/blob/master/appengine/java_appengine.bzl#L82

    if path and in_file.short_path.startswith(path):
        output_path += in_file.short_path[len(path):]

when in_file.short_path does not start with path, what happens is output_path will remain output, the root directory of war file. And eventually ln -s $(pwd)/%s %s creates in_file symlink at the root directory, and ignores the directory structure of in_file.

If multiple files from different directories have the same name, one will overwrite the other.

I believe the desired behavior is to preserve the original directory structure of in_file and create symlink at output_path/in_file.path instead of output_path. I've got it working in a fork, it looks roughly like this

https://github.com/jiaqi/rules_appengine/pull/1/files#diff-3b8b4a89deffca2ab1dabfb178ff7012

If it make sense I can create a PR.

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

No branches or pull requests

1 participant