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

Support a primary entry point for bundles. #666

Merged
merged 1 commit into from
May 10, 2022
Merged

Support a primary entry point for bundles. #666

merged 1 commit into from
May 10, 2022

Conversation

autonomousapps
Copy link
Owner

@autonomousapps autonomousapps commented May 9, 2022

Resolves #662.

dependencyAnalysis {
dependencies {
bundle('facade') {
primary(':entry-point')
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what the new API looks like in practice. Note that I haven't added an override to the bundle() function, primarily due to limitations in Gradle that make it annoying to create domain objects with custom constructors.

* |
* C -> used as API, part of bundle with B. Should not be declared!
*/
internal class Bundles(private val dependencyUsages: Map<Coordinates, Set<Usage>>) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved from elsewhere for easier testing.

val bundles = Bundles(dependencyUsages)

// Handle bundles with primary entry points
bundleRules.primaries.forEach { (name, primaryId) ->
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some ugly duplication here, but it works ™️

@autonomousapps autonomousapps marked this pull request as ready for review May 9, 2022 22:23
@autonomousapps autonomousapps merged commit d999ba4 into main May 10, 2022
@autonomousapps autonomousapps deleted the bundles branch May 10, 2022 01:42
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.

Consider introducing "preferredIdentifier" to bundles
1 participant