diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index e5d69823494..854f3fc5e18 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -55,7 +55,6 @@ repositories { extra["buildSrcKotlinRepo"]?.let { maven(url = it) } - maven(url = "https://dl.bintray.com/kotlin/kotlin-dev") // for dex-method-list maven(url = "https://repo.gradle.org/gradle/libs-releases-local") // for native-platform jcenter() } @@ -64,7 +63,7 @@ dependencies { compile("net.rubygrapefruit:native-platform:${property("versions.native-platform")}") compile("net.rubygrapefruit:native-platform-windows-amd64:${property("versions.native-platform")}") compile("net.rubygrapefruit:native-platform-windows-i386:${property("versions.native-platform")}") - compile("com.jakewharton.dex:dex-method-list:2.0.0-alpha") + compile("com.jakewharton.dex:dex-method-list:3.0.0") // TODO: adding the dep to the plugin breaks the build unexpectedly, resolve and uncomment // compile("org.jetbrains.kotlin:kotlin-gradle-plugin:${rootProject.extra["bootstrap_kotlin_version"]}") // Shadow plugin is used in many projects of the main build. Once it's no longer used in buildSrc, please move this dependency to the root project diff --git a/buildSrc/src/main/kotlin/plugins/DexMethodCount.kt b/buildSrc/src/main/kotlin/plugins/DexMethodCount.kt index c788ae86abc..9182acc4b9c 100644 --- a/buildSrc/src/main/kotlin/plugins/DexMethodCount.kt +++ b/buildSrc/src/main/kotlin/plugins/DexMethodCount.kt @@ -23,11 +23,11 @@ import java.io.File open class DexMethodCount : DefaultTask() { data class Counts( - val total: Int, - val totalOwnPackages: Int?, - val totalOtherPackages: Int?, - val byPackage: Map, - val byClass: Map + val total: Int, + val totalOwnPackages: Int?, + val totalOtherPackages: Int?, + val byPackage: Map, + val byClass: Map ) @InputFile @@ -58,7 +58,7 @@ open class DexMethodCount : DefaultTask() { @TaskAction fun invoke() { - val methods = DexMethods.list(jarFile) + val methods = dexMethods(jarFile) val counts = methods.getCounts().also { this.counts = it } @@ -73,16 +73,18 @@ open class DexMethodCount : DefaultTask() { val ownPackages = ownPackages?.map { it + '.' } val byOwnPackages = if (ownPackages != null) { - this.partition { method -> ownPackages.any { method.declaringType.startsWith(it) }}.let { + this.partition { method -> ownPackages.any { method.declaringType.startsWith(it) } }.let { it.first.size to it.second.size } } else (null to null) - return Counts(total = this.size, - totalOwnPackages = byOwnPackages.first, - totalOtherPackages = byOwnPackages.second, - byPackage = byPackage, - byClass = byClass) + return Counts( + total = this.size, + totalOwnPackages = byOwnPackages.first, + totalOtherPackages = byOwnPackages.second, + byPackage = byPackage, + byClass = byClass + ) } private fun printTotals(counts: Counts) {