Util for golem that sums up sizes of dex segments.

BUG=

Change-Id: I87aff4720102aa56966ea4c6058f1a6d95bd8f44
diff --git a/build.gradle b/build.gradle
index b8764b5..a3a6419 100644
--- a/build.gradle
+++ b/build.gradle
@@ -323,6 +323,20 @@
     }
 }
 
+task DexSegments(type: Jar) {
+    from sourceSets.main.output
+    baseName 'dexsegments'
+    manifest {
+      attributes 'Main-Class': 'com.android.tools.r8.DexSegments'
+    }
+    // In order to build without dependencies, pass the exclude_deps property using:
+    // gradle -Pexclude_deps DexSegments
+    if (!project.hasProperty('exclude_deps')) {
+        // Also include dependencies
+        from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
+    }
+}
+
 task sourceJar(type: Jar, dependsOn: classes) {
     classifier = 'src'
     from sourceSets.main.allSource