-
Notifications
You must be signed in to change notification settings - Fork 408
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
Conversation
|
||
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") |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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 = "" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
2ae1b9a
to
53a6327
Compare
8e4e226
to
73ab67a
Compare
No description provided.