We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hey all,
Would it be feasible to add a a Gradle task that prints total dependencies size and (dependency+(size in kb)) list sorted by size desc?
Something like:
asks.register("depsize") { description = 'Prints dependencies for "default" configuration' doLast() { listConfigurationDependencies(configurations.default) } } tasks.register("depsize-all-configurations") { description = 'Prints dependencies for all available configurations' doLast() { configurations .findAll { it.isCanBeResolved() } .each { listConfigurationDependencies(it) } } } def listConfigurationDependencies(Configuration configuration) { def formatStr = "%,10.2f" def size = configuration.collect { it.length() / (1024 * 1024) }.sum() def out = new StringBuffer() out << "\nConfiguration name: \"${configuration.name}\"\n" if (size) { out << 'Total dependencies size:'.padRight(65) out << "${String.format(formatStr, size)} Mb\n\n" configuration.sort { -it.length() } .each { out << "${it.name}".padRight(65) out << "${String.format(formatStr, (it.length() / 1024))} kb\n" } } else { out << 'No dependencies found'; } println(out) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hey all,
Would it be feasible to add a a Gradle task that prints total dependencies size and (dependency+(size in kb)) list sorted by size desc?
Something like:
The text was updated successfully, but these errors were encountered: