Add sample app to tests how many targets were rebuilt #840
Merged
restingbull merged 4 commits intobazel-contrib:masterfrom Dec 17, 2022
Merged
Add sample app to tests how many targets were rebuilt #840restingbull merged 4 commits intobazel-contrib:masterfrom
restingbull merged 4 commits intobazel-contrib:masterfrom
Conversation
b5c38dd to
e83a422
Compare
Collaborator
Author
|
Rebased against latest master to see if it fixes CI |
restingbull
reviewed
Dec 14, 2022
restingbull
approved these changes
Dec 17, 2022
nkoroste
added a commit
that referenced
this pull request
Sep 29, 2023
Defines `--@io_bazel_rules_kotlin//kotlin/settings:experimental_prune_transitive_deps=True` that will allow you to make java and android to only use direct dependancies when compiling a given target. This significantly speeds up incremental compilations at the cost of adding explicit deps to all targets. Relates to bazelbuild/bazel#16426 Can be tested with #840 which will produce the following expected output: ``` cd examples/deps && ./run.sh --@io_bazel_rules_kotlin//kotlin/settings:experimental_prune_transitive_deps=True Rebuilt libjava targets: 4 Rebuilt libandroid targets: 4 Rebuilt libkt targets: 2 Rebuilt libktandroid targets: 2 Rebuilt libandroid res-only targets: 4 Rebuilt libktandroid res-only targets: 4 ```
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This folder contains simple libraries that depends on each other (lib1->lib2->lib3->lib4) for multiple type : java, android, kt, kt android. The purpose is to test compilation avoidance for project following strict deps: in this case, we want ABI changes to leaf library (lib4) to recompilation only lib4, and direct consumer (lib3).
To compile a given library type :
bazel build libJava1:src_mainfor regular java jvm libbazel build liblibAndroid1Java1:src_mainfor regular java android libbazel build libKt1:src_mainfor regular kotlin jvm libbazel build libKtAndroid1:src_main libKtAndroid1:src_main_ktfor android kotlin libFor convenience, a simple script 'run.sh' is also provided, which performs an incremental build on all library type after applying an ABI change to all leaves, and output the # of targets that got rebuilt for each library type. This currently output a value of 4 for all types, while we ideally want a value of 2.
Current output without any strict deps optimizations:
cd examples/deps && ./run.sh