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

Flatten multi-module structure #1980

Merged
merged 4 commits into from
Jul 5, 2021
Merged

Flatten multi-module structure #1980

merged 4 commits into from
Jul 5, 2021

Conversation

kamildoleglo
Copy link
Contributor

No description provided.


packages.sorted().joinTo(this, separator = "\n", postfix = "\n")
modules.map { (module, packages) ->
"$MODULE_DELIMITER$module\n".takeIf { module.isNotBlank() }.orEmpty() + packages.filter(String::isNotBlank).sorted().joinToString(separator = "\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a problem that we could have just the module name (without packages) or just packages (without module)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Packages without module can't happen, empty modules fixed

.associate { (key, value) -> key to value }

private fun splitPackages(packages: List<String>): Map<Module, Set<String>> {
var lastModule: Module = ""
Copy link
Contributor

Choose a reason for hiding this comment

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

you can move it into fold's accumulator so it is fully functional

No that important tho

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, done

locations = packageList.locations.entries.associate { it.key to "$moduleFilename${it.value}" }
)?.let { fragments.add(it) } ?: fallbackToCopy(input, output)
}
return canProcess(input, moduleContext)
Copy link
Contributor

Choose a reason for hiding this comment

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

a this point you know the result without calling this twice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

val linkFormat = fragments.first().linkFormat

if (!fragments.all { it.linkFormat == linkFormat }) {
context.logger.error("Link format is inconsistent between modules")
Copy link
Contributor

Choose a reason for hiding this comment

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

pls add more info to message. I think it is ok to just add whole entries there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@MarcinAman MarcinAman linked an issue Jun 23, 2021 that may be closed by this pull request
@kamildoleglo kamildoleglo merged commit 0bf1d0f into master Jul 5, 2021
@kamildoleglo kamildoleglo deleted the flatten-multimodule branch July 5, 2021 12:10
@MarcinAman MarcinAman linked an issue Jul 7, 2021 that may be closed by this pull request
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.

Merge package lists in MM Javadoc external links should include correct module name
2 participants