Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@NickJian
Created June 22, 2017 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NickJian/2f169e7bd15c74232fb36bdb12d6af08 to your computer and use it in GitHub Desktop.
Save NickJian/2f169e7bd15c74232fb36bdb12d6af08 to your computer and use it in GitHub Desktop.
// ./gradlew libsize to list each lib size
task(libsize) << {
def size = 0;
configurations.<config>.collect { it.length() / (1024 * 1024) }.each { size += it }
println "Total dependencies size: ${Math.round(size * 100) / 100} Mb"
configurations
.<config>
.sort { -it.length() }
.each { println "${it.name} : ${Math.round(it.length() / (1024) * 100) / 100} kb" }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment