-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for exported_deps for aar & jar prebuilts. (#836)
To make generated buck files small and less verbose we can use `exported_deps` for api dependencies. deps of prebuilts are exported by default (i.e dependees of a prebuilt will also get prebuilt's dependencies in it's compile classpath). To enable this make the below changes in okbuck extension: ``` okbuck { externalDependencies { resolutionAction = "latest" enableExportedDeps = true } } ``` Note: this only works when `resolutionAction` is either `latest` or `single`. example generated buck files: ``` // in .okbuck/ext/androidx/activity/BUCK load('//.okbuck/defs:okbuck_prebuilt.bzl', 'okbuck_prebuilt') okbuck_prebuilt( name = 'activity.aar', maven_coords = 'androidx.activity:activity:aar:1.0.0-alpha04', sha256 = '4a2c0a2e53933075fa6979b8921a8c7047ec60d5e3906d774f77bd598842aad9', sources_sha256 = '6127d87d0d7402172341c6c30591fdb05f7c1e63ec29e79be88d1f8fe46ca762', deps = [ '//3rdparty/jvm/androidx/annotation:annotation.jar', '//3rdparty/jvm/androidx/core:core.aar', '//3rdparty/jvm/androidx/lifecycle:lifecycle-runtime.aar', '//3rdparty/jvm/androidx/lifecycle:lifecycle-viewmodel.aar', '//3rdparty/jvm/androidx/savedstate:savedstate-bundle.aar', ], ) // in .okbuck/ext/androidx/lifecycle/BUCK load('//.okbuck/defs:okbuck_prebuilt.bzl', 'okbuck_prebuilt') okbuck_prebuilt( name = 'lifecycle-runtime.aar', maven_coords = 'androidx.lifecycle:lifecycle-runtime:aar:2.0.0', sha256 = 'e4afc9e636183f6f3e0edf1cf46121a492ffd2c673075bb07f55c7a99dd43cfb', sources_sha256 = '472d99cf093b3b65d24a5707138ce51b160eb81a0ed59095ca8c8e0883ab1524', deps = [ '//3rdparty/jvm/androidx/annotation:annotation.jar', '//3rdparty/jvm/androidx/arch/core:core-common.jar', '//3rdparty/jvm/androidx/lifecycle:lifecycle-common.jar', ], ) // in an android library buck file android_library ( name = 'src_release', deps = [ '//.okbuck/ext/androidx/activity:activity.aar' ] ``` In the above android_library we don't need to specify `lifecycle-runtime.aar` or `lifecycle-common.jar` as a dependency since that would be coming transitively. To enable this change, make sure you have pulled in facebook/buck#2247 PR on the buck side.
- Loading branch information
1 parent
ee2d692
commit 7cca254
Showing
22 changed files
with
395 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.