-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce a bloopConfig configuration by source set
The previous solution worked, but it was not ideal because it introduced the concept of a `bloopConfig` that had to extend all the configurations in the project (even across different source sets, e.g. main, test, integTest, etc.). This is awkward because the plugin generates a bloop config per source set. So, if we have one bloop config extending all configurations from all source sets, and then depending on that when generating bloop config per source set, we're running into a lot of repeated resolutions to produce the necessary artifacts and the resolution config section contains a lot more artifacts than it should (e.g. foo.json and foo-test.json would contain the same set of artifacts). Also, in theory, this approach could also cause Gradle to add the wrong artifact version because it would need reconciling all artifact across all source sets is more likely to produce different results. This is a theoretical point, but it'd be nice to avoid it. So, the fix to all of this is to make a `bloopConfig` configuration per source set. For example, the main source set gets a `bloopConfigMain` configuration that extends from some default configurations that we care about for Java/Scala plugins. (In the Android world, there are no sourcesets, but "variants" so we fallback on the previous behavior and depend on all the sources for `bloopConfigAndroid`, a config that exists only in Android projects and that adds the artifacts of all the project variants -- this is the behavior one expects, and in this case we extend from all the configurations in the variants for backwards compatibility.) To make the process more customizable for end users, I've also added a new property in the bloop configuration that lets users specify the extra configurations that should be extended per source set: ``` bloop { extendUserConfigurations = [configurations.myCustomConfig.name] } ``` This way, users have control over the configurations that should also contribute artifacts to the resolution section in the bloop config. This is nice and better than the previous approach.
- Loading branch information
Showing
5 changed files
with
128 additions
and
50 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