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

Add ability to reference resources between main and flavor res directories #361

Merged
merged 2 commits into from
Jan 28, 2017

Conversation

kageiit
Copy link
Contributor

@kageiit kageiit commented Jan 28, 2017

Fixes #221
This is finally possible due to an update to buck in facebook/buck@3319cd6

You need to use this sha or later in .buckversion to get support for this feature and continue using okbuck. This also greatly simplifies the number of android_resource rules and now okbuck only creates one per target regardless of the number of its res and asset directories.

@kageiit
Copy link
Contributor Author

kageiit commented Jan 28, 2017

kageiit referenced this pull request in facebook/buck Jan 28, 2017
Summary:
Add an option to specify the inputs for `android_resource` as a map
instead of passing the top-level directory as a source path so that
we can avoid filesystem access during the target graph to action
graph transformation.

With this change, there are three possible ways resources and
assets can be treated:
  # They are specified as a PathSourcePath. This used to be the
    most common way. In this case the contents of the directory
    are still traversed during the transformation, but then the
    filtered files are placed in a symlink tree to ensure the
    filtered out files are not used.
  # They are specified as a BuildTargetSourcePath. This was not as
    common and the behavior in this case does not change. There is
    no FS access and the output of the rule is used in whole.
  # They are specified as a map from relative path to source path.
    This is a new option that behaves similarly to the first case,
    except no FS access is necessary.

Future plan is to migrate all users to cases 2 or 3 and then either
disable case 1 or remove the filesystem access from it which will
mean that no filtering will take case and rule keys might diverge
if ignored files are present.

Test Plan: * `buck test`.

Reviewed By: Coneko

fbshipit-source-id: 7af04c3
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 this pull request may close these issues.

None yet

1 participant